diff mbox series

[1/5] pinctrl: sh-pfc: r8a77470: Add I2C4 pin groups

Message ID 1537278478-1744-2-git-send-email-fabrizio.castro@bp.renesas.com
State New
Headers show
Series Add I2C4/DU0/QSPI0/SDHI2/USB to r8a77470 | expand

Commit Message

Fabrizio Castro Sept. 18, 2018, 1:47 p.m. UTC
Add I2C4 pin groups and function to the R8A77470 SoC.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
---
 drivers/pinctrl/sh-pfc/pfc-r8a77470.c | 51 +++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

Comments

Geert Uytterhoeven Sept. 19, 2018, 8:57 a.m. UTC | #1
Hi Fabrizio,

On Tue, Sep 18, 2018 at 3:48 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Add I2C4 pin groups and function to the R8A77470 SoC.

Thanks for your patch!

Any specific reason you added I2C4 only, and not the other I2C instances?
Usually we add all of them in one run.

> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Reviewed-by: Biju Das <biju.das@bp.renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Fabrizio Castro Sept. 19, 2018, 9:49 a.m. UTC | #2
Hello Geert,

Thank you for your feedback.

> Subject: Re: [PATCH 1/5] pinctrl: sh-pfc: r8a77470: Add I2C4 pin groups
>
> Hi Fabrizio,
>
> On Tue, Sep 18, 2018 at 3:48 PM Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Add I2C4 pin groups and function to the R8A77470 SoC.
>
> Thanks for your patch!
>
> Any specific reason you added I2C4 only, and not the other I2C instances?
> Usually we add all of them in one run.

The iwg23s is a very small Raspberry Pi like SBC, there isn't much on it, therefore we can't test all of the interfaces we would like to test.
The plan is to start supporting what we can easily test/access, for everything else we would like to wait and see, maybe at a later stage?

Thanks,
Fab

>
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Reviewed-by: Biju Das <biju.das@bp.renesas.com>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> 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



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
Geert Uytterhoeven Sept. 20, 2018, 10:07 a.m. UTC | #3
Hi Fabrizio,

On Wed, Sep 19, 2018 at 11:50 AM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> > Subject: Re: [PATCH 1/5] pinctrl: sh-pfc: r8a77470: Add I2C4 pin groups
> > On Tue, Sep 18, 2018 at 3:48 PM Fabrizio Castro
> > <fabrizio.castro@bp.renesas.com> wrote:
> > > Add I2C4 pin groups and function to the R8A77470 SoC.
> >
> > Thanks for your patch!
> >
> > Any specific reason you added I2C4 only, and not the other I2C instances?
> > Usually we add all of them in one run.
>
> The iwg23s is a very small Raspberry Pi like SBC, there isn't much on it, therefore we can't test all of the interfaces we would like to test.
> The plan is to start supporting what we can easily test/access, for everything else we would like to wait and see, maybe at a later stage?

If your target is just the iwg23s, this is indeed fine.
However, you may have customers who want to use this SoC in their own products,
and thus aren't limited to the pins available on iwg23s.
Including this support upstream makes their life easier. While not everything
can be tested, it will at least have received some review.

Anyway, I'll queue this series in sh-pfc-for-v4.20.

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77470.c b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
index 995c959..d4de404 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
@@ -1197,6 +1197,42 @@  static const unsigned int avb_avtp_capture_b_pins[] = {
 static const unsigned int avb_avtp_capture_b_mux[] = {
 	AVB_AVTP_CAPTURE_B_MARK,
 };
+/* - I2C4 ------------------------------------------------------------------- */
+static const unsigned int i2c4_a_pins[] = {
+	/* SCL, SDA */
+	RCAR_GP_PIN(4, 10), RCAR_GP_PIN(4, 11),
+};
+static const unsigned int i2c4_a_mux[] = {
+	SCL4_A_MARK, SDA4_A_MARK,
+};
+static const unsigned int i2c4_b_pins[] = {
+	/* SCL, SDA */
+	RCAR_GP_PIN(5, 30), RCAR_GP_PIN(5, 31),
+};
+static const unsigned int i2c4_b_mux[] = {
+	SCL4_B_MARK, SDA4_B_MARK,
+};
+static const unsigned int i2c4_c_pins[] = {
+	/* SCL, SDA */
+	RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5),
+};
+static const unsigned int i2c4_c_mux[] = {
+	SCL4_C_MARK, SDA4_C_MARK,
+};
+static const unsigned int i2c4_d_pins[] = {
+	/* SCL, SDA */
+	RCAR_GP_PIN(2, 16), RCAR_GP_PIN(2, 17),
+};
+static const unsigned int i2c4_d_mux[] = {
+	SCL4_D_MARK, SDA4_D_MARK,
+};
+static const unsigned int i2c4_e_pins[] = {
+	/* SCL, SDA */
+	RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 6),
+};
+static const unsigned int i2c4_e_mux[] = {
+	SCL4_E_MARK, SDA4_E_MARK,
+};
 /* - MMC -------------------------------------------------------------------- */
 static const unsigned int mmc_data1_pins[] = {
 	/* D0 */
@@ -1487,6 +1523,11 @@  static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(avb_avtp_capture_a),
 	SH_PFC_PIN_GROUP(avb_avtp_match_b),
 	SH_PFC_PIN_GROUP(avb_avtp_capture_b),
+	SH_PFC_PIN_GROUP(i2c4_a),
+	SH_PFC_PIN_GROUP(i2c4_b),
+	SH_PFC_PIN_GROUP(i2c4_c),
+	SH_PFC_PIN_GROUP(i2c4_d),
+	SH_PFC_PIN_GROUP(i2c4_e),
 	SH_PFC_PIN_GROUP(mmc_data1),
 	SH_PFC_PIN_GROUP(mmc_data4),
 	SH_PFC_PIN_GROUP(mmc_data8),
@@ -1541,6 +1582,15 @@  static const char * const avb_groups[] = {
 	"avb_avtp_match_b",
 	"avb_avtp_capture_b",
 };
+
+static const char * const i2c4_groups[] = {
+	"i2c4_a",
+	"i2c4_b",
+	"i2c4_c",
+	"i2c4_d",
+	"i2c4_e",
+};
+
 static const char * const mmc_groups[] = {
 	"mmc_data1",
 	"mmc_data4",
@@ -1604,6 +1654,7 @@  static const char * const scif_clk_groups[] = {
 
 static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(avb),
+	SH_PFC_FUNCTION(i2c4),
 	SH_PFC_FUNCTION(mmc),
 	SH_PFC_FUNCTION(scif0),
 	SH_PFC_FUNCTION(scif1),