pinctrl: sh-pfc: r8a7791: add R8A7743 support
Subsystems (4)
PATCH v3 1/1 pinctrl: sh-pfc: r8a7791: add R8A7743 support
Renesas RZ/G1M (R8A7743) is pin compatible with R-Car M2-W/N (R8A7791/3), however it doesn't have several automotive specific peripherals. Annotate all the items that only exist on the R-Car SoCs and only supply the pin groups/functions existing on a given SoC...
---
This patch is against the 'devel' branch of Linus Walleij's 'linux-pinctrl.git' repo plus 4 R8A7791 PFC fixes and the "grand I2C rename" patch...
Changes in version 3:
- updated the PFC bindings.
Changes in version 2:
- switch to supplying exactly the groups/functions existing on a given SoC, update the patch descriptions accordingly;
- resolved rejects due to the "grand I2C rename" patch being updated.
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt | 1 drivers/pinctrl/sh-pfc/Kconfig | 5 drivers/pinctrl/sh-pfc/Makefile | 1 drivers/pinctrl/sh-pfc/core.c | 6 drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 1889 +++++----- drivers/pinctrl/sh-pfc/sh_pfc.h | 1 6 files changed, 1023 insertions(+), 880 deletions(-)
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 -0
@@ -13,6 +13,7 @@ Required Properties: - "renesas,pfc-emev2": for EMEV2 (EMMA Mobile EV2) compatible pin-controller. - "renesas,pfc-r8a73a4": for R8A73A4 (R-Mobile APE6) compatible pin-controller. - "renesas,pfc-r8a7740": for R8A7740 (R-Mobile A1) compatible pin-controller. + - "renesas,pfc-r8a7743": for R8A7743 (RZ/G1M) compatible pin-controller. - "renesas,pfc-r8a7778": for R8A7778 (R-Mobile M1) compatible pin-controller. - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller. - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
drivers/pinctrl/sh-pfc/Kconfig +5 -0
@@ -34,6 +34,11 @@ config PINCTRL_PFC_R8A7740 depends on ARCH_R8A7740 select PINCTRL_SH_PFC_GPIO +config PINCTRL_PFC_R8A7743 + def_bool y + depends on ARCH_R8A7743 + select PINCTRL_SH_PFC + config PINCTRL_PFC_R8A7778 def_bool y depends on ARCH_R8A7778
drivers/pinctrl/sh-pfc/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_PINCTRL_SH_PFC_GPIO) += gpi obj-$(CONFIG_PINCTRL_PFC_EMEV2) += pfc-emev2.o obj-$(CONFIG_PINCTRL_PFC_R8A73A4) += pfc-r8a73a4.o obj-$(CONFIG_PINCTRL_PFC_R8A7740) += pfc-r8a7740.o +obj-$(CONFIG_PINCTRL_PFC_R8A7743) += pfc-r8a7791.o obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
drivers/pinctrl/sh-pfc/core.c +6 -0
@@ -485,6 +485,12 @@ static const struct of_device_id sh_pfc_ .data = &r8a7740_pinmux_info, },#endif +#ifdef CONFIG_PINCTRL_PFC_R8A7743 + { + .compatible = "renesas,pfc-r8a7743", + .data = &r8a7743_pinmux_info, + }, +#endif #ifdef CONFIG_PINCTRL_PFC_R8A7778 { .compatible = "renesas,pfc-r8a7778",
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +1009 -880
2,674 lines not on this page · raw message
drivers/pinctrl/sh-pfc/sh_pfc.h +1 -0
@@ -259,6 +259,7 @@ struct sh_pfc_soc_info {extern const struct sh_pfc_soc_info emev2_pinmux_info;extern const struct sh_pfc_soc_info r8a73a4_pinmux_info;extern const struct sh_pfc_soc_info r8a7740_pinmux_info; +extern const struct sh_pfc_soc_info r8a7743_pinmux_info;extern const struct sh_pfc_soc_info r8a7778_pinmux_info;extern const struct sh_pfc_soc_info r8a7779_pinmux_info;extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
Quoted 14 lines · Sergei Shtylyov
Renesas RZ/G1M (R8A7743) is pin compatible with R-Car M2-W/N (R8A7791/3), however it doesn't have several automotive specific peripherals. Annotate all the items that only exist on the R-Car SoCs and only supply the pin groups/functions existing on a given SoC...
Signed-off-by Sergei Shtylyov <[email protected]>---
This patch is against the 'devel' branch of Linus Walleij's 'linux-pinctrl.git' repo plus 4 R8A7791 PFC fixes and the "grand I2C rename" patch...Changes in version 3:
- updated the PFC bindings.
Quoted 6 lines
Changes in version 2:
- switch to supplying exactly the groups/functions existing on a given SoC, update the patch descriptions accordingly;
- resolved rejects due to the "grand I2C rename" patch being updated.Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt | 1
Quoted 6 lines
drivers/pinctrl/sh-pfc/Kconfig | 5 drivers/pinctrl/sh-pfc/Makefile | 1 drivers/pinctrl/sh-pfc/core.c | 6 drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 1889 +++++----- drivers/pinctrl/sh-pfc/sh_pfc.h | 1 6 files changed, 1023 insertions(+), 880 deletions(-)
Hi Sergei,
Quoted 11 lines · Sergei Shtylyov
Renesas RZ/G1M (R8A7743) is pin compatible with R-Car M2-W/N (R8A7791/3), however it doesn't have several automotive specific peripherals. Annotate all the items that only exist on the R-Car SoCs and only supply the pin groups/functions existing on a given SoC...
Signed-off-by Sergei Shtylyov <[email protected]>---
This patch is against the 'devel' branch of Linus Walleij's 'linux-pinctrl.git' repo plus 4 R8A7791 PFC fixes and the "grand I2C rename" patch...
Quoted 7 lines
Changes in version 3:
- updated the PFC bindings.Changes in version 2:
- switch to supplying exactly the groups/functions existing on a given SoC, update the patch descriptions accordingly;
- resolved rejects due to the "grand I2C rename" patch being updated.
Thanks for the update!
Quoted 8 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +0
-1@@ -129,11 +129,12 @@ enum {FN_A9 ,FN_MSIOF1_SS2 ,FN_I2C0_SDA ,FN_A10 ,FN_MSIOF1_TXD ,FN_MSIOF1_TXD_D , FN_A11, FN_MSIOF1_RXD, FN_I2C3_SCL_D, FN_MSIOF1_RXD_D, - FN_A12, FN_FMCLK, FN_I2C3_SDA_D, FN_MSIOF1_SCK_D,
drivers/pinctrl/sh-pfc/pfc-r8a7791.c enum { · line 137
Quoted 10 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +6
-4-FN_A13 ,FN_ATAG0_N_C ,FN_BPFCLK ,FN_MSIOF1_SS1_D , -FN_A14 ,FN_ATADIR0_N_C ,FN_FMIN ,FN_FMIN_C ,FN_MSIOF1_SYNC_D , -FN_A15 ,FN_BPFCLK_C , - FN_A16, FN_DREQ2_B, FN_FMCLK_C, FN_SCIFA1_SCK_B, +FN_A12 ,FN_FMCLK /* R8A779x only */ ,FN_I2C3_SDA_D ,FN_MSIOF1_SCK_D , +FN_A13 ,FN_ATAG0_N_C ,FN_BPFCLK /* R8A779x only */ ,FN_MSIOF1_SS1_D , +FN_A14 ,FN_ATADIR0_N_C ,FN_FMIN /* R8A779x only */ , +FN_FMIN_C /* R8A779x only */ ,FN_MSIOF1_SYNC_D , +FN_A15 ,FN_BPFCLK_C /* R8A779x only */ , + FN_A16, FN_DREQ2_B, FN_FMCLK_C /* R8A779x only */, FN_SCIFA1_SCK_B,
I still have mixed feelings about adding all these annotations. IMHO the groups and functions provide sufficient documentation, and not adding the annotations means less code has to be changed now, and perhaps in the future.
More about that in the r8a7794 patch...
Quoted 7 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +0
-3@@ -4419,359 +4506,367 @@ static const unsigned int vin2_clk_mux[] VI2_CLK_MARK, }; -static const struct sh_pfc_pin_group pinmux_groups[] = { -SH_PFC_PIN_GROUP (adi_common), -SH_PFC_PIN_GROUP (adi_chsel0),
[...]
drivers/pinctrl/sh-pfc/pfc-r8a7791.c static const unsigned int vin2_clk_mux[] · line 4512
Quoted 6 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +4
-2-SH_PFC_PIN_GROUP (vin2_clkenb), - SH_PFC_PIN_GROUP(vin2_clk), +static const struct { +struct sh_pfc_pin_group common[341 ]; +struct sh_pfc_pin_group r8a779x[9 ]; +} pinmux_groups = {
Thanks, that's exactly what I had in mind!
Quoted 3 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +3
-0+ .common = { +SH_PFC_PIN_GROUP (audio_clk_a), + SH_PFC_PIN_GROUP(audio_clk_b),
[...]
drivers/pinctrl/sh-pfc/pfc-r8a7791.c static const unsigned int vin2_clk_mux[] · line 4602
Quoted 6 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +6
-0+SH_PFC_PIN_GROUP (i2c4), +SH_PFC_PIN_GROUP (i2c4_b), +SH_PFC_PIN_GROUP (i2c4_c), +SH_PFC_PIN_GROUP (i2c8), +SH_PFC_PIN_GROUP (i2c8_b), + SH_PFC_PIN_GROUP(i2c8_c),
What happened to i2c7? (revealed by "git show -b").
Quoted 3 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +3
-0+SH_PFC_PIN_GROUP (i2c8), +SH_PFC_PIN_GROUP (i2c8_b), + SH_PFC_PIN_GROUP(i2c8_c),
[...]
Quoted 4 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +4
-0+SH_PFC_PIN_GROUP (vin2_clkenb), +SH_PFC_PIN_GROUP (vin2_clk ), + }, + .r8a779x = {
drivers/pinctrl/sh-pfc/pfc-r8a7791.c static const unsigned int vin2_clk_mux[] · line 4866
Quoted 10 lines
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +10
-0+SH_PFC_PIN_GROUP (adi_common), +SH_PFC_PIN_GROUP (adi_chsel0), +SH_PFC_PIN_GROUP (adi_chsel1), +SH_PFC_PIN_GROUP (adi_chsel2), +SH_PFC_PIN_GROUP (adi_common_b), +SH_PFC_PIN_GROUP (adi_chsel0_b), +SH_PFC_PIN_GROUP (adi_chsel1_b), +SH_PFC_PIN_GROUP (adi_chsel2_b), + SH_PFC_PIN_GROUP(mlb_3pin), + }
Given the relatively small additional set of data needed to support r8a779[13], it's probably not worth protecting it with #if defined(CONFIG_PINCTRL_PFC_R8A7791) || defined(CONFIG_PINCTRL_PFC_R8A7793).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds