All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates
@ 2018-11-06 10:35 Jacopo Mondi
  2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:35 UTC (permalink / raw)
  To: geert+renesas, horms, laurent.pinchart
  Cc: Jacopo Mondi, linus.walleij, linux-renesas-soc, linux-gpio

Hi Geert,
   thanks to your suggestion I made a variadic macro out of the
VIN_DATA_PIN_GROUP one. The macro accepts an optional third argument 'version'
and creates properly formatted names in the form of 'vin4_data8_a' in place of
the previous 'vin4_data_a8' ones.

I included in this series the refactoring of existing users of versioned
VIN_DATA_PIN_GROUP macro and upstreaming of VIN4 and VIN5 enablement for both
R-Car M3-N and E3, both of them users of versioned VIN groups.

Thanks
   j

v3 -> v4:
- The series gathers different patch series previously sent separately:
  [PATCH 0/2] pinctrl: sh-pfc: r8a77965: Add VIN4 and VIN5
  [PATCH] pinctrl: sh-pfc: r8a77990: Add VIN pins, groups and functions
  As E3 patch depends on the M3-N series, I made a single one out of those.
  Changelog for the E3 patch (which was actually at v3) is included in the
  single patch commit message.


Jacopo Mondi (4):
  pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP
  pinctrl: sh-pfc: Fix VIN versioned groups name
  pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions
  pinctrl: sh-pfc: r8a77990: Add VIN[4|5] groups/functions

 drivers/pinctrl/sh-pfc/pfc-r8a7792.c  |   6 +-
 drivers/pinctrl/sh-pfc/pfc-r8a7795.c  |  24 ++--
 drivers/pinctrl/sh-pfc/pfc-r8a7796.c  |  24 ++--
 drivers/pinctrl/sh-pfc/pfc-r8a77965.c | 254 ++++++++++++++++++++++++++++++++++
 drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 244 ++++++++++++++++++++++++++++++++
 drivers/pinctrl/sh-pfc/sh_pfc.h       |  17 +--
 6 files changed, 534 insertions(+), 35 deletions(-)

--
2.7.4

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP
  2018-11-06 10:35 [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates Jacopo Mondi
@ 2018-11-06 10:35 ` Jacopo Mondi
  2018-11-07 10:40   ` Simon Horman
  2018-11-08 10:58   ` Geert Uytterhoeven
  2018-11-06 10:35 ` [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name Jacopo Mondi
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 19+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:35 UTC (permalink / raw)
  To: geert+renesas, horms, laurent.pinchart
  Cc: Jacopo Mondi, linus.walleij, linux-renesas-soc, linux-gpio

VIN data groups may appear on different sets of pins, usually named
"vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support
appending the '_a' or '_b' suffix, leading to the definition of groups
names not consistent with the ones defined using SH_PFC_PIN_GROUP() macro.

Fix this by adding making the VIN_DATA_PIN_GROUP macro a variadic one,
which accepts an optional 'version' argument.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/pinctrl/sh-pfc/sh_pfc.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 458ae0a..0e0b4cc 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -54,15 +54,16 @@ struct sh_pfc_pin_group {
 
 /*
  * Using union vin_data saves memory occupied by the VIN data pins.
- * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
- * in this case.
+ * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups
+ * in this case. It accepts an optional 'version' argument used when the
+ * same group can appear on a different set of pins.
  */
-#define VIN_DATA_PIN_GROUP(n, s)				\
-	{							\
-		.name = #n#s,					\
-		.pins = n##_pins.data##s,			\
-		.mux = n##_mux.data##s,				\
-		.nr_pins = ARRAY_SIZE(n##_pins.data##s),	\
+#define VIN_DATA_PIN_GROUP(n, s, ...)					\
+	{								\
+		.name = #n#s#__VA_ARGS__,				\
+		.pins = n##__VA_ARGS__##_pins.data##s,			\
+		.mux = n##__VA_ARGS__##_mux.data##s,			\
+		.nr_pins = ARRAY_SIZE(n##__VA_ARGS__##_pins.data##s),	\
 	}
 
 union vin_data {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-06 10:35 [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates Jacopo Mondi
  2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
@ 2018-11-06 10:35 ` Jacopo Mondi
  2018-11-07 10:41   ` Simon Horman
  2018-11-08 10:59   ` Geert Uytterhoeven
  2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
  2018-11-06 10:35 ` [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: " Jacopo Mondi
  3 siblings, 2 replies; 19+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:35 UTC (permalink / raw)
  To: geert+renesas, horms, laurent.pinchart
  Cc: Jacopo Mondi, linus.walleij, linux-renesas-soc, linux-gpio

Versioned VIN groups can appear on different sets of pins. Using the
VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
an optional 'version' argument.

Use the 'version' argument for said macro to fix naming of versioned
groups for R-Car SoCs that defines them.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/pinctrl/sh-pfc/pfc-r8a7792.c |  6 +++---
 drivers/pinctrl/sh-pfc/pfc-r8a7795.c | 24 ++++++++++++------------
 drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 24 ++++++++++++------------
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7792.c b/drivers/pinctrl/sh-pfc/pfc-r8a7792.c
index bf0681b..a8a110d 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7792.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7792.c
@@ -1744,10 +1744,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	VIN_DATA_PIN_GROUP(vin1_data, 12),
 	VIN_DATA_PIN_GROUP(vin1_data, 10),
 	VIN_DATA_PIN_GROUP(vin1_data, 8),
-	VIN_DATA_PIN_GROUP(vin1_data_b, 24),
-	VIN_DATA_PIN_GROUP(vin1_data_b, 20),
+	VIN_DATA_PIN_GROUP(vin1_data, 24, _b),
+	VIN_DATA_PIN_GROUP(vin1_data, 20, _b),
 	SH_PFC_PIN_GROUP(vin1_data18_b),
-	VIN_DATA_PIN_GROUP(vin1_data_b, 16),
+	VIN_DATA_PIN_GROUP(vin1_data, 16, _b),
 	SH_PFC_PIN_GROUP(vin1_sync),
 	SH_PFC_PIN_GROUP(vin1_field),
 	SH_PFC_PIN_GROUP(vin1_clkenb),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
index 0af737d..20fac0f 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
@@ -4474,20 +4474,20 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(usb2),
 	SH_PFC_PIN_GROUP(usb2_ch3),
 	SH_PFC_PIN_GROUP(usb30),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 8),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 10),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 12),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 16),
+	VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
 	SH_PFC_PIN_GROUP(vin4_data18_a),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 20),
-	VIN_DATA_PIN_GROUP(vin4_data_a, 24),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 8),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 10),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 12),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 16),
+	VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+	VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+	VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+	VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
 	SH_PFC_PIN_GROUP(vin4_data18_b),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 20),
-	VIN_DATA_PIN_GROUP(vin4_data_b, 24),
+	VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+	VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
 	SH_PFC_PIN_GROUP(vin4_sync),
 	SH_PFC_PIN_GROUP(vin4_field),
 	SH_PFC_PIN_GROUP(vin4_clkenb),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
index 3a6d21d..b003abd 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
@@ -4409,20 +4409,20 @@ static const struct {
 		SH_PFC_PIN_GROUP(usb0),
 		SH_PFC_PIN_GROUP(usb1),
 		SH_PFC_PIN_GROUP(usb30),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 8),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 10),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 12),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 16),
+		VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+		VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+		VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+		VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
 		SH_PFC_PIN_GROUP(vin4_data18_a),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 20),
-		VIN_DATA_PIN_GROUP(vin4_data_a, 24),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 8),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 10),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 12),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 16),
+		VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+		VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+		VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+		VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+		VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+		VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
 		SH_PFC_PIN_GROUP(vin4_data18_b),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 20),
-		VIN_DATA_PIN_GROUP(vin4_data_b, 24),
+		VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+		VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
 		SH_PFC_PIN_GROUP(vin4_sync),
 		SH_PFC_PIN_GROUP(vin4_field),
 		SH_PFC_PIN_GROUP(vin4_clkenb),
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions
  2018-11-06 10:35 [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates Jacopo Mondi
  2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
  2018-11-06 10:35 ` [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name Jacopo Mondi
@ 2018-11-06 10:35 ` Jacopo Mondi
  2018-11-07 10:56   ` Simon Horman
                     ` (2 more replies)
  2018-11-06 10:35 ` [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: " Jacopo Mondi
  3 siblings, 3 replies; 19+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:35 UTC (permalink / raw)
  To: geert+renesas, horms, laurent.pinchart
  Cc: Jacopo Mondi, linus.walleij, linux-renesas-soc, linux-gpio

The VIN4 and VIN5 interfaces supports parallel video input.
Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car M3-N.

Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/pinctrl/sh-pfc/pfc-r8a77965.c | 254 ++++++++++++++++++++++++++++++++++
 1 file changed, 254 insertions(+)

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
index dfdd982..59ad320 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
@@ -3725,6 +3725,216 @@ static const unsigned int usb30_mux[] = {
 	USB30_PWEN_MARK, USB30_OVC_MARK,
 };
 
+/* - VIN4 ------------------------------------------------------------------- */
+static const unsigned int vin4_data18_a_pins[] = {
+	RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11),
+	RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+	RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15),
+	RCAR_GP_PIN(1, 2),  RCAR_GP_PIN(1, 3),
+	RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+	RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+	RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+	RCAR_GP_PIN(0, 4),  RCAR_GP_PIN(0, 5),
+	RCAR_GP_PIN(0, 6),  RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int vin4_data18_a_mux[] = {
+	VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+	VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+	VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+	VI4_DATA10_MARK,  VI4_DATA11_MARK,
+	VI4_DATA12_MARK,  VI4_DATA13_MARK,
+	VI4_DATA14_MARK,  VI4_DATA15_MARK,
+	VI4_DATA18_MARK,  VI4_DATA19_MARK,
+	VI4_DATA20_MARK,  VI4_DATA21_MARK,
+	VI4_DATA22_MARK,  VI4_DATA23_MARK,
+};
+
+static const union vin_data vin4_data_a_pins = {
+	.data24 = {
+		RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 9),
+		RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11),
+		RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+		RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15),
+		RCAR_GP_PIN(1, 0),  RCAR_GP_PIN(1, 1),
+		RCAR_GP_PIN(1, 2),  RCAR_GP_PIN(1, 3),
+		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+		RCAR_GP_PIN(0, 0),  RCAR_GP_PIN(0, 1),
+		RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+		RCAR_GP_PIN(0, 4),  RCAR_GP_PIN(0, 5),
+		RCAR_GP_PIN(0, 6),  RCAR_GP_PIN(0, 7),
+	},
+};
+
+static const union vin_data vin4_data_a_mux = {
+	.data24 = {
+		VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
+		VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+		VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+		VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+		VI4_DATA8_MARK,   VI4_DATA9_MARK,
+		VI4_DATA10_MARK,  VI4_DATA11_MARK,
+		VI4_DATA12_MARK,  VI4_DATA13_MARK,
+		VI4_DATA14_MARK,  VI4_DATA15_MARK,
+		VI4_DATA16_MARK,  VI4_DATA17_MARK,
+		VI4_DATA18_MARK,  VI4_DATA19_MARK,
+		VI4_DATA20_MARK,  VI4_DATA21_MARK,
+		VI4_DATA22_MARK,  VI4_DATA23_MARK,
+	},
+};
+
+static const unsigned int vin4_data18_b_pins[] = {
+	RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
+	RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+	RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+	RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
+	RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+	RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+	RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+	RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+	RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int vin4_data18_b_mux[] = {
+	VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+	VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+	VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+	VI4_DATA10_MARK,  VI4_DATA11_MARK,
+	VI4_DATA12_MARK,  VI4_DATA13_MARK,
+	VI4_DATA14_MARK,  VI4_DATA15_MARK,
+	VI4_DATA18_MARK,  VI4_DATA19_MARK,
+	VI4_DATA20_MARK,  VI4_DATA21_MARK,
+	VI4_DATA22_MARK,  VI4_DATA23_MARK,
+};
+
+static const union vin_data vin4_data_b_pins = {
+	.data24 = {
+		RCAR_GP_PIN(2, 0), RCAR_GP_PIN(2, 1),
+		RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
+		RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+		RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+		RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1),
+		RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
+		RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+		RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+		RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+		RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+		RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+		RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+	},
+};
+
+static const union vin_data vin4_data_b_mux = {
+	.data24 = {
+		VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
+		VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+		VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+		VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+		VI4_DATA8_MARK,   VI4_DATA9_MARK,
+		VI4_DATA10_MARK,  VI4_DATA11_MARK,
+		VI4_DATA12_MARK,  VI4_DATA13_MARK,
+		VI4_DATA14_MARK,  VI4_DATA15_MARK,
+		VI4_DATA16_MARK,  VI4_DATA17_MARK,
+		VI4_DATA18_MARK,  VI4_DATA19_MARK,
+		VI4_DATA20_MARK,  VI4_DATA21_MARK,
+		VI4_DATA22_MARK,  VI4_DATA23_MARK,
+	},
+};
+
+static const unsigned int vin4_sync_pins[] = {
+	/* VSYNC_N, HSYNC_N */
+	RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+};
+
+static const unsigned int vin4_sync_mux[] = {
+	VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK,
+};
+
+static const unsigned int vin4_field_pins[] = {
+	RCAR_GP_PIN(1, 16),
+};
+
+static const unsigned int vin4_field_mux[] = {
+	VI4_FIELD_MARK,
+};
+
+static const unsigned int vin4_clkenb_pins[] = {
+	RCAR_GP_PIN(1, 19),
+};
+
+static const unsigned int vin4_clkenb_mux[] = {
+	VI4_CLKENB_MARK,
+};
+
+static const unsigned int vin4_clk_pins[] = {
+	RCAR_GP_PIN(1, 27),
+};
+
+static const unsigned int vin4_clk_mux[] = {
+	VI4_CLK_MARK,
+};
+
+/* - VIN5 ------------------------------------------------------------------- */
+static const union vin_data vin5_data_pins = {
+	.data16 = {
+		RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+		RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+		RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+		RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+		RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+		RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
+		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+	},
+};
+
+static const union vin_data vin5_data_mux = {
+	.data16 = {
+		VI5_DATA0_MARK, VI5_DATA1_MARK,
+		VI5_DATA2_MARK, VI5_DATA3_MARK,
+		VI5_DATA4_MARK, VI5_DATA5_MARK,
+		VI5_DATA6_MARK, VI5_DATA7_MARK,
+		VI5_DATA8_MARK,  VI5_DATA9_MARK,
+		VI5_DATA10_MARK, VI5_DATA11_MARK,
+		VI5_DATA12_MARK, VI5_DATA13_MARK,
+		VI5_DATA14_MARK, VI5_DATA15_MARK,
+	},
+};
+
+static const unsigned int vin5_sync_pins[] = {
+	/* VSYNC_N, HSYNC_N */
+	RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 10),
+};
+
+static const unsigned int vin5_sync_mux[] = {
+	VI5_HSYNC_N_MARK, VI5_VSYNC_N_MARK,
+};
+
+static const unsigned int vin5_field_pins[] = {
+	RCAR_GP_PIN(1, 11),
+};
+
+static const unsigned int vin5_field_mux[] = {
+	VI5_FIELD_MARK,
+};
+
+static const unsigned int vin5_clkenb_pins[] = {
+	RCAR_GP_PIN(1, 20),
+};
+
+static const unsigned int vin5_clkenb_mux[] = {
+	VI5_CLKENB_MARK,
+};
+
+static const unsigned int vin5_clk_pins[] = {
+	RCAR_GP_PIN(1, 21),
+};
+
+static const unsigned int vin5_clk_mux[] = {
+	VI5_CLK_MARK,
+};
+
 static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(audio_clk_a_a),
 	SH_PFC_PIN_GROUP(audio_clk_a_b),
@@ -4000,6 +4210,24 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(usb0),
 	SH_PFC_PIN_GROUP(usb1),
 	SH_PFC_PIN_GROUP(usb30),
+	VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
+	SH_PFC_PIN_GROUP(vin4_data18_a),
+	VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+	VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+	VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
+	SH_PFC_PIN_GROUP(vin4_data18_b),
+	VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
+	SH_PFC_PIN_GROUP(vin4_sync),
+	SH_PFC_PIN_GROUP(vin4_field),
+	SH_PFC_PIN_GROUP(vin4_clkenb),
+	SH_PFC_PIN_GROUP(vin4_clk),
+	VIN_DATA_PIN_GROUP(vin5_data, 8),
+	VIN_DATA_PIN_GROUP(vin5_data, 16),
+	SH_PFC_PIN_GROUP(vin5_sync),
+	SH_PFC_PIN_GROUP(vin5_field),
+	SH_PFC_PIN_GROUP(vin5_clkenb),
+	SH_PFC_PIN_GROUP(vin5_clk),
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4392,6 +4620,30 @@ static const char * const usb30_groups[] = {
 	"usb30",
 };
 
+static const char * const vin4_groups[] = {
+	"vin4_data8_a",
+	"vin4_data16_a",
+	"vin4_data18_a",
+	"vin4_data24_a",
+	"vin4_data8_b",
+	"vin4_data16_b",
+	"vin4_data18_b",
+	"vin4_data24_b",
+	"vin4_sync",
+	"vin4_field",
+	"vin4_clkenb",
+	"vin4_clk",
+};
+
+static const char * const vin5_groups[] = {
+	"vin5_data8",
+	"vin5_data16",
+	"vin5_sync",
+	"vin5_field",
+	"vin5_clkenb",
+	"vin5_clk",
+};
+
 static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(audio_clk),
 	SH_PFC_FUNCTION(avb),
@@ -4432,6 +4684,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(usb0),
 	SH_PFC_FUNCTION(usb1),
 	SH_PFC_FUNCTION(usb30),
+	SH_PFC_FUNCTION(vin4),
+	SH_PFC_FUNCTION(vin5),
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: Add VIN[4|5] groups/functions
  2018-11-06 10:35 [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates Jacopo Mondi
                   ` (2 preceding siblings ...)
  2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
@ 2018-11-06 10:35 ` Jacopo Mondi
  2018-11-07 10:34   ` Simon Horman
  3 siblings, 1 reply; 19+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:35 UTC (permalink / raw)
  To: geert+renesas, horms, laurent.pinchart
  Cc: Jacopo Mondi, linus.walleij, linux-renesas-soc, linux-gpio

Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car E3.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

---
v3 -> v4:
- Use new variadic version of VIN_DATA_PIN_GROUP macro

v2 -> v3:
- Rebased on v4.20-rc1
- Use the newly introduced VIN_DATA_PIN_GROUP_VER macro

Incorporate Geert's comments:
- vin5_data8_b is only used with 8 pins: use regular SH_PFC_PIN_GROUP()
- remove stf groups for vin4/vin5
- confirmed that pins [23-8] of vin4's groups 'a' and 'b' are shared
- confirmed with HW team the synchronism pins in vin5 are only for group 'a'
---
 drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 244 ++++++++++++++++++++++++++++++++++
 1 file changed, 244 insertions(+)

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
index 1fdafa4..16fd139 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
@@ -2433,6 +2433,190 @@ static const unsigned int usb30_id_mux[] = {
 	USB3HS0_ID_MARK,
 };
 
+/* - VIN4 ------------------------------------------------------------------- */
+static const union vin_data vin4_data_a_pins = {
+	.data24 = {
+		RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
+		RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
+		RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
+		RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
+		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
+		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
+		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
+		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
+	},
+};
+
+static const union vin_data vin4_data_a_mux = {
+	.data24 = {
+		VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
+		VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+		VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+		VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+		VI4_DATA8_MARK,   VI4_DATA9_MARK,
+		VI4_DATA10_MARK,  VI4_DATA11_MARK,
+		VI4_DATA12_MARK,  VI4_DATA13_MARK,
+		VI4_DATA14_MARK,  VI4_DATA15_MARK,
+		VI4_DATA16_MARK,  VI4_DATA17_MARK,
+		VI4_DATA18_MARK,  VI4_DATA19_MARK,
+		VI4_DATA20_MARK,  VI4_DATA21_MARK,
+		VI4_DATA22_MARK,  VI4_DATA23_MARK,
+	},
+};
+
+static const union vin_data vin4_data_b_pins = {
+	.data24 = {
+		RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
+		RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
+		RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
+		RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
+		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
+		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
+		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 15),
+		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
+	},
+};
+
+static const union vin_data vin4_data_b_mux = {
+	.data24 = {
+		VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
+		VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+		VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+		VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+		VI4_DATA8_MARK,   VI4_DATA9_MARK,
+		VI4_DATA10_MARK,  VI4_DATA11_MARK,
+		VI4_DATA12_MARK,  VI4_DATA13_MARK,
+		VI4_DATA14_MARK,  VI4_DATA15_MARK,
+		VI4_DATA16_MARK,  VI4_DATA17_MARK,
+		VI4_DATA18_MARK,  VI4_DATA19_MARK,
+		VI4_DATA20_MARK,  VI4_DATA21_MARK,
+		VI4_DATA22_MARK,  VI4_DATA23_MARK,
+	},
+};
+
+static const unsigned int vin4_sync_pins[] = {
+	/* HSYNC, VSYNC */
+	RCAR_GP_PIN(2, 25), RCAR_GP_PIN(2, 24),
+};
+
+static const unsigned int vin4_sync_mux[] = {
+	VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK,
+};
+
+static const unsigned int vin4_field_pins[] = {
+	RCAR_GP_PIN(2, 23),
+};
+
+static const unsigned int vin4_field_mux[] = {
+	VI4_FIELD_MARK,
+};
+
+static const unsigned int vin4_clkenb_pins[] = {
+	RCAR_GP_PIN(1, 2),
+};
+
+static const unsigned int vin4_clkenb_mux[] = {
+	VI4_CLKENB_MARK,
+};
+
+static const unsigned int vin4_clk_pins[] = {
+	RCAR_GP_PIN(2, 22),
+};
+
+static const unsigned int vin4_clk_mux[] = {
+	VI4_CLK_MARK,
+};
+
+/* - VIN5 ------------------------------------------------------------------- */
+static const union vin_data vin5_data_a_pins = {
+	.data16 = {
+		RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
+		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
+		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
+		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+		RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+		RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
+		RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
+		RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+	},
+};
+
+static const union vin_data vin5_data_a_mux = {
+	.data16 = {
+		VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
+		VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
+		VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
+		VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
+		VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
+		VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
+		VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
+		VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
+	},
+};
+
+static const unsigned int vin5_data8_b_pins[] = {
+	RCAR_GP_PIN(2, 23), RCAR_GP_PIN(0, 4),
+	RCAR_GP_PIN(0, 7),  RCAR_GP_PIN(0, 12),
+	RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 14),
+	RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
+};
+
+static const unsigned int vin5_data8_b_mux[] = {
+	VI5_DATA0_B_MARK,  VI5_DATA1_B_MARK,
+	VI5_DATA2_B_MARK,  VI5_DATA3_B_MARK,
+	VI5_DATA4_B_MARK,  VI5_DATA5_B_MARK,
+	VI5_DATA6_B_MARK,  VI5_DATA7_B_MARK,
+};
+
+static const unsigned int vin5_sync_a_pins[] = {
+	/* HSYNC_N, VSYNC_N */
+	RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 9),
+};
+
+static const unsigned int vin5_sync_a_mux[] = {
+	VI5_HSYNC_N_A_MARK, VI5_VSYNC_N_A_MARK,
+};
+
+static const unsigned int vin5_field_a_pins[] = {
+	RCAR_GP_PIN(1, 10),
+};
+
+static const unsigned int vin5_field_a_mux[] = {
+	VI5_FIELD_A_MARK,
+};
+
+static const unsigned int vin5_clkenb_a_pins[] = {
+	RCAR_GP_PIN(0, 1),
+};
+
+static const unsigned int vin5_clkenb_a_mux[] = {
+	VI5_CLKENB_A_MARK,
+};
+
+static const unsigned int vin5_clk_a_pins[] = {
+	RCAR_GP_PIN(1, 0),
+};
+
+static const unsigned int vin5_clk_a_mux[] = {
+	VI5_CLK_A_MARK,
+};
+
+static const unsigned int vin5_clk_b_pins[] = {
+	RCAR_GP_PIN(2, 22),
+};
+
+static const unsigned int vin5_clk_b_mux[] = {
+	VI5_CLK_B_MARK,
+};
+
 static const struct {
 	struct sh_pfc_pin_group common[123];
 	struct sh_pfc_pin_group automotive[0];
@@ -2561,6 +2745,32 @@ static const struct {
 		SH_PFC_PIN_GROUP(usb0_id),
 		SH_PFC_PIN_GROUP(usb30),
 		SH_PFC_PIN_GROUP(usb30_id),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 8),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 10),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 12),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 16),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 20),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 24),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 8),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 10),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 12),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 16),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 20),
+		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 24),
+		SH_PFC_PIN_GROUP(vin4_sync),
+		SH_PFC_PIN_GROUP(vin4_field),
+		SH_PFC_PIN_GROUP(vin4_clkenb),
+		SH_PFC_PIN_GROUP(vin4_clk),
+		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 8),
+		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 10),
+		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 12),
+		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 16),
+		SH_PFC_PIN_GROUP(vin5_data8_b),
+		SH_PFC_PIN_GROUP(vin5_sync_a),
+		SH_PFC_PIN_GROUP(vin5_field_a),
+		SH_PFC_PIN_GROUP(vin5_clkenb_a),
+		SH_PFC_PIN_GROUP(vin5_clk_a),
+		SH_PFC_PIN_GROUP(vin5_clk_b),
 	}
 };
 
@@ -2774,6 +2984,38 @@ static const char * const usb30_groups[] = {
 	"usb30_id",
 };
 
+static const char * const vin4_groups[] = {
+	"vin4_data8_a",
+	"vin4_data10_a",
+	"vin4_data12_a",
+	"vin4_data16_a",
+	"vin4_data20_a",
+	"vin4_data24_a",
+	"vin4_data8_b",
+	"vin4_data10_b",
+	"vin4_data12_b",
+	"vin4_data16_b",
+	"vin4_data20_b",
+	"vin4_data24_b",
+	"vin4_sync",
+	"vin4_field",
+	"vin4_clkenb",
+	"vin4_clk",
+};
+
+static const char * const vin5_groups[] = {
+	"vin5_data8_a",
+	"vin5_data10_a",
+	"vin5_data12_a",
+	"vin5_data16_a",
+	"vin5_data8_b",
+	"vin5_sync_a",
+	"vin5_field_a",
+	"vin5_clkenb_a",
+	"vin5_clk_a",
+	"vin5_clk_b",
+};
+
 static const struct {
 	struct sh_pfc_function common[29];
 	struct sh_pfc_function automotive[0];
@@ -2808,6 +3050,8 @@ static const struct {
 		SH_PFC_FUNCTION(scif_clk),
 		SH_PFC_FUNCTION(usb0),
 		SH_PFC_FUNCTION(usb30),
+		SH_PFC_FUNCTION(vin4),
+		SH_PFC_FUNCTION(vin5),
 	}
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: Add VIN[4|5] groups/functions
  2018-11-06 10:35 ` [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: " Jacopo Mondi
@ 2018-11-07 10:34   ` Simon Horman
  2018-11-07 10:56     ` jacopo mondi
  0 siblings, 1 reply; 19+ messages in thread
From: Simon Horman @ 2018-11-07 10:34 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

On Tue, Nov 06, 2018 at 11:35:33AM +0100, Jacopo Mondi wrote:
> Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car E3.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> 
> ---
> v3 -> v4:
> - Use new variadic version of VIN_DATA_PIN_GROUP macro

I may be missing something but this patch seems to be the same as v3,
using the VIN_DATA_PIN_GROUP_VER macro.

> 
> v2 -> v3:
> - Rebased on v4.20-rc1
> - Use the newly introduced VIN_DATA_PIN_GROUP_VER macro
> 
> Incorporate Geert's comments:
> - vin5_data8_b is only used with 8 pins: use regular SH_PFC_PIN_GROUP()
> - remove stf groups for vin4/vin5
> - confirmed that pins [23-8] of vin4's groups 'a' and 'b' are shared
> - confirmed with HW team the synchronism pins in vin5 are only for group 'a'
> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 244 ++++++++++++++++++++++++++++++++++
>  1 file changed, 244 insertions(+)
> 
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> index 1fdafa4..16fd139 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> @@ -2433,6 +2433,190 @@ static const unsigned int usb30_id_mux[] = {
>  	USB3HS0_ID_MARK,
>  };
>  
> +/* - VIN4 ------------------------------------------------------------------- */
> +static const union vin_data vin4_data_a_pins = {
> +	.data24 = {
> +		RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
> +		RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
> +		RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
> +		RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
> +		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
> +		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
> +		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
> +		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
> +		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
> +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
> +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
> +	},
> +};
> +
> +static const union vin_data vin4_data_a_mux = {
> +	.data24 = {
> +		VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
> +		VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
> +		VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
> +		VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
> +		VI4_DATA8_MARK,   VI4_DATA9_MARK,
> +		VI4_DATA10_MARK,  VI4_DATA11_MARK,
> +		VI4_DATA12_MARK,  VI4_DATA13_MARK,
> +		VI4_DATA14_MARK,  VI4_DATA15_MARK,
> +		VI4_DATA16_MARK,  VI4_DATA17_MARK,
> +		VI4_DATA18_MARK,  VI4_DATA19_MARK,
> +		VI4_DATA20_MARK,  VI4_DATA21_MARK,
> +		VI4_DATA22_MARK,  VI4_DATA23_MARK,
> +	},
> +};
> +
> +static const union vin_data vin4_data_b_pins = {
> +	.data24 = {
> +		RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
> +		RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
> +		RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
> +		RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
> +		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
> +		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
> +		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
> +		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
> +		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
> +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 15),
> +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
> +	},
> +};
> +
> +static const union vin_data vin4_data_b_mux = {
> +	.data24 = {
> +		VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
> +		VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
> +		VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
> +		VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
> +		VI4_DATA8_MARK,   VI4_DATA9_MARK,
> +		VI4_DATA10_MARK,  VI4_DATA11_MARK,
> +		VI4_DATA12_MARK,  VI4_DATA13_MARK,
> +		VI4_DATA14_MARK,  VI4_DATA15_MARK,
> +		VI4_DATA16_MARK,  VI4_DATA17_MARK,
> +		VI4_DATA18_MARK,  VI4_DATA19_MARK,
> +		VI4_DATA20_MARK,  VI4_DATA21_MARK,
> +		VI4_DATA22_MARK,  VI4_DATA23_MARK,
> +	},
> +};
> +
> +static const unsigned int vin4_sync_pins[] = {
> +	/* HSYNC, VSYNC */
> +	RCAR_GP_PIN(2, 25), RCAR_GP_PIN(2, 24),
> +};
> +
> +static const unsigned int vin4_sync_mux[] = {
> +	VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK,
> +};
> +
> +static const unsigned int vin4_field_pins[] = {
> +	RCAR_GP_PIN(2, 23),
> +};
> +
> +static const unsigned int vin4_field_mux[] = {
> +	VI4_FIELD_MARK,
> +};
> +
> +static const unsigned int vin4_clkenb_pins[] = {
> +	RCAR_GP_PIN(1, 2),
> +};
> +
> +static const unsigned int vin4_clkenb_mux[] = {
> +	VI4_CLKENB_MARK,
> +};
> +
> +static const unsigned int vin4_clk_pins[] = {
> +	RCAR_GP_PIN(2, 22),
> +};
> +
> +static const unsigned int vin4_clk_mux[] = {
> +	VI4_CLK_MARK,
> +};
> +
> +/* - VIN5 ------------------------------------------------------------------- */
> +static const union vin_data vin5_data_a_pins = {
> +	.data16 = {
> +		RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
> +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
> +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
> +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> +		RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
> +		RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
> +		RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
> +		RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
> +	},
> +};
> +
> +static const union vin_data vin5_data_a_mux = {
> +	.data16 = {
> +		VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
> +		VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
> +		VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
> +		VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
> +		VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
> +		VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
> +		VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
> +		VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
> +	},
> +};
> +
> +static const unsigned int vin5_data8_b_pins[] = {
> +	RCAR_GP_PIN(2, 23), RCAR_GP_PIN(0, 4),
> +	RCAR_GP_PIN(0, 7),  RCAR_GP_PIN(0, 12),
> +	RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 14),
> +	RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
> +};
> +
> +static const unsigned int vin5_data8_b_mux[] = {
> +	VI5_DATA0_B_MARK,  VI5_DATA1_B_MARK,
> +	VI5_DATA2_B_MARK,  VI5_DATA3_B_MARK,
> +	VI5_DATA4_B_MARK,  VI5_DATA5_B_MARK,
> +	VI5_DATA6_B_MARK,  VI5_DATA7_B_MARK,
> +};
> +
> +static const unsigned int vin5_sync_a_pins[] = {
> +	/* HSYNC_N, VSYNC_N */
> +	RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 9),
> +};
> +
> +static const unsigned int vin5_sync_a_mux[] = {
> +	VI5_HSYNC_N_A_MARK, VI5_VSYNC_N_A_MARK,
> +};
> +
> +static const unsigned int vin5_field_a_pins[] = {
> +	RCAR_GP_PIN(1, 10),
> +};
> +
> +static const unsigned int vin5_field_a_mux[] = {
> +	VI5_FIELD_A_MARK,
> +};
> +
> +static const unsigned int vin5_clkenb_a_pins[] = {
> +	RCAR_GP_PIN(0, 1),
> +};
> +
> +static const unsigned int vin5_clkenb_a_mux[] = {
> +	VI5_CLKENB_A_MARK,
> +};
> +
> +static const unsigned int vin5_clk_a_pins[] = {
> +	RCAR_GP_PIN(1, 0),
> +};
> +
> +static const unsigned int vin5_clk_a_mux[] = {
> +	VI5_CLK_A_MARK,
> +};
> +
> +static const unsigned int vin5_clk_b_pins[] = {
> +	RCAR_GP_PIN(2, 22),
> +};
> +
> +static const unsigned int vin5_clk_b_mux[] = {
> +	VI5_CLK_B_MARK,
> +};
> +
>  static const struct {
>  	struct sh_pfc_pin_group common[123];
>  	struct sh_pfc_pin_group automotive[0];
> @@ -2561,6 +2745,32 @@ static const struct {
>  		SH_PFC_PIN_GROUP(usb0_id),
>  		SH_PFC_PIN_GROUP(usb30),
>  		SH_PFC_PIN_GROUP(usb30_id),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 8),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 10),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 12),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 16),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 20),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 24),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 8),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 10),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 12),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 16),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 20),
> +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 24),
> +		SH_PFC_PIN_GROUP(vin4_sync),
> +		SH_PFC_PIN_GROUP(vin4_field),
> +		SH_PFC_PIN_GROUP(vin4_clkenb),
> +		SH_PFC_PIN_GROUP(vin4_clk),
> +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 8),
> +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 10),
> +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 12),
> +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 16),
> +		SH_PFC_PIN_GROUP(vin5_data8_b),
> +		SH_PFC_PIN_GROUP(vin5_sync_a),
> +		SH_PFC_PIN_GROUP(vin5_field_a),
> +		SH_PFC_PIN_GROUP(vin5_clkenb_a),
> +		SH_PFC_PIN_GROUP(vin5_clk_a),
> +		SH_PFC_PIN_GROUP(vin5_clk_b),
>  	}
>  };
>  
> @@ -2774,6 +2984,38 @@ static const char * const usb30_groups[] = {
>  	"usb30_id",
>  };
>  
> +static const char * const vin4_groups[] = {
> +	"vin4_data8_a",
> +	"vin4_data10_a",
> +	"vin4_data12_a",
> +	"vin4_data16_a",
> +	"vin4_data20_a",
> +	"vin4_data24_a",
> +	"vin4_data8_b",
> +	"vin4_data10_b",
> +	"vin4_data12_b",
> +	"vin4_data16_b",
> +	"vin4_data20_b",
> +	"vin4_data24_b",
> +	"vin4_sync",
> +	"vin4_field",
> +	"vin4_clkenb",
> +	"vin4_clk",
> +};
> +
> +static const char * const vin5_groups[] = {
> +	"vin5_data8_a",
> +	"vin5_data10_a",
> +	"vin5_data12_a",
> +	"vin5_data16_a",
> +	"vin5_data8_b",
> +	"vin5_sync_a",
> +	"vin5_field_a",
> +	"vin5_clkenb_a",
> +	"vin5_clk_a",
> +	"vin5_clk_b",
> +};
> +
>  static const struct {
>  	struct sh_pfc_function common[29];
>  	struct sh_pfc_function automotive[0];
> @@ -2808,6 +3050,8 @@ static const struct {
>  		SH_PFC_FUNCTION(scif_clk),
>  		SH_PFC_FUNCTION(usb0),
>  		SH_PFC_FUNCTION(usb30),
> +		SH_PFC_FUNCTION(vin4),
> +		SH_PFC_FUNCTION(vin5),
>  	}
>  };
>  
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP
  2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
@ 2018-11-07 10:40   ` Simon Horman
  2018-11-08 10:58   ` Geert Uytterhoeven
  1 sibling, 0 replies; 19+ messages in thread
From: Simon Horman @ 2018-11-07 10:40 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

On Tue, Nov 06, 2018 at 11:35:30AM +0100, Jacopo Mondi wrote:
> VIN data groups may appear on different sets of pins, usually named
> "vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support
> appending the '_a' or '_b' suffix, leading to the definition of groups
> names not consistent with the ones defined using SH_PFC_PIN_GROUP() macro.
> 
> Fix this by adding making the VIN_DATA_PIN_GROUP macro a variadic one,
> which accepts an optional 'version' argument.

FWIW I prefered the VIN_DATA_PIN_GROUP_VER() approach as it pinned down
what the parameters to the macro should be, albeit with parameter naming
conundrum.  While we could have any number f varargs present.

But I don't think we need to debate the colour of the bike shed at this
point.

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
>  drivers/pinctrl/sh-pfc/sh_pfc.h | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
> index 458ae0a..0e0b4cc 100644
> --- a/drivers/pinctrl/sh-pfc/sh_pfc.h
> +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
> @@ -54,15 +54,16 @@ struct sh_pfc_pin_group {
>  
>  /*
>   * Using union vin_data saves memory occupied by the VIN data pins.
> - * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
> - * in this case.
> + * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups
> + * in this case. It accepts an optional 'version' argument used when the
> + * same group can appear on a different set of pins.
>   */
> -#define VIN_DATA_PIN_GROUP(n, s)				\
> -	{							\
> -		.name = #n#s,					\
> -		.pins = n##_pins.data##s,			\
> -		.mux = n##_mux.data##s,				\
> -		.nr_pins = ARRAY_SIZE(n##_pins.data##s),	\
> +#define VIN_DATA_PIN_GROUP(n, s, ...)					\
> +	{								\
> +		.name = #n#s#__VA_ARGS__,				\
> +		.pins = n##__VA_ARGS__##_pins.data##s,			\
> +		.mux = n##__VA_ARGS__##_mux.data##s,			\
> +		.nr_pins = ARRAY_SIZE(n##__VA_ARGS__##_pins.data##s),	\
>  	}
>  
>  union vin_data {
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-06 10:35 ` [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name Jacopo Mondi
@ 2018-11-07 10:41   ` Simon Horman
  2018-11-07 10:59     ` jacopo mondi
  2018-11-08 10:59   ` Geert Uytterhoeven
  1 sibling, 1 reply; 19+ messages in thread
From: Simon Horman @ 2018-11-07 10:41 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

On Tue, Nov 06, 2018 at 11:35:31AM +0100, Jacopo Mondi wrote:
> Versioned VIN groups can appear on different sets of pins. Using the
> VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
> an optional 'version' argument.
> 
> Use the 'version' argument for said macro to fix naming of versioned
> groups for R-Car SoCs that defines them.
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions
  2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
@ 2018-11-07 10:56   ` Simon Horman
  2018-11-08 12:22   ` Geert Uytterhoeven
  2018-11-08 12:31   ` Geert Uytterhoeven
  2 siblings, 0 replies; 19+ messages in thread
From: Simon Horman @ 2018-11-07 10:56 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

On Tue, Nov 06, 2018 at 11:35:32AM +0100, Jacopo Mondi wrote:
> The VIN4 and VIN5 interfaces supports parallel video input.
> Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car M3-N.
> 
> Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: Add VIN[4|5] groups/functions
  2018-11-07 10:34   ` Simon Horman
@ 2018-11-07 10:56     ` jacopo mondi
  2018-11-08 12:37       ` Geert Uytterhoeven
  0 siblings, 1 reply; 19+ messages in thread
From: jacopo mondi @ 2018-11-07 10:56 UTC (permalink / raw)
  To: Simon Horman
  Cc: Jacopo Mondi, geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 9932 bytes --]

Hi Simon,

On Wed, Nov 07, 2018 at 11:34:50AM +0100, Simon Horman wrote:
> On Tue, Nov 06, 2018 at 11:35:33AM +0100, Jacopo Mondi wrote:
> > Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car E3.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> >
> > ---
> > v3 -> v4:
> > - Use new variadic version of VIN_DATA_PIN_GROUP macro
>
> I may be missing something but this patch seems to be the same as v3,
> using the VIN_DATA_PIN_GROUP_VER macro.
>
Oooops, I forgot to add the changes and lost them while rebasing.

Sorry about this, I'll resend.
Thanks
  j

> >
> > v2 -> v3:
> > - Rebased on v4.20-rc1
> > - Use the newly introduced VIN_DATA_PIN_GROUP_VER macro
> >
> > Incorporate Geert's comments:
> > - vin5_data8_b is only used with 8 pins: use regular SH_PFC_PIN_GROUP()
> > - remove stf groups for vin4/vin5
> > - confirmed that pins [23-8] of vin4's groups 'a' and 'b' are shared
> > - confirmed with HW team the synchronism pins in vin5 are only for group 'a'
> > ---
> >  drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 244 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 244 insertions(+)
> >
> > diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> > index 1fdafa4..16fd139 100644
> > --- a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> > +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> > @@ -2433,6 +2433,190 @@ static const unsigned int usb30_id_mux[] = {
> >  	USB3HS0_ID_MARK,
> >  };
> >
> > +/* - VIN4 ------------------------------------------------------------------- */
> > +static const union vin_data vin4_data_a_pins = {
> > +	.data24 = {
> > +		RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
> > +		RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
> > +		RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
> > +		RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
> > +		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
> > +		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
> > +		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
> > +		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
> > +		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
> > +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
> > +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> > +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
> > +	},
> > +};
> > +
> > +static const union vin_data vin4_data_a_mux = {
> > +	.data24 = {
> > +		VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
> > +		VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
> > +		VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
> > +		VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
> > +		VI4_DATA8_MARK,   VI4_DATA9_MARK,
> > +		VI4_DATA10_MARK,  VI4_DATA11_MARK,
> > +		VI4_DATA12_MARK,  VI4_DATA13_MARK,
> > +		VI4_DATA14_MARK,  VI4_DATA15_MARK,
> > +		VI4_DATA16_MARK,  VI4_DATA17_MARK,
> > +		VI4_DATA18_MARK,  VI4_DATA19_MARK,
> > +		VI4_DATA20_MARK,  VI4_DATA21_MARK,
> > +		VI4_DATA22_MARK,  VI4_DATA23_MARK,
> > +	},
> > +};
> > +
> > +static const union vin_data vin4_data_b_pins = {
> > +	.data24 = {
> > +		RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
> > +		RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
> > +		RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
> > +		RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
> > +		RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
> > +		RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
> > +		RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
> > +		RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
> > +		RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
> > +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 15),
> > +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> > +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
> > +	},
> > +};
> > +
> > +static const union vin_data vin4_data_b_mux = {
> > +	.data24 = {
> > +		VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
> > +		VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
> > +		VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
> > +		VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
> > +		VI4_DATA8_MARK,   VI4_DATA9_MARK,
> > +		VI4_DATA10_MARK,  VI4_DATA11_MARK,
> > +		VI4_DATA12_MARK,  VI4_DATA13_MARK,
> > +		VI4_DATA14_MARK,  VI4_DATA15_MARK,
> > +		VI4_DATA16_MARK,  VI4_DATA17_MARK,
> > +		VI4_DATA18_MARK,  VI4_DATA19_MARK,
> > +		VI4_DATA20_MARK,  VI4_DATA21_MARK,
> > +		VI4_DATA22_MARK,  VI4_DATA23_MARK,
> > +	},
> > +};
> > +
> > +static const unsigned int vin4_sync_pins[] = {
> > +	/* HSYNC, VSYNC */
> > +	RCAR_GP_PIN(2, 25), RCAR_GP_PIN(2, 24),
> > +};
> > +
> > +static const unsigned int vin4_sync_mux[] = {
> > +	VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK,
> > +};
> > +
> > +static const unsigned int vin4_field_pins[] = {
> > +	RCAR_GP_PIN(2, 23),
> > +};
> > +
> > +static const unsigned int vin4_field_mux[] = {
> > +	VI4_FIELD_MARK,
> > +};
> > +
> > +static const unsigned int vin4_clkenb_pins[] = {
> > +	RCAR_GP_PIN(1, 2),
> > +};
> > +
> > +static const unsigned int vin4_clkenb_mux[] = {
> > +	VI4_CLKENB_MARK,
> > +};
> > +
> > +static const unsigned int vin4_clk_pins[] = {
> > +	RCAR_GP_PIN(2, 22),
> > +};
> > +
> > +static const unsigned int vin4_clk_mux[] = {
> > +	VI4_CLK_MARK,
> > +};
> > +
> > +/* - VIN5 ------------------------------------------------------------------- */
> > +static const union vin_data vin5_data_a_pins = {
> > +	.data16 = {
> > +		RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
> > +		RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
> > +		RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
> > +		RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> > +		RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
> > +		RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
> > +		RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
> > +		RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
> > +	},
> > +};
> > +
> > +static const union vin_data vin5_data_a_mux = {
> > +	.data16 = {
> > +		VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
> > +		VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
> > +		VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
> > +		VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
> > +		VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
> > +		VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
> > +		VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
> > +		VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
> > +	},
> > +};
> > +
> > +static const unsigned int vin5_data8_b_pins[] = {
> > +	RCAR_GP_PIN(2, 23), RCAR_GP_PIN(0, 4),
> > +	RCAR_GP_PIN(0, 7),  RCAR_GP_PIN(0, 12),
> > +	RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 14),
> > +	RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
> > +};
> > +
> > +static const unsigned int vin5_data8_b_mux[] = {
> > +	VI5_DATA0_B_MARK,  VI5_DATA1_B_MARK,
> > +	VI5_DATA2_B_MARK,  VI5_DATA3_B_MARK,
> > +	VI5_DATA4_B_MARK,  VI5_DATA5_B_MARK,
> > +	VI5_DATA6_B_MARK,  VI5_DATA7_B_MARK,
> > +};
> > +
> > +static const unsigned int vin5_sync_a_pins[] = {
> > +	/* HSYNC_N, VSYNC_N */
> > +	RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 9),
> > +};
> > +
> > +static const unsigned int vin5_sync_a_mux[] = {
> > +	VI5_HSYNC_N_A_MARK, VI5_VSYNC_N_A_MARK,
> > +};
> > +
> > +static const unsigned int vin5_field_a_pins[] = {
> > +	RCAR_GP_PIN(1, 10),
> > +};
> > +
> > +static const unsigned int vin5_field_a_mux[] = {
> > +	VI5_FIELD_A_MARK,
> > +};
> > +
> > +static const unsigned int vin5_clkenb_a_pins[] = {
> > +	RCAR_GP_PIN(0, 1),
> > +};
> > +
> > +static const unsigned int vin5_clkenb_a_mux[] = {
> > +	VI5_CLKENB_A_MARK,
> > +};
> > +
> > +static const unsigned int vin5_clk_a_pins[] = {
> > +	RCAR_GP_PIN(1, 0),
> > +};
> > +
> > +static const unsigned int vin5_clk_a_mux[] = {
> > +	VI5_CLK_A_MARK,
> > +};
> > +
> > +static const unsigned int vin5_clk_b_pins[] = {
> > +	RCAR_GP_PIN(2, 22),
> > +};
> > +
> > +static const unsigned int vin5_clk_b_mux[] = {
> > +	VI5_CLK_B_MARK,
> > +};
> > +
> >  static const struct {
> >  	struct sh_pfc_pin_group common[123];
> >  	struct sh_pfc_pin_group automotive[0];
> > @@ -2561,6 +2745,32 @@ static const struct {
> >  		SH_PFC_PIN_GROUP(usb0_id),
> >  		SH_PFC_PIN_GROUP(usb30),
> >  		SH_PFC_PIN_GROUP(usb30_id),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 8),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 10),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 12),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 16),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 20),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, a, 24),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 8),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 10),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 12),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 16),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 20),
> > +		VIN_DATA_PIN_GROUP_VER(vin4_data, b, 24),
> > +		SH_PFC_PIN_GROUP(vin4_sync),
> > +		SH_PFC_PIN_GROUP(vin4_field),
> > +		SH_PFC_PIN_GROUP(vin4_clkenb),
> > +		SH_PFC_PIN_GROUP(vin4_clk),
> > +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 8),
> > +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 10),
> > +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 12),
> > +		VIN_DATA_PIN_GROUP_VER(vin5_data, a, 16),
> > +		SH_PFC_PIN_GROUP(vin5_data8_b),
> > +		SH_PFC_PIN_GROUP(vin5_sync_a),
> > +		SH_PFC_PIN_GROUP(vin5_field_a),
> > +		SH_PFC_PIN_GROUP(vin5_clkenb_a),
> > +		SH_PFC_PIN_GROUP(vin5_clk_a),
> > +		SH_PFC_PIN_GROUP(vin5_clk_b),
> >  	}
> >  };
> >
> > @@ -2774,6 +2984,38 @@ static const char * const usb30_groups[] = {
> >  	"usb30_id",
> >  };
> >
> > +static const char * const vin4_groups[] = {
> > +	"vin4_data8_a",
> > +	"vin4_data10_a",
> > +	"vin4_data12_a",
> > +	"vin4_data16_a",
> > +	"vin4_data20_a",
> > +	"vin4_data24_a",
> > +	"vin4_data8_b",
> > +	"vin4_data10_b",
> > +	"vin4_data12_b",
> > +	"vin4_data16_b",
> > +	"vin4_data20_b",
> > +	"vin4_data24_b",
> > +	"vin4_sync",
> > +	"vin4_field",
> > +	"vin4_clkenb",
> > +	"vin4_clk",
> > +};
> > +
> > +static const char * const vin5_groups[] = {
> > +	"vin5_data8_a",
> > +	"vin5_data10_a",
> > +	"vin5_data12_a",
> > +	"vin5_data16_a",
> > +	"vin5_data8_b",
> > +	"vin5_sync_a",
> > +	"vin5_field_a",
> > +	"vin5_clkenb_a",
> > +	"vin5_clk_a",
> > +	"vin5_clk_b",
> > +};
> > +
> >  static const struct {
> >  	struct sh_pfc_function common[29];
> >  	struct sh_pfc_function automotive[0];
> > @@ -2808,6 +3050,8 @@ static const struct {
> >  		SH_PFC_FUNCTION(scif_clk),
> >  		SH_PFC_FUNCTION(usb0),
> >  		SH_PFC_FUNCTION(usb30),
> > +		SH_PFC_FUNCTION(vin4),
> > +		SH_PFC_FUNCTION(vin5),
> >  	}
> >  };
> >
> > --
> > 2.7.4
> >

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-07 10:41   ` Simon Horman
@ 2018-11-07 10:59     ` jacopo mondi
  2018-11-07 11:27       ` Simon Horman
  0 siblings, 1 reply; 19+ messages in thread
From: jacopo mondi @ 2018-11-07 10:59 UTC (permalink / raw)
  To: Simon Horman
  Cc: Jacopo Mondi, geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

Hi Simon,

On Wed, Nov 07, 2018 at 11:41:34AM +0100, Simon Horman wrote:
> On Tue, Nov 06, 2018 at 11:35:31AM +0100, Jacopo Mondi wrote:
> > Versioned VIN groups can appear on different sets of pins. Using the
> > VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
> > an optional 'version' argument.
> >
> > Use the 'version' argument for said macro to fix naming of versioned
> > groups for R-Car SoCs that defines them.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>

I'm going to split this patch for each SoC to ease backporting, as
Geert suggested. Provided the single patches content is the same as
here, can I retain your R-b tag?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-07 10:59     ` jacopo mondi
@ 2018-11-07 11:27       ` Simon Horman
  0 siblings, 0 replies; 19+ messages in thread
From: Simon Horman @ 2018-11-07 11:27 UTC (permalink / raw)
  To: jacopo mondi
  Cc: Jacopo Mondi, geert+renesas, laurent.pinchart, linus.walleij,
	linux-renesas-soc, linux-gpio

On Wed, Nov 07, 2018 at 11:59:49AM +0100, jacopo mondi wrote:
> Hi Simon,
> 
> On Wed, Nov 07, 2018 at 11:41:34AM +0100, Simon Horman wrote:
> > On Tue, Nov 06, 2018 at 11:35:31AM +0100, Jacopo Mondi wrote:
> > > Versioned VIN groups can appear on different sets of pins. Using the
> > > VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
> > > an optional 'version' argument.
> > >
> > > Use the 'version' argument for said macro to fix naming of versioned
> > > groups for R-Car SoCs that defines them.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> >
> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> >
> 
> I'm going to split this patch for each SoC to ease backporting, as
> Geert suggested. Provided the single patches content is the same as
> here, can I retain your R-b tag?

Yes, sure.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP
  2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
  2018-11-07 10:40   ` Simon Horman
@ 2018-11-08 10:58   ` Geert Uytterhoeven
  2018-11-08 11:38     ` Geert Uytterhoeven
  1 sibling, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 10:58 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Jacopo,

Thanks for your patch!

On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> VIN data groups may appear on different sets of pins, usually named
> "vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support
> appending the '_a' or '_b' suffix, leading to the definition of groups

group

> names not consistent with the ones defined using SH_PFC_PIN_GROUP() macro.

the SH_PFC_PIN_GROUP() macro.

>
> Fix this by adding making the VIN_DATA_PIN_GROUP macro a variadic one,

Please drop "adding".
VIN_DATA_PIN_GROUP()

> which accepts an optional 'version' argument.
>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

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

> --- a/drivers/pinctrl/sh-pfc/sh_pfc.h
> +++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
> @@ -54,15 +54,16 @@ struct sh_pfc_pin_group {
>
>  /*
>   * Using union vin_data saves memory occupied by the VIN data pins.
> - * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
> - * in this case.
> + * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups
> + * in this case. It accepts an optional 'version' argument used when the
> + * same group can appear on a different set of pins.

Please rebase against sh-pfc-for-v4.21.

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-06 10:35 ` [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name Jacopo Mondi
  2018-11-07 10:41   ` Simon Horman
@ 2018-11-08 10:59   ` Geert Uytterhoeven
  2018-11-08 11:06     ` jacopo mondi
  1 sibling, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 10:59 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> Versioned VIN groups can appear on different sets of pins. Using the
> VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
> an optional 'version' argument.
>
> Use the 'version' argument for said macro to fix naming of versioned
> groups for R-Car SoCs that defines them.
>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Fixes: 7dd74bb1f058786e ("pinctrl: sh-pfc: r8a7792: Add VIN pin groups")
Fixes: a5c2949ff7bd9e04 ("pinctrl: sh-pfc: r8a7796: Deduplicate VIN4 pin
Fixes: 9942a5b52990b8d5 ("pinctrl: sh-pfc: r8a7795: Deduplicate VIN4 pin
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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name
  2018-11-08 10:59   ` Geert Uytterhoeven
@ 2018-11-08 11:06     ` jacopo mondi
  0 siblings, 0 replies; 19+ messages in thread
From: jacopo mondi @ 2018-11-08 11:06 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jacopo Mondi, Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

Hi Geert
On Thu, Nov 08, 2018 at 11:59:08AM +0100, Geert Uytterhoeven wrote:
> On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> > Versioned VIN groups can appear on different sets of pins. Using the
> > VIN_DATA_PIN_GROUP macro now supports proper naming of said groups through
> > an optional 'version' argument.
> >
> > Use the 'version' argument for said macro to fix naming of versioned
> > groups for R-Car SoCs that defines them.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>
> Fixes: 7dd74bb1f058786e ("pinctrl: sh-pfc: r8a7792: Add VIN pin groups")
> Fixes: a5c2949ff7bd9e04 ("pinctrl: sh-pfc: r8a7796: Deduplicate VIN4 pin
> Fixes: 9942a5b52990b8d5 ("pinctrl: sh-pfc: r8a7795: Deduplicate VIN4 pin
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

I added the Fixes tag to the single patches I've broke out and will
send in v5.

Thanks
   j


>
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP
  2018-11-08 10:58   ` Geert Uytterhoeven
@ 2018-11-08 11:38     ` Geert Uytterhoeven
  0 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 11:38 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Jacopo,

On Thu, Nov 8, 2018 at 11:58 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> > VIN data groups may appear on different sets of pins, usually named
> > "vinX_data_[a|b]". The existing VIN_DATA_PIN_GROUP() does not support
> > appending the '_a' or '_b' suffix, leading to the definition of groups
>
> group
>
> > names not consistent with the ones defined using SH_PFC_PIN_GROUP() macro.
>
> the SH_PFC_PIN_GROUP() macro.
>
> >
> > Fix this by adding making the VIN_DATA_PIN_GROUP macro a variadic one,
>
> Please drop "adding".
> VIN_DATA_PIN_GROUP()
>
> > which accepts an optional 'version' argument.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Perhaps it makes sense to add

    Fixes: 423caa52534ff15a ("pinctrl: sh-pfc: r8a779[01]: Move 'union
vin_data' to shared header file")

to make sure it gets backported with the SoC-specific fixes that depend on it?

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions
  2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
  2018-11-07 10:56   ` Simon Horman
@ 2018-11-08 12:22   ` Geert Uytterhoeven
  2018-11-08 12:31   ` Geert Uytterhoeven
  2 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 12:22 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Jacopo,

On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> The VIN4 and VIN5 interfaces supports parallel video input.
> Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car M3-N.
>
> Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Thanks for your patch!

> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c

> @@ -4000,6 +4210,24 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
>         SH_PFC_PIN_GROUP(usb0),
>         SH_PFC_PIN_GROUP(usb1),
>         SH_PFC_PIN_GROUP(usb30),
> +       VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
> +       VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
> +       SH_PFC_PIN_GROUP(vin4_data18_a),
> +       VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
> +       VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
> +       VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
> +       SH_PFC_PIN_GROUP(vin4_data18_b),
> +       VIN_DATA_PIN_GROUP(vin4_data, 24, _b),

Missing support for 10/12/20?

> +       SH_PFC_PIN_GROUP(vin4_sync),
> +       SH_PFC_PIN_GROUP(vin4_field),
> +       SH_PFC_PIN_GROUP(vin4_clkenb),
> +       SH_PFC_PIN_GROUP(vin4_clk),
> +       VIN_DATA_PIN_GROUP(vin5_data, 8),
> +       VIN_DATA_PIN_GROUP(vin5_data, 16),

Missing support for 10/12?

> +       SH_PFC_PIN_GROUP(vin5_sync),
> +       SH_PFC_PIN_GROUP(vin5_field),
> +       SH_PFC_PIN_GROUP(vin5_clkenb),
> +       SH_PFC_PIN_GROUP(vin5_clk),
>  };
>
>  static const char * const audio_clk_groups[] = {
> @@ -4392,6 +4620,30 @@ static const char * const usb30_groups[] = {
>         "usb30",
>  };
>
> +static const char * const vin4_groups[] = {
> +       "vin4_data8_a",
> +       "vin4_data16_a",
> +       "vin4_data18_a",
> +       "vin4_data24_a",
> +       "vin4_data8_b",
> +       "vin4_data16_b",
> +       "vin4_data18_b",
> +       "vin4_data24_b",

Missing support for 10/12/20?

> +       "vin4_sync",
> +       "vin4_field",
> +       "vin4_clkenb",
> +       "vin4_clk",
> +};
> +
> +static const char * const vin5_groups[] = {
> +       "vin5_data8",
> +       "vin5_data16",

Missing support for 10/12?

> +       "vin5_sync",
> +       "vin5_field",
> +       "vin5_clkenb",
> +       "vin5_clk",
> +};

With the above fixed:

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions
  2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
  2018-11-07 10:56   ` Simon Horman
  2018-11-08 12:22   ` Geert Uytterhoeven
@ 2018-11-08 12:31   ` Geert Uytterhoeven
  2 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 12:31 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Geert Uytterhoeven, Simon Horman, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

On Tue, Nov 6, 2018 at 11:35 AM Jacopo Mondi <jacopo+renesas@jmondi.org> wrote:
> The VIN4 and VIN5 interfaces supports parallel video input.
> Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car M3-N.
>
> Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

> --- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c

Oops, found two more...

> +/* - VIN5 ------------------------------------------------------------------- */
> +static const union vin_data vin5_data_pins = {

union vin_data16

> +       .data16 = {
> +               RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
> +               RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
> +               RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
> +               RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
> +               RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
> +               RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
> +               RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
> +               RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
> +       },
> +};
> +
> +static const union vin_data vin5_data_mux = {

union vin_data16

> +       .data16 = {
> +               VI5_DATA0_MARK, VI5_DATA1_MARK,
> +               VI5_DATA2_MARK, VI5_DATA3_MARK,
> +               VI5_DATA4_MARK, VI5_DATA5_MARK,
> +               VI5_DATA6_MARK, VI5_DATA7_MARK,
> +               VI5_DATA8_MARK,  VI5_DATA9_MARK,
> +               VI5_DATA10_MARK, VI5_DATA11_MARK,
> +               VI5_DATA12_MARK, VI5_DATA13_MARK,
> +               VI5_DATA14_MARK, VI5_DATA15_MARK,
> +       },
> +};

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: Add VIN[4|5] groups/functions
  2018-11-07 10:56     ` jacopo mondi
@ 2018-11-08 12:37       ` Geert Uytterhoeven
  0 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2018-11-08 12:37 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Simon Horman, Jacopo Mondi, Geert Uytterhoeven, Laurent Pinchart,
	Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM

Hi Jacopo,

On Wed, Nov 7, 2018 at 11:56 AM jacopo mondi <jacopo@jmondi.org> wrote:
> On Wed, Nov 07, 2018 at 11:34:50AM +0100, Simon Horman wrote:
> > On Tue, Nov 06, 2018 at 11:35:33AM +0100, Jacopo Mondi wrote:
> > > Add pin, mux and functions definitions for VIN4 and VIN5 for R-Car E3.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > >
> > > ---
> > > v3 -> v4:
> > > - Use new variadic version of VIN_DATA_PIN_GROUP macro
> >
> > I may be missing something but this patch seems to be the same as v3,
> > using the VIN_DATA_PIN_GROUP_VER macro.
> >
> Oooops, I forgot to add the changes and lost them while rebasing.
>
> Sorry about this, I'll resend.

Two quick comments below...

> > > v2 -> v3:
> > > - Rebased on v4.20-rc1
> > > - Use the newly introduced VIN_DATA_PIN_GROUP_VER macro
> > >
> > > Incorporate Geert's comments:
> > > - vin5_data8_b is only used with 8 pins: use regular SH_PFC_PIN_GROUP()
> > > - remove stf groups for vin4/vin5
> > > - confirmed that pins [23-8] of vin4's groups 'a' and 'b' are shared
> > > - confirmed with HW team the synchronism pins in vin5 are only for group 'a'

> > > --- a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
> > > +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c

> > > +/* - VIN5 ------------------------------------------------------------------- */
> > > +static const union vin_data vin5_data_a_pins = {

union vin_data16

> > > +   .data16 = {
> > > +           RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
> > > +           RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
> > > +           RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
> > > +           RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
> > > +           RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
> > > +           RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
> > > +           RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
> > > +           RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
> > > +   },
> > > +};
> > > +
> > > +static const union vin_data vin5_data_a_mux = {

union vin_data16

> > > +   .data16 = {
> > > +           VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
> > > +           VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
> > > +           VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
> > > +           VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
> > > +           VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
> > > +           VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
> > > +           VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
> > > +           VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
> > > +   },
> > > +};

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-11-08 22:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 10:35 [PATCH v4 0/4] sh-pfc: Variadic VIN_DATA_PIN_GROUP macro + updates Jacopo Mondi
2018-11-06 10:35 ` [PATCH v4 1/4] pinctrl: sh-pfc: Add optional arg to VIN_DATA_PIN_GROUP Jacopo Mondi
2018-11-07 10:40   ` Simon Horman
2018-11-08 10:58   ` Geert Uytterhoeven
2018-11-08 11:38     ` Geert Uytterhoeven
2018-11-06 10:35 ` [PATCH v4 2/4] pinctrl: sh-pfc: Fix VIN versioned groups name Jacopo Mondi
2018-11-07 10:41   ` Simon Horman
2018-11-07 10:59     ` jacopo mondi
2018-11-07 11:27       ` Simon Horman
2018-11-08 10:59   ` Geert Uytterhoeven
2018-11-08 11:06     ` jacopo mondi
2018-11-06 10:35 ` [PATCH v4 3/4] pinctrl: sh-pfc: r8a77965: Add VIN[4|5] groups/functions Jacopo Mondi
2018-11-07 10:56   ` Simon Horman
2018-11-08 12:22   ` Geert Uytterhoeven
2018-11-08 12:31   ` Geert Uytterhoeven
2018-11-06 10:35 ` [PATCH v4 4/4] pinctrl: sh-pfc: r8a77990: " Jacopo Mondi
2018-11-07 10:34   ` Simon Horman
2018-11-07 10:56     ` jacopo mondi
2018-11-08 12:37       ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.