Skip to contentSkip to conversation

pinctrl: renesas: r8a779a0: Add I2C pins, groups and functions

PATCH Superseded Ulrich Hecht 2 participants 2 messages Dec 1, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: renesas: r8a779a0: Add I2C pins, groups and functions

This patch adds I2C0-6 pins, groups and functions to the R8A779A0 (V3U) SoC.

---

Hi!

This patch was missing from the "pinctrl: renesas: basic R8A779A0 (V3U) support" series. I have thus posted it on its own for review now and will include it in v2 of the series later.

CU
Uli

 drivers/pinctrl/renesas/pfc-r8a779a0.c | 108 +++++++++++++++++++++++++
 1 file changed, 108 insertions(+)
drivers/pinctrl/renesas/pfc-r8a779a0.c +108 -0
index 8ce7238e8ad3..d0d0a682b13b 100644
@@ -1199,6 +1199,70 @@ static const struct sh_pfc_pin pinmux_pins[] = {
 	PINMUX_GPIO_GP_ALL(),
 };
 
+/* - I2C0 ------------------------------------------------------------------- */
+
+static const unsigned int i2c0_pins[] = {
+	/* SDA0, SCL0 */
+	RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 2),
+};
+static const unsigned int i2c0_mux[] = {
+	GP2_03_MARK, GP2_02_MARK,
+};
+
+/* - I2C1 ------------------------------------------------------------------- */
+static const unsigned int i2c1_pins[] = {
+	/* SDA1, SCL1 */
+	RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 4),
+};
+static const unsigned int i2c1_mux[] = {
+	GP2_05_MARK, GP2_04_MARK,
+};
+
+/* - I2C2 ------------------------------------------------------------------- */
+static const unsigned int i2c2_pins[] = {
+	/* SDA2, SCL2 */
+	RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 6),
+};
+static const unsigned int i2c2_mux[] = {
+	GP2_07_MARK, GP2_06_MARK,
+};
+
+/* - I2C3 ------------------------------------------------------------------- */
+static const unsigned int i2c3_pins[] = {
+	/* SDA3, SCL3 */
+	RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 8),
+};
+static const unsigned int i2c3_mux[] = {
+	GP2_09_MARK, GP2_08_MARK,
+};
+
+/* - I2C4 ------------------------------------------------------------------- */
+static const unsigned int i2c4_pins[] = {
+	/* SDA4, SCL4 */
+	RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 10),
+};
+static const unsigned int i2c4_mux[] = {
+	GP2_11_MARK, GP2_10_MARK,
+};
+
+/* - I2C5 ------------------------------------------------------------------- */
+static const unsigned int i2c5_pins[] = {
+	/* SDA5, SCL5 */
+	RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 12),
+};
+static const unsigned int i2c5_mux[] = {
+	GP2_13_MARK, GP2_12_MARK,
+};
+
+/* - I2C6 ------------------------------------------------------------------- */
+static const unsigned int i2c6_pins[] = {
+	/* SDA5, SCL5 */
+	RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 14),
+};
+static const unsigned int i2c6_mux[] = {
+	GP2_15_MARK, GP2_14_MARK,
+};
+
 /* - SCIF0 ------------------------------------------------------------------ */
 static const unsigned int scif0_data_pins[] = {
 	/* RX0, TX0 */
@@ -1301,6 +1365,14 @@ static const unsigned int scif_clk_mux[] = {
 };
 
 static const struct sh_pfc_pin_group pinmux_groups[] = {
+	SH_PFC_PIN_GROUP(i2c0),
+	SH_PFC_PIN_GROUP(i2c1),
+	SH_PFC_PIN_GROUP(i2c2),
+	SH_PFC_PIN_GROUP(i2c3),
+	SH_PFC_PIN_GROUP(i2c4),
+	SH_PFC_PIN_GROUP(i2c5),
+	SH_PFC_PIN_GROUP(i2c6),
+
 	SH_PFC_PIN_GROUP(scif0_data),
 	SH_PFC_PIN_GROUP(scif0_clk),
 	SH_PFC_PIN_GROUP(scif0_ctrl),
@@ -1316,6 +1388,34 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(scif_clk),
 };
 
+static const char * const i2c0_groups[] = {
+	"i2c0",
+};
+
+static const char * const i2c1_groups[] = {
+	"i2c1",
+};
+
+static const char * const i2c2_groups[] = {
+	"i2c2",
+};
+
+static const char * const i2c3_groups[] = {
+	"i2c3",
+};
+
+static const char * const i2c4_groups[] = {
+	"i2c4",
+};
+
+static const char * const i2c5_groups[] = {
+	"i2c5",
+};
+
+static const char * const i2c6_groups[] = {
+	"i2c6",
+};
+
 static const char * const scif0_groups[] = {
 	"scif0_data",
 	"scif0_clk",
@@ -1345,6 +1445,14 @@ static const char * const scif_clk_groups[] = {
 };
 
 static const struct sh_pfc_function pinmux_functions[] = {
+	SH_PFC_FUNCTION(i2c0),
+	SH_PFC_FUNCTION(i2c1),
+	SH_PFC_FUNCTION(i2c2),
+	SH_PFC_FUNCTION(i2c3),
+	SH_PFC_FUNCTION(i2c4),
+	SH_PFC_FUNCTION(i2c5),
+	SH_PFC_FUNCTION(i2c6),
+
 	SH_PFC_FUNCTION(scif0),
 	SH_PFC_FUNCTION(scif1),
 	SH_PFC_FUNCTION(scif3),
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Uli,

Quoted 11 lines · Ulrich Hecht

This patch adds I2C0-6 pins, groups and functions to the R8A779A0 (V3U) SoC.

---

Hi!

This patch was missing from the "pinctrl: renesas: basic R8A779A0 (V3U) support" series. I have thus posted it on its own for review now and will include it in v2 of the series later.

Thanks!

drivers/pinctrl/renesas/pfc-r8a779a0.c static const struct sh_pfc_pin pinmux_pins[] = { · line 1203

Quoted 8 lines
drivers/pinctrl/renesas/pfc-r8a779a0.c +2 -0
@@ -1199,6 +1199,70 @@ static const struct sh_pfc_pin pinmux_pins[] = {
        PINMUX_GPIO_GP_ALL(),
 };
 
+/* - I2C0 ------------------------------------------------------------------- */
+

Please drop this superfluous blank line.

drivers/pinctrl/renesas/pfc-r8a779a0.c static const struct sh_pfc_pin pinmux_pins[] = { · line 1209

Quoted 6 lines
drivers/pinctrl/renesas/pfc-r8a779a0.c +6 -0
+static const unsigned int i2c0_pins[] = {
+       /* SDA0, SCL0 */
+       RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 2),
+};
+static const unsigned int i2c0_mux[] = {
+       GP2_03_MARK, GP2_02_MARK,

If we need PINMUX_PHYS()for the I2C pins[1], then this should become:

    SDA0_MARK, SCL0_MARK,

Likewise for the other I2C signals.

The rest looks good to me. so with the above corrected/clarified:

[1] https://lore.kernel.org/linux-renesas-soc/CAMuHMdVSF_8JmR5t1aMPktY=J7=BvUbWLzPGnb9=QnRrLeA2ew@mail.gmail.com/

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