diff options
author | Andre Przywara <andre.przywara@arm.com> | 2025-03-07 02:58:24 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2025-03-13 16:48:57 +0300 |
commit | f5e2cd34b12f03208b7fcc89bf1b6c3b3508b085 (patch) | |
tree | 42c23e6028397c84fe879c1de036bf2200b38acc /lib/mpi/mpi-inline.c | |
parent | 6d079d93e4df90235ec15a9f11866881c2fe3a40 (diff) | |
download | linux-f5e2cd34b12f03208b7fcc89bf1b6c3b3508b085.tar.xz |
pinctrl: sunxi: allow reading mux values from DT
So far every Allwinner SoC needs a large table in the kernel code, to
describe the mapping between the pinctrl function names ("uart") and
the actual pincontroller mux value to be written into the registers.
This adds a lot of data into a single image kernel, and also looks
somewhat weird, as the DT can easily store the mux value.
Add some code that allows to avoid that table: the struct that describes
the existing pins will be build at *runtime*, based on very basic
information provided by the respective SoC's pinctrl driver. This
consists of the number of pins per bank, plus information which bank
provides IRQ support, along with the mux value to use for that.
The code will then iterate over all children of the pincontroller DT
node (which describe each pin group), and populate that struct with the
mapping between function names and mux values. The only thing that needs
adding in the DT is a property with that value, per pin group.
When this table is built, it will be handed over to the existing sunxi
pinctrl driver, which cannot tell a difference between a hardcoded
struct and this new one built at runtime. It will take care of
registering the pinctrl device with the pinctrl subsystem.
All a new SoC driver would need to do is to provide two arrays, and then
call the sunxi_pinctrl_dt_table_init() function.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/20250306235827.4895-6-andre.przywara@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'lib/mpi/mpi-inline.c')
0 files changed, 0 insertions, 0 deletions