mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 13:23:02 -04:00
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>
This commit is contained in:
committed by
Linus Walleij
parent
0e5d8cf3f7
commit
83a9c8385f
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user