
Hi Jonas,
Could you spit this patch in two part, one with fixes only, which I can merge it for master directly,
and another part for new feature and together with "Add gpio request" for next?
Thanks,
- Kever
On 2024/5/12 20:16, Jonas Karlman wrote:
This series includes some minor fixes, cleanup and add support for using the pinmux status cmd.
Following is an example on a Radxa ROCK 5A (RK3588S):
=> pinmux dev pinctrl dev: pinctrl => pinmux status GPIO0_A0 : gpio GPIO0_A1 : func-2 GPIO0_A2 : gpio GPIO0_A3 : gpio GPIO0_A4 : func-1 GPIO0_A5 : func-2 GPIO0_A6 : gpio GPIO0_A7 : gpio GPIO0_B0 : gpio GPIO0_B1 : gpio GPIO0_B2 : gpio GPIO0_B3 : gpio GPIO0_B4 : gpio GPIO0_B5 : func-10 GPIO0_B6 : func-10 GPIO0_B7 : gpio [...]
and on a ASUS TinkerBoard R2.0 (RK3288W):
=> pinmux dev pinctrl dev: pinctrl => pinmux status [...] GPIO2_C6 : gpio GPIO2_C7 : gpio GPIO2_D0 : unrouted GPIO2_D1 : unrouted GPIO2_D2 : unrouted GPIO2_D3 : unrouted GPIO2_D4 : unrouted GPIO2_D5 : unrouted GPIO2_D6 : unrouted GPIO2_D7 : unrouted GPIO3_A0 : func-2 GPIO3_A1 : func-2 [...]
Patch 1-3 are minor fixes so that correct pinmux status is reported.
Patch 4 refactor to use syscon_regmap_lookup_by_phandle() helper. Patch 6 refactor to get pinctrl device from gpio-ranges prop.
Patch 5 and 7 change to use pinctrl pin offset instead of bank num to get current pinmux.
Patch 8 add required ops for use of the pinmux status cmd.
Patch 9 add gpio-ranges props for remaining RK SoCs, this is strictly not needed for pinmux status cmd to function. However, the change to not require the pin controller offset to be 32 aligned was required to add gpio-ranges props for RK3288.
This series depends on the "rockchip: Add gpio request() ops and drop PCIe reset-gpios workaround" [1] series.
[1]https://patchwork.ozlabs.org/cover/1934100/
Jonas Karlman (9): pinctrl: rockchip: rk3188: Fix support for IOMUX_GPIO_ONLY flag pinctrl: rockchip: rv1126: Fix support for IOMUX_L_SOURCE_PMU flag pinctrl: rockchip: rk3588: Fix support for rockchip_get_mux() pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle() pinctrl: rockchip: Update get_gpio_mux() ops gpio: rockchip: Get pinctrl device from gpio-ranges prop gpio: rockchip: Use pinctrl pin offset to get_gpio_mux() pinctrl: rockchip: Add pinmux status related ops rockchip: gpio: Add gpio-ranges props
arch/arm/dts/rk3036-u-boot.dtsi | 12 ++ arch/arm/dts/rk3066a-u-boot.dtsi | 3 +- arch/arm/dts/rk3128-u-boot.dtsi | 16 ++ arch/arm/dts/rk322x-u-boot.dtsi | 16 ++ arch/arm/dts/rk3288-u-boot.dtsi | 33 ++++ arch/arm/dts/rk3308-u-boot.dtsi | 20 +++ arch/arm/dts/rk3328-u-boot.dtsi | 13 ++ arch/arm/dts/rk3368-u-boot.dtsi | 16 ++ arch/arm/dts/rk3399-u-boot.dtsi | 20 +++ arch/arm/dts/rv1108-u-boot.dtsi | 16 ++ arch/arm/dts/rv1126-u-boot.dtsi | 14 ++ drivers/gpio/rk_gpio.c | 44 +++-- .../pinctrl/rockchip/pinctrl-rockchip-core.c | 151 ++++++++++++++---- 13 files changed, 322 insertions(+), 52 deletions(-)