diff options
| author | Hugo VALTIER <hugo@ahdrone.com> | 2026-07-17 09:59:15 +0200 |
|---|---|---|
| committer | Linus Walleij <linusw@kernel.org> | 2026-07-25 00:11:50 +0200 |
| commit | 83a9c8385ff10775958188c8f2a115c71c45b7ef (patch) | |
| tree | 43e21f0b67485d0b71e88d7a1c6cc8173c118768 | |
| parent | 0e5d8cf3f71a542762ed3eaef677258c87492dfa (diff) | |
| download | linux-next-83a9c8385ff10775958188c8f2a115c71c45b7ef.tar.gz linux-next-83a9c8385ff10775958188c8f2a115c71c45b7ef.zip | |
pinctrl: rockchip: extract iomux_recalced_routes_init()
Extract the per-bank recalced_mask and route_mask computation out of
rockchip_pinctrl_get_soc_data() into a separate function and call it
from rockchip_pinctrl_probe().
This allows SoC-specific init code to swap the mux tables before
the masks are computed.
No functional change intended.
Signed-off-by: Hugo VALTIER <hugo@ahdrone.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
| -rw-r--r-- | drivers/pinctrl/pinctrl-rockchip.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 849e72f1832c..549834501e7f 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -4370,7 +4370,18 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( bank_pins += 8; } + } + + return ctrl; +} + +static void iomux_recalced_routes_init(struct rockchip_pinctrl *info) +{ + struct rockchip_pin_ctrl *ctrl = info->ctrl; + struct rockchip_pin_bank *bank = ctrl->pin_banks; + int i, j; + for (i = 0; i < ctrl->nr_banks; ++i, ++bank) { /* calculate the per-bank recalced_mask */ for (j = 0; j < ctrl->niomux_recalced; j++) { int pin = 0; @@ -4391,8 +4402,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( } } } - - return ctrl; } #define RK3288_GRF_GPIO6C_IOMUX 0x64 @@ -4505,6 +4514,8 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) /* try to find the optional reference to the ioc1 syscon */ info->regmap_ioc1 = syscon_regmap_lookup_by_phandle_optional(np, "rockchip,ioc1"); + iomux_recalced_routes_init(info); + ret = rockchip_pinctrl_register(pdev, info); if (ret) return ret; |
