* [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
@ 2015-08-18 22:26 ` Sergei Shtylyov
2015-08-19 21:14 ` Laurent Pinchart
2015-08-26 11:41 ` Linus Walleij
2015-08-18 22:29 ` [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN " Sergei Shtylyov
` (9 subsequent siblings)
10 siblings, 2 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-18 22:26 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Add USB0/1 pin groups to R8A7794 PFC driver.
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
[Sergei: rebased, renamed, added changelog.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2770,6 +2770,24 @@ static const unsigned int sdhi2_wp_pins[
static const unsigned int sdhi2_wp_mux[] = {
SD2_WP_MARK,
};
+/* - USB0 ------------------------------------------------------------------- */
+static const unsigned int usb0_pins[] = {
+ RCAR_GP_PIN(5, 24), /* PWEN */
+ RCAR_GP_PIN(5, 25), /* OVC */
+};
+static const unsigned int usb0_mux[] = {
+ USB0_PWEN_MARK,
+ USB0_OVC_MARK,
+};
+/* - USB1 ------------------------------------------------------------------- */
+static const unsigned int usb1_pins[] = {
+ RCAR_GP_PIN(5, 26), /* PWEN */
+ RCAR_GP_PIN(5, 27), /* OVC */
+};
+static const unsigned int usb1_mux[] = {
+ USB1_PWEN_MARK,
+ USB1_OVC_MARK,
+};
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
@@ -2945,6 +2963,8 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_ctrl),
SH_PFC_PIN_GROUP(sdhi2_cd),
SH_PFC_PIN_GROUP(sdhi2_wp),
+ SH_PFC_PIN_GROUP(usb0),
+ SH_PFC_PIN_GROUP(usb1),
};
static const char * const eth_groups[] = {
@@ -3219,6 +3239,14 @@ static const char * const sdhi2_groups[]
"sdhi2_wp",
};
+static const char * const usb0_groups[] = {
+ "usb0",
+};
+
+static const char * const usb1_groups[] = {
+ "usb1",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3253,6 +3281,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi0),
SH_PFC_FUNCTION(sdhi1),
SH_PFC_FUNCTION(sdhi2),
+ SH_PFC_FUNCTION(usb0),
+ SH_PFC_FUNCTION(usb1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-18 22:26 ` [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups Sergei Shtylyov
@ 2015-08-19 21:14 ` Laurent Pinchart
2015-08-20 12:59 ` Sergei Shtylyov
2015-08-26 11:41 ` Linus Walleij
1 sibling, 1 reply; 32+ messages in thread
From: Laurent Pinchart @ 2015-08-19 21:14 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linus.walleij, linux-sh, linux-gpio
Hi Sergei,
Thank you for the patch.
On Wednesday 19 August 2015 01:26:55 Sergei Shtylyov wrote:
> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>
> Add USB0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> [Sergei: rebased, renamed, added changelog.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> ===================================================================
> --- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> +++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> @@ -2770,6 +2770,24 @@ static const unsigned int sdhi2_wp_pins[
> static const unsigned int sdhi2_wp_mux[] = {
> SD2_WP_MARK,
> };
> +/* - USB0
> ------------------------------------------------------------------- */
> +static const unsigned int usb0_pins[] = {
> + RCAR_GP_PIN(5, 24), /* PWEN */
> + RCAR_GP_PIN(5, 25), /* OVC */
> +};
> +static const unsigned int usb0_mux[] = {
> + USB0_PWEN_MARK,
> + USB0_OVC_MARK,
> +};
> +/* - USB1
> ------------------------------------------------------------------- */
> +static const unsigned int usb1_pins[] = {
> + RCAR_GP_PIN(5, 26), /* PWEN */
> + RCAR_GP_PIN(5, 27), /* OVC */
> +};
> +static const unsigned int usb1_mux[] = {
> + USB1_PWEN_MARK,
> + USB1_OVC_MARK,
> +};
>
> static const struct sh_pfc_pin_group pinmux_groups[] = {
> SH_PFC_PIN_GROUP(eth_link),
> @@ -2945,6 +2963,8 @@ static const struct sh_pfc_pin_group pin
> SH_PFC_PIN_GROUP(sdhi2_ctrl),
> SH_PFC_PIN_GROUP(sdhi2_cd),
> SH_PFC_PIN_GROUP(sdhi2_wp),
> + SH_PFC_PIN_GROUP(usb0),
> + SH_PFC_PIN_GROUP(usb1),
> };
>
> static const char * const eth_groups[] = {
> @@ -3219,6 +3239,14 @@ static const char * const sdhi2_groups[]
> "sdhi2_wp",
> };
>
> +static const char * const usb0_groups[] = {
> + "usb0",
> +};
> +
> +static const char * const usb1_groups[] = {
> + "usb1",
> +};
> +
> static const struct sh_pfc_function pinmux_functions[] = {
> SH_PFC_FUNCTION(eth),
> SH_PFC_FUNCTION(hscif0),
> @@ -3253,6 +3281,8 @@ static const struct sh_pfc_function pinm
> SH_PFC_FUNCTION(sdhi0),
> SH_PFC_FUNCTION(sdhi1),
> SH_PFC_FUNCTION(sdhi2),
> + SH_PFC_FUNCTION(usb0),
> + SH_PFC_FUNCTION(usb1),
> };
>
> static const struct pinmux_cfg_reg pinmux_config_regs[] = {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-19 21:14 ` Laurent Pinchart
@ 2015-08-20 12:59 ` Sergei Shtylyov
2015-08-20 19:44 ` Laurent Pinchart
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-20 12:59 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linus.walleij, linux-sh, linux-gpio
Hello.
On 8/20/2015 12:14 AM, Laurent Pinchart wrote:
> Thank you for the patch.
My pleasure. :-)
> On Wednesday 19 August 2015 01:26:55 Sergei Shtylyov wrote:
>> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>>
>> Add USB0/1 pin groups to R8A7794 PFC driver.
>>
>> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>> [Sergei: rebased, renamed, added changelog.]
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thank you!
How about the VIN patch? :-)
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-20 12:59 ` Sergei Shtylyov
@ 2015-08-20 19:44 ` Laurent Pinchart
2015-08-20 19:48 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Laurent Pinchart @ 2015-08-20 19:44 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linus.walleij, linux-sh, linux-gpio, Geert Uytterhoeven
Hi Sergei,
On Thursday 20 August 2015 15:59:46 Sergei Shtylyov wrote:
> On 8/20/2015 12:14 AM, Laurent Pinchart wrote:
> > Thank you for the patch.
>
> My pleasure. :-)
>
> > On Wednesday 19 August 2015 01:26:55 Sergei Shtylyov wrote:
> >> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> >>
> >> Add USB0/1 pin groups to R8A7794 PFC driver.
> >>
> >> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> >> [Sergei: rebased, renamed, added changelog.]
> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Thank you!
> How about the VIN patch? :-)
I was hoping someone else would review that one :-) Geert, would you have a
bit of bandwidth to spare ?
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-20 19:44 ` Laurent Pinchart
@ 2015-08-20 19:48 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-20 19:48 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linus.walleij, linux-sh, linux-gpio, Geert Uytterhoeven
On 08/20/2015 10:44 PM, Laurent Pinchart wrote:
>>> Thank you for the patch.
>>
>> My pleasure. :-)
>>
>>> On Wednesday 19 August 2015 01:26:55 Sergei Shtylyov wrote:
>>>> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>>>>
>>>> Add USB0/1 pin groups to R8A7794 PFC driver.
>>>>
>>>> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>>>> [Sergei: rebased, renamed, added changelog.]
>>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>>
>>> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>
>> Thank you!
>> How about the VIN patch? :-)
>
> I was hoping someone else would review that one :-) Geert, would you have a
> bit of bandwidth to spare ?
The MAINTAINERS file still has you as the Renesas PFC maintainer not Geert. ;-)
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups
2015-08-18 22:26 ` [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups Sergei Shtylyov
2015-08-19 21:14 ` Laurent Pinchart
@ 2015-08-26 11:41 ` Linus Walleij
1 sibling, 0 replies; 32+ messages in thread
From: Linus Walleij @ 2015-08-26 11:41 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux-sh@vger.kernel.org, Laurent Pinchart,
linux-gpio@vger.kernel.org
On Wed, Aug 19, 2015 at 12:26 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>
> Add USB0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> [Sergei: rebased, renamed, added changelog.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Patch applied with Laurent's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
2015-08-18 22:26 ` [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups Sergei Shtylyov
@ 2015-08-18 22:29 ` Sergei Shtylyov
2015-08-25 12:30 ` Geert Uytterhoeven
2015-08-28 20:39 ` [PATCH] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
` (8 subsequent siblings)
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-18 22:29 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Add VIN0/1 pin groups to R8A7794 PFC driver.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
[Sergei: rebased, renamed, added changelog.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 203 +++++++++++++++++++++++++++++++++++
1 file changed, 203 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2789,6 +2789,167 @@ static const unsigned int usb1_mux[] = {
USB1_OVC_MARK,
};
+union vin_data {
+ unsigned int data24[24];
+ unsigned int data20[20];
+ unsigned int data16[16];
+ unsigned int data12[12];
+ unsigned int data10[10];
+ unsigned int data8[8];
+};
+
+#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), \
+ }
+
+/* - VIN0 ------------------------------------------------------------------- */
+static const union vin_data vin0_data_pins = {
+ .data24 = {
+ /* B */
+ RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+ },
+};
+static const union vin_data vin0_data_mux = {
+ .data24 = {
+ /* B */
+ VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G0_MARK, VI0_G1_MARK,
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R0_MARK, VI0_R1_MARK,
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+ },
+};
+static const unsigned int vin0_data18_pins[] = {
+ /* B */
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+};
+static const unsigned int vin0_data18_mux[] = {
+ /* B */
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+};
+static const unsigned int vin0_sync_pins[] = {
+ RCAR_GP_PIN(3, 11), /* HSYNC */
+ RCAR_GP_PIN(3, 12), /* VSYNC */
+};
+static const unsigned int vin0_sync_mux[] = {
+ VI0_HSYNC_N_MARK,
+ VI0_VSYNC_N_MARK,
+};
+static const unsigned int vin0_field_pins[] = {
+ RCAR_GP_PIN(3, 10),
+};
+static const unsigned int vin0_field_mux[] = {
+ VI0_FIELD_MARK,
+};
+static const unsigned int vin0_clkenb_pins[] = {
+ RCAR_GP_PIN(3, 9),
+};
+static const unsigned int vin0_clkenb_mux[] = {
+ VI0_CLKENB_MARK,
+};
+static const unsigned int vin0_clk_pins[] = {
+ RCAR_GP_PIN(3, 0),
+};
+static const unsigned int vin0_clk_mux[] = {
+ VI0_CLK_MARK,
+};
+
+/* - VIN1 ----------------------------------------------------------------- */
+static const unsigned int vin1_data8_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+};
+static const unsigned int vin1_data8_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+};
+static const unsigned int vin1_sync_pins[] = {
+ RCAR_GP_PIN(5, 22), /* HSYNC */
+ RCAR_GP_PIN(5, 23), /* VSYNC */
+};
+static const unsigned int vin1_sync_mux[] = {
+ VI1_HSYNC_N_MARK,
+ VI1_VSYNC_N_MARK,
+};
+static const unsigned int vin1_field_pins[] = {
+ RCAR_GP_PIN(5, 21),
+};
+static const unsigned int vin1_field_mux[] = {
+ VI1_FIELD_MARK,
+};
+static const unsigned int vin1_clkenb_pins[] = {
+ RCAR_GP_PIN(5, 20),
+};
+static const unsigned int vin1_clkenb_mux[] = {
+ VI1_CLKENB_MARK,
+};
+static const unsigned int vin1_clk_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int vin1_clk_mux[] = {
+ VI1_CLK_MARK,
+};
+static const unsigned int vin1_g_b_pins[] = {
+ /* G */
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+ RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+};
+static const unsigned int vin1_g_b_mux[] = {
+ /* G */
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+ VI1_DATA10_MARK, VI1_DATA11_MARK,
+};
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
SH_PFC_PIN_GROUP(eth_magic),
@@ -2965,6 +3126,23 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_wp),
SH_PFC_PIN_GROUP(usb0),
SH_PFC_PIN_GROUP(usb1),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+ VIN_DATA_PIN_GROUP(vin0_data, 20),
+ SH_PFC_PIN_GROUP(vin0_data18),
+ VIN_DATA_PIN_GROUP(vin0_data, 16),
+ VIN_DATA_PIN_GROUP(vin0_data, 12),
+ VIN_DATA_PIN_GROUP(vin0_data, 10),
+ VIN_DATA_PIN_GROUP(vin0_data, 8),
+ SH_PFC_PIN_GROUP(vin0_sync),
+ SH_PFC_PIN_GROUP(vin0_field),
+ SH_PFC_PIN_GROUP(vin0_clkenb),
+ SH_PFC_PIN_GROUP(vin0_clk),
+ SH_PFC_PIN_GROUP(vin1_data8),
+ SH_PFC_PIN_GROUP(vin1_sync),
+ SH_PFC_PIN_GROUP(vin1_field),
+ SH_PFC_PIN_GROUP(vin1_clkenb),
+ SH_PFC_PIN_GROUP(vin1_clk),
+ SH_PFC_PIN_GROUP(vin1_g_b),
};
static const char * const eth_groups[] = {
@@ -3247,6 +3425,29 @@ static const char * const usb1_groups[]
"usb1",
};
+static const char * const vin0_groups[] = {
+ "vin0_data24",
+ "vin0_data20",
+ "vin0_data18",
+ "vin0_data16",
+ "vin0_data12",
+ "vin0_data10",
+ "vin0_data8",
+ "vin0_sync",
+ "vin0_field",
+ "vin0_clkenb",
+ "vin0_clk",
+};
+
+static const char * const vin1_groups[] = {
+ "vin1_data8",
+ "vin1_sync",
+ "vin1_field",
+ "vin1_clkenb",
+ "vin1_clk",
+ "vin1_g_b",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3283,6 +3484,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi2),
SH_PFC_FUNCTION(usb0),
SH_PFC_FUNCTION(usb1),
+ SH_PFC_FUNCTION(vin0),
+ SH_PFC_FUNCTION(vin1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:29 ` [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN " Sergei Shtylyov
@ 2015-08-25 12:30 ` Geert Uytterhoeven
2015-08-26 22:20 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-08-25 12:30 UTC (permalink / raw)
To: Sergei Shtylyov, Koji Matsuoka
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hi (Tovaritsj?) Sergei, Matsuoka-san,
On Wed, Aug 19, 2015 at 12:29 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> Add VIN0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> [Sergei: rebased, renamed, added changelog.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thanks for your patch!
> --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> +++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> @@ -2789,6 +2789,167 @@ static const unsigned int usb1_mux[] = {
> USB1_OVC_MARK,
> };
>
> +union vin_data {
> + unsigned int data24[24];
> + unsigned int data20[20];
> + unsigned int data16[16];
> + unsigned int data12[12];
> + unsigned int data10[10];
> + unsigned int data8[8];
> +};
> +
> +#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), \
> + }
As this is the third occurrence of these 2 definitions, perhaps they
should be moved to sh_pfc.h?
> +/* - VIN1 ----------------------------------------------------------------- */
> +static const unsigned int vin1_g_b_pins[] = {
> + /* G */
> + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
> + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
> +};
> +static const unsigned int vin1_g_b_mux[] = {
> + /* G */
> + VI1_DATA8_MARK, VI1_DATA9_MARK,
> + VI1_DATA10_MARK, VI1_DATA11_MARK,
> +};
This is the green channel, to augment red and blue in vin_data8*?
If yes, would it make sense to have a separate vin1_data12* section,
combining them?
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] 32+ messages in thread
* Re: [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-25 12:30 ` Geert Uytterhoeven
@ 2015-08-26 22:20 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-26 22:20 UTC (permalink / raw)
To: Geert Uytterhoeven, Koji Matsuoka
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hello.
On 08/25/2015 03:30 PM, Geert Uytterhoeven wrote:
> Hi (Tovaritsj?) Sergei,
Tovarishch. :-)
> Matsuoka-san,
>> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>>
>> Add VIN0/1 pin groups to R8A7794 PFC driver.
>>
>> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>> [Sergei: rebased, renamed, added changelog.]
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Thanks for your patch!
>
>> --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
>> +++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
>> @@ -2789,6 +2789,167 @@ static const unsigned int usb1_mux[] = {
>> USB1_OVC_MARK,
>> };
>>
>> +union vin_data {
>> + unsigned int data24[24];
>> + unsigned int data20[20];
>> + unsigned int data16[16];
>> + unsigned int data12[12];
>> + unsigned int data10[10];
>> + unsigned int data8[8];
>> +};
>> +
>> +#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), \
>> + }
>
> As this is the third occurrence of these 2 definitions, perhaps they
> should be moved to sh_pfc.h?
I'll look into this.
>> +/* - VIN1 ----------------------------------------------------------------- */
>
>> +static const unsigned int vin1_g_b_pins[] = {
>> + /* G */
>> + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
>> + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
>> +};
>> +static const unsigned int vin1_g_b_mux[] = {
>> + /* G */
>> + VI1_DATA8_MARK, VI1_DATA9_MARK,
>> + VI1_DATA10_MARK, VI1_DATA11_MARK,
>> +};
>
> This is the green channel, to augment red and blue in vin_data8*?
I have no idea, even after rummaging in the BT.* specs mentioned in the
manuals. ITU-R BT.656 only describes 8- and 10-bit interfaces. Matsuoka-san,
any idea?
> If yes, would it make sense to have a separate vin1_data12* section,
> combining them?
Most probably.
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
2015-08-18 22:26 ` [PATCH 1/2] pinctrl: sh-pfc: r8a7794: add USB pin groups Sergei Shtylyov
2015-08-18 22:29 ` [PATCH 2/2] pinctrl: sh-pfc: r8a7794: add VIN " Sergei Shtylyov
@ 2015-08-28 20:39 ` Sergei Shtylyov
2015-09-21 11:45 ` Geert Uytterhoeven
2015-08-28 20:46 ` [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
` (7 subsequent siblings)
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-28 20:39 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely
identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the shared
header file...
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 18 ------------------
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------
drivers/pinctrl/sh-pfc/sh_pfc.h | 18 ++++++++++++++++++
3 files changed, 18 insertions(+), 36 deletions(-)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
@@ -3625,24 +3625,6 @@ static const unsigned int usb2_mux[] = {
USB2_PWEN_MARK, USB2_OVC_MARK,
};
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
- unsigned int data4[4];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = {
USB1_PWEN_MARK,
USB1_OVC_MARK,
};
-
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/sh_pfc.h
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -52,6 +52,24 @@ struct sh_pfc_pin_group {
unsigned int nr_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), \
+ }
+
+union vin_data {
+ unsigned int data24[24];
+ unsigned int data20[20];
+ unsigned int data16[16];
+ unsigned int data12[12];
+ unsigned int data10[10];
+ unsigned int data8[8];
+ unsigned int data4[4];
+};
+
#define SH_PFC_FUNCTION(n) \
{ \
.name = #n, \
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file
2015-08-28 20:39 ` [PATCH] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
@ 2015-09-21 11:45 ` Geert Uytterhoeven
0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-09-21 11:45 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
On Fri, Aug 28, 2015 at 10:39 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely
> identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the shared
> header file...
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-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] 32+ messages in thread
* [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (2 preceding siblings ...)
2015-08-28 20:39 ` [PATCH] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
@ 2015-08-28 20:46 ` Sergei Shtylyov
2015-09-21 12:03 ` Geert Uytterhoeven
2015-10-02 7:59 ` Geert Uytterhoeven
2015-09-21 21:59 ` [PATCH v3] " Sergei Shtylyov
` (6 subsequent siblings)
10 siblings, 2 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-08-28 20:46 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Add VIN0/1 pin groups to R8A7794 PFC driver.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
[Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
single pin group.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
It depends on the patch I've just posted in order to build.
Changes in version 2:
- relied on the 'struct vin_data' and #define VIN_DATA_PIN_GROUP() moved to the
common header file;
- added to the VI1_DATA8/9/10/11 pin group VI1_DATA[0-7] pins and renamed/moved
this pin group.
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 192 +++++++++++++++++++++++++++++++++++
1 file changed, 192 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2789,6 +2789,156 @@ static const unsigned int usb1_mux[] = {
USB1_OVC_MARK,
};
+/* - VIN0 ------------------------------------------------------------------- */
+static const union vin_data vin0_data_pins = {
+ .data24 = {
+ /* B */
+ RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+ },
+};
+static const union vin_data vin0_data_mux = {
+ .data24 = {
+ /* B */
+ VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G0_MARK, VI0_G1_MARK,
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R0_MARK, VI0_R1_MARK,
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+ },
+};
+static const unsigned int vin0_data18_pins[] = {
+ /* B */
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+};
+static const unsigned int vin0_data18_mux[] = {
+ /* B */
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+};
+static const unsigned int vin0_sync_pins[] = {
+ RCAR_GP_PIN(3, 11), /* HSYNC */
+ RCAR_GP_PIN(3, 12), /* VSYNC */
+};
+static const unsigned int vin0_sync_mux[] = {
+ VI0_HSYNC_N_MARK,
+ VI0_VSYNC_N_MARK,
+};
+static const unsigned int vin0_field_pins[] = {
+ RCAR_GP_PIN(3, 10),
+};
+static const unsigned int vin0_field_mux[] = {
+ VI0_FIELD_MARK,
+};
+static const unsigned int vin0_clkenb_pins[] = {
+ RCAR_GP_PIN(3, 9),
+};
+static const unsigned int vin0_clkenb_mux[] = {
+ VI0_CLKENB_MARK,
+};
+static const unsigned int vin0_clk_pins[] = {
+ RCAR_GP_PIN(3, 0),
+};
+static const unsigned int vin0_clk_mux[] = {
+ VI0_CLK_MARK,
+};
+
+/* - VIN1 ----------------------------------------------------------------- */
+static const unsigned int vin1_data8_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+};
+static const unsigned int vin1_data8_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+};
+static const unsigned int vin1_data12_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+ RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+};
+static const unsigned int vin1_data12_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+ VI1_DATA10_MARK, VI1_DATA11_MARK,
+};
+static const unsigned int vin1_sync_pins[] = {
+ RCAR_GP_PIN(5, 22), /* HSYNC */
+ RCAR_GP_PIN(5, 23), /* VSYNC */
+};
+static const unsigned int vin1_sync_mux[] = {
+ VI1_HSYNC_N_MARK,
+ VI1_VSYNC_N_MARK,
+};
+static const unsigned int vin1_field_pins[] = {
+ RCAR_GP_PIN(5, 21),
+};
+static const unsigned int vin1_field_mux[] = {
+ VI1_FIELD_MARK,
+};
+static const unsigned int vin1_clkenb_pins[] = {
+ RCAR_GP_PIN(5, 20),
+};
+static const unsigned int vin1_clkenb_mux[] = {
+ VI1_CLKENB_MARK,
+};
+static const unsigned int vin1_clk_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int vin1_clk_mux[] = {
+ VI1_CLK_MARK,
+};
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
SH_PFC_PIN_GROUP(eth_magic),
@@ -2965,6 +3115,23 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_wp),
SH_PFC_PIN_GROUP(usb0),
SH_PFC_PIN_GROUP(usb1),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+ VIN_DATA_PIN_GROUP(vin0_data, 20),
+ SH_PFC_PIN_GROUP(vin0_data18),
+ VIN_DATA_PIN_GROUP(vin0_data, 16),
+ VIN_DATA_PIN_GROUP(vin0_data, 12),
+ VIN_DATA_PIN_GROUP(vin0_data, 10),
+ VIN_DATA_PIN_GROUP(vin0_data, 8),
+ SH_PFC_PIN_GROUP(vin0_sync),
+ SH_PFC_PIN_GROUP(vin0_field),
+ SH_PFC_PIN_GROUP(vin0_clkenb),
+ SH_PFC_PIN_GROUP(vin0_clk),
+ SH_PFC_PIN_GROUP(vin1_data8),
+ SH_PFC_PIN_GROUP(vin1_data12),
+ SH_PFC_PIN_GROUP(vin1_sync),
+ SH_PFC_PIN_GROUP(vin1_field),
+ SH_PFC_PIN_GROUP(vin1_clkenb),
+ SH_PFC_PIN_GROUP(vin1_clk),
};
static const char * const eth_groups[] = {
@@ -3247,6 +3414,29 @@ static const char * const usb1_groups[]
"usb1",
};
+static const char * const vin0_groups[] = {
+ "vin0_data24",
+ "vin0_data20",
+ "vin0_data18",
+ "vin0_data16",
+ "vin0_data12",
+ "vin0_data10",
+ "vin0_data8",
+ "vin0_sync",
+ "vin0_field",
+ "vin0_clkenb",
+ "vin0_clk",
+};
+
+static const char * const vin1_groups[] = {
+ "vin1_data8",
+ "vin1_data12",
+ "vin1_sync",
+ "vin1_field",
+ "vin1_clkenb",
+ "vin1_clk",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3283,6 +3473,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi2),
SH_PFC_FUNCTION(usb0),
SH_PFC_FUNCTION(usb1),
+ SH_PFC_FUNCTION(vin0),
+ SH_PFC_FUNCTION(vin1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-28 20:46 ` [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
@ 2015-09-21 12:03 ` Geert Uytterhoeven
2015-10-02 7:59 ` Geert Uytterhoeven
1 sibling, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-09-21 12:03 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org, Koji Matsuoka
Hi Sergei,
On Fri, Aug 28, 2015 at 10:46 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> Add VIN0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> [Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
> single pin group.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
> It depends on the patch I've just posted in order to build.
>
> Changes in version 2:
> - relied on the 'struct vin_data' and #define VIN_DATA_PIN_GROUP() moved to the
> common header file;
> - added to the VI1_DATA8/9/10/11 pin group VI1_DATA[0-7] pins and renamed/moved
> this pin group.
Thanks for the update!
> drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 192 +++++++++++++++++++++++++++++++++++
> 1 file changed, 192 insertions(+)
>
> Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> ===================================================================
> --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> +++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
> @@ -2789,6 +2789,156 @@ static const unsigned int usb1_mux[] = {
> +/* - VIN1 ----------------------------------------------------------------- */
> +static const unsigned int vin1_data8_pins[] = {
> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
> +};
> +static const unsigned int vin1_data8_mux[] = {
> + VI1_DATA0_MARK, VI1_DATA1_MARK,
> + VI1_DATA2_MARK, VI1_DATA3_MARK,
> + VI1_DATA4_MARK, VI1_DATA5_MARK,
> + VI1_DATA6_MARK, VI1_DATA7_MARK,
> +};
> +static const unsigned int vin1_data12_pins[] = {
> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
> + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
> + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
> +};
> +static const unsigned int vin1_data12_mux[] = {
> + VI1_DATA0_MARK, VI1_DATA1_MARK,
> + VI1_DATA2_MARK, VI1_DATA3_MARK,
> + VI1_DATA4_MARK, VI1_DATA5_MARK,
> + VI1_DATA6_MARK, VI1_DATA7_MARK,
> + VI1_DATA8_MARK, VI1_DATA9_MARK,
> + VI1_DATA10_MARK, VI1_DATA11_MARK,
> +};
According to Table 26.2, VIN Channel 1 on R-Car E2 supports 8, 10, and 12 bit
input data. Can you please add data10, too?
Thanks again!
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] 32+ messages in thread
* Re: [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-28 20:46 ` [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
2015-09-21 12:03 ` Geert Uytterhoeven
@ 2015-10-02 7:59 ` Geert Uytterhoeven
2015-10-02 11:12 ` Sergei Shtylyov
1 sibling, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-10-02 7:59 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hi Sergei,
On Fri, Aug 28, 2015 at 10:46 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> +/* - VIN1 ----------------------------------------------------------------- */
> +static const unsigned int vin1_data8_pins[] = {
> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
> +};
> +static const unsigned int vin1_data8_mux[] = {
> + VI1_DATA0_MARK, VI1_DATA1_MARK,
> + VI1_DATA2_MARK, VI1_DATA3_MARK,
> + VI1_DATA4_MARK, VI1_DATA5_MARK,
> + VI1_DATA6_MARK, VI1_DATA7_MARK,
> +};
> +static const unsigned int vin1_data12_pins[] = {
> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
> + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
> + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
> +};
> +static const unsigned int vin1_data12_mux[] = {
> + VI1_DATA0_MARK, VI1_DATA1_MARK,
> + VI1_DATA2_MARK, VI1_DATA3_MARK,
> + VI1_DATA4_MARK, VI1_DATA5_MARK,
> + VI1_DATA6_MARK, VI1_DATA7_MARK,
> + VI1_DATA8_MARK, VI1_DATA9_MARK,
> + VI1_DATA10_MARK, VI1_DATA11_MARK,
> +};
Given Laurent asked to slightly rework this series, perhaps
vin1_data*[] can use a union to decrease memory usage, too?
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] 32+ messages in thread
* Re: [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-10-02 7:59 ` Geert Uytterhoeven
@ 2015-10-02 11:12 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-10-02 11:12 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hello.
On 10/2/2015 10:59 AM, Geert Uytterhoeven wrote:
>> +/* - VIN1 ----------------------------------------------------------------- */
>> +static const unsigned int vin1_data8_pins[] = {
>> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
>> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
>> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
>> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
>> +};
>> +static const unsigned int vin1_data8_mux[] = {
>> + VI1_DATA0_MARK, VI1_DATA1_MARK,
>> + VI1_DATA2_MARK, VI1_DATA3_MARK,
>> + VI1_DATA4_MARK, VI1_DATA5_MARK,
>> + VI1_DATA6_MARK, VI1_DATA7_MARK,
>> +};
>> +static const unsigned int vin1_data12_pins[] = {
>> + RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
>> + RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
>> + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
>> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
>> + RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
>> + RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
>> +};
>> +static const unsigned int vin1_data12_mux[] = {
>> + VI1_DATA0_MARK, VI1_DATA1_MARK,
>> + VI1_DATA2_MARK, VI1_DATA3_MARK,
>> + VI1_DATA4_MARK, VI1_DATA5_MARK,
>> + VI1_DATA6_MARK, VI1_DATA7_MARK,
>> + VI1_DATA8_MARK, VI1_DATA9_MARK,
>> + VI1_DATA10_MARK, VI1_DATA11_MARK,
>> +};
>
> Given Laurent asked to slightly rework this series, perhaps
> vin1_data*[] can use a union to decrease memory usage, too?
You're right -- using 'union vin_data' would save some memory now that we
have 3 pairs of arrays.
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (3 preceding siblings ...)
2015-08-28 20:46 ` [PATCH v2] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
@ 2015-09-21 21:59 ` Sergei Shtylyov
2015-09-21 22:02 ` Sergei Shtylyov
2015-09-21 22:00 ` Sergei Shtylyov
` (5 subsequent siblings)
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-09-21 21:59 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Add VIN0/1 pin groups to R8A7794 PFC driver.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
[Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
single pin group, added "vin1_data10" pin group.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
Changes in version 3:
- added "vin1_data10" pin group.
Changes in version 2:
- relied on the 'struct vin_data' and #define VIN_DATA_PIN_GROUP() moved to the
common header file;
- added to the VI1_DATA8/9/10/11 pin group VI1_DATA[0-7] pins and renamed/moved
this pin group.
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 208 +++++++++++++++++++++++++++++++++++
1 file changed, 208 insertions(+)
Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2789,6 +2789,170 @@ static const unsigned int usb1_mux[] = {
USB1_OVC_MARK,
};
+/* - VIN0 ------------------------------------------------------------------- */
+static const union vin_data vin0_data_pins = {
+ .data24 = {
+ /* B */
+ RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+ },
+};
+static const union vin_data vin0_data_mux = {
+ .data24 = {
+ /* B */
+ VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G0_MARK, VI0_G1_MARK,
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R0_MARK, VI0_R1_MARK,
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+ },
+};
+static const unsigned int vin0_data18_pins[] = {
+ /* B */
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+};
+static const unsigned int vin0_data18_mux[] = {
+ /* B */
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+};
+static const unsigned int vin0_sync_pins[] = {
+ RCAR_GP_PIN(3, 11), /* HSYNC */
+ RCAR_GP_PIN(3, 12), /* VSYNC */
+};
+static const unsigned int vin0_sync_mux[] = {
+ VI0_HSYNC_N_MARK,
+ VI0_VSYNC_N_MARK,
+};
+static const unsigned int vin0_field_pins[] = {
+ RCAR_GP_PIN(3, 10),
+};
+static const unsigned int vin0_field_mux[] = {
+ VI0_FIELD_MARK,
+};
+static const unsigned int vin0_clkenb_pins[] = {
+ RCAR_GP_PIN(3, 9),
+};
+static const unsigned int vin0_clkenb_mux[] = {
+ VI0_CLKENB_MARK,
+};
+static const unsigned int vin0_clk_pins[] = {
+ RCAR_GP_PIN(3, 0),
+};
+static const unsigned int vin0_clk_mux[] = {
+ VI0_CLK_MARK,
+};
+
+/* - VIN1 ----------------------------------------------------------------- */
+static const unsigned int vin1_data8_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+};
+static const unsigned int vin1_data8_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+};
+static const unsigned int vin1_data10_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+};
+static const unsigned int vin1_data10_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+};
+static const unsigned int vin1_data12_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+ RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+};
+static const unsigned int vin1_data12_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+ VI1_DATA10_MARK, VI1_DATA11_MARK,
+};
+static const unsigned int vin1_sync_pins[] = {
+ RCAR_GP_PIN(5, 22), /* HSYNC */
+ RCAR_GP_PIN(5, 23), /* VSYNC */
+};
+static const unsigned int vin1_sync_mux[] = {
+ VI1_HSYNC_N_MARK,
+ VI1_VSYNC_N_MARK,
+};
+static const unsigned int vin1_field_pins[] = {
+ RCAR_GP_PIN(5, 21),
+};
+static const unsigned int vin1_field_mux[] = {
+ VI1_FIELD_MARK,
+};
+static const unsigned int vin1_clkenb_pins[] = {
+ RCAR_GP_PIN(5, 20),
+};
+static const unsigned int vin1_clkenb_mux[] = {
+ VI1_CLKENB_MARK,
+};
+static const unsigned int vin1_clk_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int vin1_clk_mux[] = {
+ VI1_CLK_MARK,
+};
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
SH_PFC_PIN_GROUP(eth_magic),
@@ -2965,6 +3129,24 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_wp),
SH_PFC_PIN_GROUP(usb0),
SH_PFC_PIN_GROUP(usb1),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+ VIN_DATA_PIN_GROUP(vin0_data, 20),
+ SH_PFC_PIN_GROUP(vin0_data18),
+ VIN_DATA_PIN_GROUP(vin0_data, 16),
+ VIN_DATA_PIN_GROUP(vin0_data, 12),
+ VIN_DATA_PIN_GROUP(vin0_data, 10),
+ VIN_DATA_PIN_GROUP(vin0_data, 8),
+ SH_PFC_PIN_GROUP(vin0_sync),
+ SH_PFC_PIN_GROUP(vin0_field),
+ SH_PFC_PIN_GROUP(vin0_clkenb),
+ SH_PFC_PIN_GROUP(vin0_clk),
+ SH_PFC_PIN_GROUP(vin1_data8),
+ SH_PFC_PIN_GROUP(vin1_data10),
+ SH_PFC_PIN_GROUP(vin1_data12),
+ SH_PFC_PIN_GROUP(vin1_sync),
+ SH_PFC_PIN_GROUP(vin1_field),
+ SH_PFC_PIN_GROUP(vin1_clkenb),
+ SH_PFC_PIN_GROUP(vin1_clk),
};
static const char * const eth_groups[] = {
@@ -3247,6 +3429,30 @@ static const char * const usb1_groups[]
"usb1",
};
+static const char * const vin0_groups[] = {
+ "vin0_data24",
+ "vin0_data20",
+ "vin0_data18",
+ "vin0_data16",
+ "vin0_data12",
+ "vin0_data10",
+ "vin0_data8",
+ "vin0_sync",
+ "vin0_field",
+ "vin0_clkenb",
+ "vin0_clk",
+};
+
+static const char * const vin1_groups[] = {
+ "vin1_data8",
+ "vin1_data10",
+ "vin1_data12",
+ "vin1_sync",
+ "vin1_field",
+ "vin1_clkenb",
+ "vin1_clk",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3283,6 +3489,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi2),
SH_PFC_FUNCTION(usb0),
SH_PFC_FUNCTION(usb1),
+ SH_PFC_FUNCTION(vin0),
+ SH_PFC_FUNCTION(vin1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-09-21 21:59 ` [PATCH v3] " Sergei Shtylyov
@ 2015-09-21 22:02 ` Sergei Shtylyov
0 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-09-21 22:02 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
On 09/22/2015 12:59 AM, Sergei Shtylyov wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> Add VIN0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> [Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
> single pin group, added "vin1_data10" pin group.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> Changes in version 3:
> - added "vin1_data10" pin group.
Sorry, posted from a wrong file. The patch itself was OK though.
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (4 preceding siblings ...)
2015-09-21 21:59 ` [PATCH v3] " Sergei Shtylyov
@ 2015-09-21 22:00 ` Sergei Shtylyov
2015-09-22 7:32 ` Geert Uytterhoeven
2015-09-22 22:06 ` [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
` (4 subsequent siblings)
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-09-21 22:00 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Add VIN0/1 pin groups to R8A7794 PFC driver.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
[Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
single pin group, added "vin1_data10" pin group.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
It depends on the patch moving 'union vin_data' to shared header file in order
to build.
Changes in version 3:
- added "vin1_data10" pin group.
Changes in version 2:
- relied on the 'struct vin_data' and #define VIN_DATA_PIN_GROUP() moved to the
common header file;
- added to the VI1_DATA8/9/10/11 pin group VI1_DATA[0-7] pins and renamed/moved
this pin group.
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 208 +++++++++++++++++++++++++++++++++++
1 file changed, 208 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2789,6 +2789,170 @@ static const unsigned int usb1_mux[] = {
USB1_OVC_MARK,
};
+/* - VIN0 ------------------------------------------------------------------- */
+static const union vin_data vin0_data_pins = {
+ .data24 = {
+ /* B */
+ RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+ },
+};
+static const union vin_data vin0_data_mux = {
+ .data24 = {
+ /* B */
+ VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G0_MARK, VI0_G1_MARK,
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R0_MARK, VI0_R1_MARK,
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+ },
+};
+static const unsigned int vin0_data18_pins[] = {
+ /* B */
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+};
+static const unsigned int vin0_data18_mux[] = {
+ /* B */
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+};
+static const unsigned int vin0_sync_pins[] = {
+ RCAR_GP_PIN(3, 11), /* HSYNC */
+ RCAR_GP_PIN(3, 12), /* VSYNC */
+};
+static const unsigned int vin0_sync_mux[] = {
+ VI0_HSYNC_N_MARK,
+ VI0_VSYNC_N_MARK,
+};
+static const unsigned int vin0_field_pins[] = {
+ RCAR_GP_PIN(3, 10),
+};
+static const unsigned int vin0_field_mux[] = {
+ VI0_FIELD_MARK,
+};
+static const unsigned int vin0_clkenb_pins[] = {
+ RCAR_GP_PIN(3, 9),
+};
+static const unsigned int vin0_clkenb_mux[] = {
+ VI0_CLKENB_MARK,
+};
+static const unsigned int vin0_clk_pins[] = {
+ RCAR_GP_PIN(3, 0),
+};
+static const unsigned int vin0_clk_mux[] = {
+ VI0_CLK_MARK,
+};
+
+/* - VIN1 ----------------------------------------------------------------- */
+static const unsigned int vin1_data8_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+};
+static const unsigned int vin1_data8_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+};
+static const unsigned int vin1_data10_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+};
+static const unsigned int vin1_data10_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+};
+static const unsigned int vin1_data12_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+ RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+};
+static const unsigned int vin1_data12_mux[] = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+ VI1_DATA10_MARK, VI1_DATA11_MARK,
+};
+static const unsigned int vin1_sync_pins[] = {
+ RCAR_GP_PIN(5, 22), /* HSYNC */
+ RCAR_GP_PIN(5, 23), /* VSYNC */
+};
+static const unsigned int vin1_sync_mux[] = {
+ VI1_HSYNC_N_MARK,
+ VI1_VSYNC_N_MARK,
+};
+static const unsigned int vin1_field_pins[] = {
+ RCAR_GP_PIN(5, 21),
+};
+static const unsigned int vin1_field_mux[] = {
+ VI1_FIELD_MARK,
+};
+static const unsigned int vin1_clkenb_pins[] = {
+ RCAR_GP_PIN(5, 20),
+};
+static const unsigned int vin1_clkenb_mux[] = {
+ VI1_CLKENB_MARK,
+};
+static const unsigned int vin1_clk_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int vin1_clk_mux[] = {
+ VI1_CLK_MARK,
+};
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
SH_PFC_PIN_GROUP(eth_magic),
@@ -2965,6 +3129,24 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_wp),
SH_PFC_PIN_GROUP(usb0),
SH_PFC_PIN_GROUP(usb1),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+ VIN_DATA_PIN_GROUP(vin0_data, 20),
+ SH_PFC_PIN_GROUP(vin0_data18),
+ VIN_DATA_PIN_GROUP(vin0_data, 16),
+ VIN_DATA_PIN_GROUP(vin0_data, 12),
+ VIN_DATA_PIN_GROUP(vin0_data, 10),
+ VIN_DATA_PIN_GROUP(vin0_data, 8),
+ SH_PFC_PIN_GROUP(vin0_sync),
+ SH_PFC_PIN_GROUP(vin0_field),
+ SH_PFC_PIN_GROUP(vin0_clkenb),
+ SH_PFC_PIN_GROUP(vin0_clk),
+ SH_PFC_PIN_GROUP(vin1_data8),
+ SH_PFC_PIN_GROUP(vin1_data10),
+ SH_PFC_PIN_GROUP(vin1_data12),
+ SH_PFC_PIN_GROUP(vin1_sync),
+ SH_PFC_PIN_GROUP(vin1_field),
+ SH_PFC_PIN_GROUP(vin1_clkenb),
+ SH_PFC_PIN_GROUP(vin1_clk),
};
static const char * const eth_groups[] = {
@@ -3247,6 +3429,30 @@ static const char * const usb1_groups[]
"usb1",
};
+static const char * const vin0_groups[] = {
+ "vin0_data24",
+ "vin0_data20",
+ "vin0_data18",
+ "vin0_data16",
+ "vin0_data12",
+ "vin0_data10",
+ "vin0_data8",
+ "vin0_sync",
+ "vin0_field",
+ "vin0_clkenb",
+ "vin0_clk",
+};
+
+static const char * const vin1_groups[] = {
+ "vin1_data8",
+ "vin1_data10",
+ "vin1_data12",
+ "vin1_sync",
+ "vin1_field",
+ "vin1_clkenb",
+ "vin1_clk",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3283,6 +3489,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi2),
SH_PFC_FUNCTION(usb0),
SH_PFC_FUNCTION(usb1),
+ SH_PFC_FUNCTION(vin0),
+ SH_PFC_FUNCTION(vin1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v3] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-09-21 22:00 ` Sergei Shtylyov
@ 2015-09-22 7:32 ` Geert Uytterhoeven
0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-09-22 7:32 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
On Tue, Sep 22, 2015 at 12:00 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> Add VIN0/1 pin groups to R8A7794 PFC driver.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> [Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a
> single pin group, added "vin1_data10" pin group.]
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.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
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (5 preceding siblings ...)
2015-09-21 22:00 ` Sergei Shtylyov
@ 2015-09-22 22:06 ` Sergei Shtylyov
2015-10-01 16:20 ` Laurent Pinchart
2015-10-02 23:21 ` [PATCH v3] " Sergei Shtylyov
` (3 subsequent siblings)
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-09-22 22:06 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely
identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the shared
header file...
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
Changed in version 2:
- removed leftover empty line from the R8A7790 driver;
- added Geert's ACK.
drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 19 -------------------
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------
drivers/pinctrl/sh-pfc/sh_pfc.h | 18 ++++++++++++++++++
3 files changed, 18 insertions(+), 37 deletions(-)
Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
===================================================================
--- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
@@ -3624,25 +3624,6 @@ static const unsigned int usb2_pins[] =
static const unsigned int usb2_mux[] = {
USB2_PWEN_MARK, USB2_OVC_MARK,
};
-
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
- unsigned int data4[4];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
===================================================================
--- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = {
USB1_PWEN_MARK,
USB1_OVC_MARK,
};
-
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: renesas/drivers/pinctrl/sh-pfc/sh_pfc.h
===================================================================
--- renesas.orig/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ renesas/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -52,6 +52,24 @@ struct sh_pfc_pin_group {
unsigned int nr_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), \
+ }
+
+union vin_data {
+ unsigned int data24[24];
+ unsigned int data20[20];
+ unsigned int data16[16];
+ unsigned int data12[12];
+ unsigned int data10[10];
+ unsigned int data8[8];
+ unsigned int data4[4];
+};
+
#define SH_PFC_FUNCTION(n) \
{ \
.name = #n, \
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file
2015-09-22 22:06 ` [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
@ 2015-10-01 16:20 ` Laurent Pinchart
0 siblings, 0 replies; 32+ messages in thread
From: Laurent Pinchart @ 2015-10-01 16:20 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linus.walleij, linux-sh, linux-gpio
Hi Sergei,
Thank you for the patch.
On Wednesday 23 September 2015 01:06:21 Sergei Shtylyov wrote:
> R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely
> identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the
> shared header file...
>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> ---
> The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git'
> repo.
>
> Changed in version 2:
> - removed leftover empty line from the R8A7790 driver;
> - added Geert's ACK.
>
> drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 19 -------------------
> drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------
> drivers/pinctrl/sh-pfc/sh_pfc.h | 18 ++++++++++++++++++
> 3 files changed, 18 insertions(+), 37 deletions(-)
>
> Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> ===================================================================
> --- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> +++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> @@ -3624,25 +3624,6 @@ static const unsigned int usb2_pins[] =
> static const unsigned int usb2_mux[] = {
> USB2_PWEN_MARK, USB2_OVC_MARK,
> };
> -
> -union vin_data {
> - unsigned int data24[24];
> - unsigned int data20[20];
> - unsigned int data16[16];
> - unsigned int data12[12];
> - unsigned int data10[10];
> - unsigned int data8[8];
> - unsigned int data4[4];
> -};
> -
> -#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), \
> - }
> -
> /* - VIN0 -------------------------------------------------------------- */
> static const union vin_data vin0_data_pins = {
> .data24 = {
> Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
> ===================================================================
> --- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
> +++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
> @@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = {
> USB1_PWEN_MARK,
> USB1_OVC_MARK,
> };
> -
> -union vin_data {
> - unsigned int data24[24];
> - unsigned int data20[20];
> - unsigned int data16[16];
> - unsigned int data12[12];
> - unsigned int data10[10];
> - unsigned int data8[8];
> -};
> -
> -#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), \
> - }
> -
> /* - VIN0 -------------------------------------------------------------- */
> static const union vin_data vin0_data_pins = {
> .data24 = {
> Index: renesas/drivers/pinctrl/sh-pfc/sh_pfc.h
> ===================================================================
> --- renesas.orig/drivers/pinctrl/sh-pfc/sh_pfc.h
> +++ renesas/drivers/pinctrl/sh-pfc/sh_pfc.h
> @@ -52,6 +52,24 @@ struct sh_pfc_pin_group {
> unsigned int nr_pins;
> };
The sh_pfc.h file is getting a bit messy, so I'd just add a comment here to
tell what the macro and union are about.
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +#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), \
> + }
> +
> +union vin_data {
> + unsigned int data24[24];
> + unsigned int data20[20];
> + unsigned int data16[16];
> + unsigned int data12[12];
> + unsigned int data10[10];
> + unsigned int data8[8];
> + unsigned int data4[4];
> +};
> +
> #define SH_PFC_FUNCTION(n) \
> { \
> .name = #n, \
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v3] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (6 preceding siblings ...)
2015-09-22 22:06 ` [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Sergei Shtylyov
@ 2015-10-02 23:21 ` Sergei Shtylyov
2015-10-02 23:21 ` [PATCH v4] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
` (2 subsequent siblings)
10 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-10-02 23:21 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely
identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the shared
header file...
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
Changes in version 3:
- added a comment to the common header file;
- added Laurent's ACK.
Changes in version 2:
- removed leftover empty line from the R8A7790 driver;
- added Geert's ACK.
drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 19 -------------------
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------
drivers/pinctrl/sh-pfc/sh_pfc.h | 23 +++++++++++++++++++++++
3 files changed, 23 insertions(+), 37 deletions(-)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
@@ -3624,25 +3624,6 @@ static const unsigned int usb2_pins[] =
static const unsigned int usb2_mux[] = {
USB2_PWEN_MARK, USB2_OVC_MARK,
};
-
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
- unsigned int data4[4];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = {
USB1_PWEN_MARK,
USB1_OVC_MARK,
};
-
-union vin_data {
- unsigned int data24[24];
- unsigned int data20[20];
- unsigned int data16[16];
- unsigned int data12[12];
- unsigned int data10[10];
- unsigned int data8[8];
-};
-
-#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), \
- }
-
/* - VIN0 ------------------------------------------------------------------- */
static const union vin_data vin0_data_pins = {
.data24 = {
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/sh_pfc.h
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -52,6 +52,29 @@ struct sh_pfc_pin_group {
unsigned int nr_pins;
};
+/*
+ * 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.
+ */
+#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), \
+ }
+
+union vin_data {
+ unsigned int data24[24];
+ unsigned int data20[20];
+ unsigned int data16[16];
+ unsigned int data12[12];
+ unsigned int data10[10];
+ unsigned int data8[8];
+ unsigned int data4[4];
+};
+
#define SH_PFC_FUNCTION(n) \
{ \
.name = #n, \
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v4] pinctrl: sh-pfc: r8a7794: add VIN pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (7 preceding siblings ...)
2015-10-02 23:21 ` [PATCH v3] " Sergei Shtylyov
@ 2015-10-02 23:21 ` Sergei Shtylyov
2015-12-02 20:11 ` [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB " Sergei Shtylyov
2015-12-14 22:06 ` [PATCH v2] " Sergei Shtylyov
10 siblings, 0 replies; 32+ messages in thread
From: Sergei Shtylyov @ 2015-10-02 23:21 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Add VIN0/1 pin groups to R8A7794 PFC driver.
Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into
a single pin group, added "vin1_data10" pin group, used 'union vin_data' and
VIN_DATA_PIN_GROUP() macro to describe VIN1 pins, reversed the order of the
VIN1 pin groups, removed unneeded empty lines, fixed VIN1 separator comment.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
It depends on the patch moving 'union vin_data' to shared header file in order
to build.
Changes in version 4:
- made use of the 'union vin_data' and VIN_DATA_PIN_GROUP() macro to describe
the VIN1 pins;
- listed the VIN1 data pin groups in reverse order;
- removed empty lines before VIN0/1 pin data;
- fixed the VIN1 separator comment.
Changes in version 3:
- added "vin1_data10" pin group.
Changes in version 2:
- relied on the 'struct vin_data' and #define VIN_DATA_PIN_GROUP() moved to the
common header file;
- added to the VI1_DATA8/9/10/11 pin group VI1_DATA[0-7] pins and renamed/moved
this pin group.
drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 184 +++++++++++++++++++++++++++++++++++
1 file changed, 184 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -2774,6 +2774,146 @@ static const unsigned int usb1_mux[] = {
USB1_PWEN_MARK,
USB1_OVC_MARK,
};
+/* - VIN0 ------------------------------------------------------------------- */
+static const union vin_data vin0_data_pins = {
+ .data24 = {
+ /* B */
+ RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+ },
+};
+static const union vin_data vin0_data_mux = {
+ .data24 = {
+ /* B */
+ VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G0_MARK, VI0_G1_MARK,
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R0_MARK, VI0_R1_MARK,
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+ },
+};
+static const unsigned int vin0_data18_pins[] = {
+ /* B */
+ RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+ RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
+ RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
+ /* G */
+ RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+ RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
+ RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
+ /* R */
+ RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
+ RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
+ RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
+};
+static const unsigned int vin0_data18_mux[] = {
+ /* B */
+ VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
+ VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
+ VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
+ /* G */
+ VI0_G2_MARK, VI0_G3_MARK,
+ VI0_G4_MARK, VI0_G5_MARK,
+ VI0_G6_MARK, VI0_G7_MARK,
+ /* R */
+ VI0_R2_MARK, VI0_R3_MARK,
+ VI0_R4_MARK, VI0_R5_MARK,
+ VI0_R6_MARK, VI0_R7_MARK,
+};
+static const unsigned int vin0_sync_pins[] = {
+ RCAR_GP_PIN(3, 11), /* HSYNC */
+ RCAR_GP_PIN(3, 12), /* VSYNC */
+};
+static const unsigned int vin0_sync_mux[] = {
+ VI0_HSYNC_N_MARK,
+ VI0_VSYNC_N_MARK,
+};
+static const unsigned int vin0_field_pins[] = {
+ RCAR_GP_PIN(3, 10),
+};
+static const unsigned int vin0_field_mux[] = {
+ VI0_FIELD_MARK,
+};
+static const unsigned int vin0_clkenb_pins[] = {
+ RCAR_GP_PIN(3, 9),
+};
+static const unsigned int vin0_clkenb_mux[] = {
+ VI0_CLKENB_MARK,
+};
+static const unsigned int vin0_clk_pins[] = {
+ RCAR_GP_PIN(3, 0),
+};
+static const unsigned int vin0_clk_mux[] = {
+ VI0_CLK_MARK,
+};
+/* - VIN1 ------------------------------------------------------------------- */
+static const union vin_data vin1_data_pins = {
+ .data12 = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
+ RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
+ RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
+ RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
+ RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+ },
+};
+static const union vin_data vin1_data_mux = {
+ .data12 = {
+ VI1_DATA0_MARK, VI1_DATA1_MARK,
+ VI1_DATA2_MARK, VI1_DATA3_MARK,
+ VI1_DATA4_MARK, VI1_DATA5_MARK,
+ VI1_DATA6_MARK, VI1_DATA7_MARK,
+ VI1_DATA8_MARK, VI1_DATA9_MARK,
+ VI1_DATA10_MARK, VI1_DATA11_MARK,
+ },
+};
+static const unsigned int vin1_sync_pins[] = {
+ RCAR_GP_PIN(5, 22), /* HSYNC */
+ RCAR_GP_PIN(5, 23), /* VSYNC */
+};
+static const unsigned int vin1_sync_mux[] = {
+ VI1_HSYNC_N_MARK,
+ VI1_VSYNC_N_MARK,
+};
+static const unsigned int vin1_field_pins[] = {
+ RCAR_GP_PIN(5, 21),
+};
+static const unsigned int vin1_field_mux[] = {
+ VI1_FIELD_MARK,
+};
+static const unsigned int vin1_clkenb_pins[] = {
+ RCAR_GP_PIN(5, 20),
+};
+static const unsigned int vin1_clkenb_mux[] = {
+ VI1_CLKENB_MARK,
+};
+static const unsigned int vin1_clk_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int vin1_clk_mux[] = {
+ VI1_CLK_MARK,
+};
static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(eth_link),
@@ -2949,6 +3089,24 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(sdhi2_wp),
SH_PFC_PIN_GROUP(usb0),
SH_PFC_PIN_GROUP(usb1),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+ VIN_DATA_PIN_GROUP(vin0_data, 20),
+ SH_PFC_PIN_GROUP(vin0_data18),
+ VIN_DATA_PIN_GROUP(vin0_data, 16),
+ VIN_DATA_PIN_GROUP(vin0_data, 12),
+ VIN_DATA_PIN_GROUP(vin0_data, 10),
+ VIN_DATA_PIN_GROUP(vin0_data, 8),
+ SH_PFC_PIN_GROUP(vin0_sync),
+ SH_PFC_PIN_GROUP(vin0_field),
+ SH_PFC_PIN_GROUP(vin0_clkenb),
+ SH_PFC_PIN_GROUP(vin0_clk),
+ VIN_DATA_PIN_GROUP(vin1_data, 12),
+ VIN_DATA_PIN_GROUP(vin1_data, 10),
+ VIN_DATA_PIN_GROUP(vin1_data, 8),
+ SH_PFC_PIN_GROUP(vin1_sync),
+ SH_PFC_PIN_GROUP(vin1_field),
+ SH_PFC_PIN_GROUP(vin1_clkenb),
+ SH_PFC_PIN_GROUP(vin1_clk),
};
static const char * const eth_groups[] = {
@@ -3229,6 +3387,30 @@ static const char * const usb1_groups[]
"usb1",
};
+static const char * const vin0_groups[] = {
+ "vin0_data24",
+ "vin0_data20",
+ "vin0_data18",
+ "vin0_data16",
+ "vin0_data12",
+ "vin0_data10",
+ "vin0_data8",
+ "vin0_sync",
+ "vin0_field",
+ "vin0_clkenb",
+ "vin0_clk",
+};
+
+static const char * const vin1_groups[] = {
+ "vin1_data12",
+ "vin1_data10",
+ "vin1_data8",
+ "vin1_sync",
+ "vin1_field",
+ "vin1_clkenb",
+ "vin1_clk",
+};
+
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(eth),
SH_PFC_FUNCTION(hscif0),
@@ -3265,6 +3447,8 @@ static const struct sh_pfc_function pinm
SH_PFC_FUNCTION(sdhi2),
SH_PFC_FUNCTION(usb0),
SH_PFC_FUNCTION(usb1),
+ SH_PFC_FUNCTION(vin0),
+ SH_PFC_FUNCTION(vin1),
};
static const struct pinmux_cfg_reg pinmux_config_regs[] = {
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (8 preceding siblings ...)
2015-10-02 23:21 ` [PATCH v4] pinctrl: sh-pfc: r8a7794: add VIN pin groups Sergei Shtylyov
@ 2015-12-02 20:11 ` Sergei Shtylyov
2015-12-08 12:12 ` Geert Uytterhoeven
2015-12-14 22:06 ` [PATCH v2] " Sergei Shtylyov
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-12-02 20:11 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio
Add the EtherAVB pin groups to the R8A7791 PFC driver.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 92 +++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -1740,6 +1740,82 @@ static const unsigned int audio_clkout_m
AUDIO_CLKOUT_MARK,
};
+/* - AVB -------------------------------------------------------------------- */
+static const unsigned int avb_link_pins[] = {
+ RCAR_GP_PIN(5, 14),
+};
+static const unsigned int avb_link_mux[] = {
+ AVB_LINK_MARK,
+};
+static const unsigned int avb_magic_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int avb_magic_mux[] = {
+ AVB_MAGIC_MARK,
+};
+static const unsigned int avb_phy_int_pins[] = {
+ RCAR_GP_PIN(5, 16),
+};
+static const unsigned int avb_phy_int_mux[] = {
+ AVB_PHY_INT_MARK,
+};
+static const unsigned int avb_mdio_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 9),
+};
+static const unsigned int avb_mdio_mux[] = {
+ AVB_MDC_MARK, AVB_MDIO_MARK,
+};
+static const unsigned int avb_mii_pins[] = {
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
+ RCAR_GP_PIN(5, 21),
+
+ RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+ RCAR_GP_PIN(5, 3),
+
+ RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
+ RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 28),
+ RCAR_GP_PIN(5, 29),
+};
+static const unsigned int avb_mii_mux[] = {
+ AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+ AVB_TXD3_MARK,
+
+ AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+ AVB_RXD3_MARK,
+
+ AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+ AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_CLK_MARK,
+ AVB_COL_MARK,
+};
+static const unsigned int avb_gmii_pins[] = {
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
+ RCAR_GP_PIN(5, 21), RCAR_GP_PIN(5, 22), RCAR_GP_PIN(5, 23),
+ RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
+
+ RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+ RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5),
+ RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 7),
+
+ RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
+ RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 30), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27), RCAR_GP_PIN(5, 28),
+ RCAR_GP_PIN(5, 29),
+};
+static const unsigned int avb_gmii_mux[] = {
+ AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+ AVB_TXD3_MARK, AVB_TXD4_MARK, AVB_TXD5_MARK,
+ AVB_TXD6_MARK, AVB_TXD7_MARK,
+
+ AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+ AVB_RXD3_MARK, AVB_RXD4_MARK, AVB_RXD5_MARK,
+ AVB_RXD6_MARK, AVB_RXD7_MARK,
+
+ AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+ AVB_CRS_MARK, AVB_GTX_CLK_MARK, AVB_GTXREFCLK_MARK,
+ AVB_TX_EN_MARK, AVB_TX_ER_MARK, AVB_TX_CLK_MARK,
+ AVB_COL_MARK,
+};
+
/* - CAN -------------------------------------------------------------------- */
static const unsigned int can0_data_pins[] = {
@@ -4258,6 +4334,12 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(audio_clk_b_b),
SH_PFC_PIN_GROUP(audio_clk_c),
SH_PFC_PIN_GROUP(audio_clkout),
+ SH_PFC_PIN_GROUP(avb_link),
+ SH_PFC_PIN_GROUP(avb_magic),
+ SH_PFC_PIN_GROUP(avb_phy_int),
+ SH_PFC_PIN_GROUP(avb_mdio),
+ SH_PFC_PIN_GROUP(avb_mii),
+ SH_PFC_PIN_GROUP(avb_gmii),
SH_PFC_PIN_GROUP(can0_data),
SH_PFC_PIN_GROUP(can0_data_b),
SH_PFC_PIN_GROUP(can0_data_c),
@@ -4597,6 +4679,15 @@ static const char * const audio_clk_grou
"audio_clkout",
};
+static const char * const avb_groups[] = {
+ "avb_link",
+ "avb_magic",
+ "avb_phy_int",
+ "avb_mdio",
+ "avb_mii",
+ "avb_gmii",
+};
+
static const char * const can0_groups[] = {
"can0_data",
"can0_data_b",
@@ -5081,6 +5172,7 @@ static const char * const vin2_groups[]
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(audio_clk),
+ SH_PFC_FUNCTION(avb),
SH_PFC_FUNCTION(can0),
SH_PFC_FUNCTION(can1),
SH_PFC_FUNCTION(du),
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-02 20:11 ` [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB " Sergei Shtylyov
@ 2015-12-08 12:12 ` Geert Uytterhoeven
2015-12-08 12:30 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-12-08 12:12 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hi Sergei,
On Wed, Dec 2, 2015 at 9:11 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Add the EtherAVB pin groups to the R8A7791 PFC driver.
Thanks for your patch!
> +static const unsigned int avb_mii_pins[] = {
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
> + RCAR_GP_PIN(5, 21),
> +
> + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
> + RCAR_GP_PIN(5, 3),
> +
> + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
> + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 28),
> + RCAR_GP_PIN(5, 29),
> +};
> +static const unsigned int avb_mii_mux[] = {
> + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
> + AVB_TXD3_MARK,
> +
> + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
> + AVB_RXD3_MARK,
> +
> + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
> + AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_CLK_MARK,
> + AVB_COL_MARK,
> +};
The MII pin list include RX_ER, but not TX_ER...
> +static const unsigned int avb_gmii_pins[] = {
> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
> + RCAR_GP_PIN(5, 21), RCAR_GP_PIN(5, 22), RCAR_GP_PIN(5, 23),
> + RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
> +
> + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
> + RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5),
> + RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 7),
> +
> + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
> + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 30), RCAR_GP_PIN(5, 17),
> + RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27), RCAR_GP_PIN(5, 28),
> + RCAR_GP_PIN(5, 29),
> +};
> +static const unsigned int avb_gmii_mux[] = {
> + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
> + AVB_TXD3_MARK, AVB_TXD4_MARK, AVB_TXD5_MARK,
> + AVB_TXD6_MARK, AVB_TXD7_MARK,
> +
> + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
> + AVB_RXD3_MARK, AVB_RXD4_MARK, AVB_RXD5_MARK,
> + AVB_RXD6_MARK, AVB_RXD7_MARK,
> +
> + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
> + AVB_CRS_MARK, AVB_GTX_CLK_MARK, AVB_GTXREFCLK_MARK,
> + AVB_TX_EN_MARK, AVB_TX_ER_MARK, AVB_TX_CLK_MARK,
> + AVB_COL_MARK,
> +};
... while the GMII pin list includes both RX_ER and TX_ER. Is that correct?
Should it be the other way around?
Section "45A.3.13.1 MII Frame Transmission/Reception Timing" of the R-Car Gen2
datasheet shows timing diagrams for both AVB_TX_ER and AVB_RX_ER, so I'd expect
both pins to be needed for MII.
Unfortunately Section "45A.3.13.2 GMII Frame Reception Timing" shows timing
diagrams for receive only (thus involving AVB_RX_ER only), so I'm not sure the
AVB_TX_ER pin is actually needed for GMII.
I don't have schematics for any R-Car Gen2 board that has AVB support, so I
can't check myself how the MII/GMII is really wired.
Note that this also applies to the existing AVB pinmux data in pfc-r8a7790.c.
Can you please check/clarify? I'm not an Ethernet PHY expert.
Thanks again!
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] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-08 12:12 ` Geert Uytterhoeven
@ 2015-12-08 12:30 ` Sergei Shtylyov
2015-12-08 13:06 ` Geert Uytterhoeven
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-12-08 12:30 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hello.
On 12/8/2015 3:12 PM, Geert Uytterhoeven wrote:
>> Add the EtherAVB pin groups to the R8A7791 PFC driver.
>
> Thanks for your patch!
>
>> +static const unsigned int avb_mii_pins[] = {
>> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
>> + RCAR_GP_PIN(5, 21),
>> +
>> + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
>> + RCAR_GP_PIN(5, 3),
>> +
>> + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
>> + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 28),
>> + RCAR_GP_PIN(5, 29),
>> +};
>> +static const unsigned int avb_mii_mux[] = {
>> + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
>> + AVB_TXD3_MARK,
>> +
>> + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
>> + AVB_RXD3_MARK,
>> +
>> + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
>> + AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_CLK_MARK,
>> + AVB_COL_MARK,
>> +};
>
> The MII pin list include RX_ER, but not TX_ER...
Wikipedia tells me TX_ER is optional for MII.
> ... while the GMII pin list includes both RX_ER and TX_ER. Is that correct?
> Should it be the other way around?
>
> Section "45A.3.13.1 MII Frame Transmission/Reception Timing" of the R-Car Gen2
> datasheet shows timing diagrams for both AVB_TX_ER and AVB_RX_ER, so I'd expect
> both pins to be needed for MII.
Hm, interesting...
> Unfortunately Section "45A.3.13.2 GMII Frame Reception Timing" shows timing
> diagrams for receive only (thus involving AVB_RX_ER only), so I'm not sure the
> AVB_TX_ER pin is actually needed for GMII.
It is.
> I don't have schematics for any R-Car Gen2 board that has AVB support, so I
> can't check myself how the MII/GMII is really wired.
The standard Lager/Porter boards require some modification to use an an
AVB daughter board, AFAIK.
> Note that this also applies to the existing AVB pinmux data in pfc-r8a7790.c.
And we haven't really tested MII, only GMII.
[...]
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-08 12:30 ` Sergei Shtylyov
@ 2015-12-08 13:06 ` Geert Uytterhoeven
2015-12-08 13:41 ` Sergei Shtylyov
0 siblings, 1 reply; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-12-08 13:06 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
Hi Sergei,
On Tue, Dec 8, 2015 at 1:30 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 12/8/2015 3:12 PM, Geert Uytterhoeven wrote:
>>> Add the EtherAVB pin groups to the R8A7791 PFC driver.
>>
>> Thanks for your patch!
>>
>>> +static const unsigned int avb_mii_pins[] = {
>>> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
>>> + RCAR_GP_PIN(5, 21),
>>> +
>>> + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
>>> + RCAR_GP_PIN(5, 3),
>>> +
>>> + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
>>> + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 28),
>>> + RCAR_GP_PIN(5, 29),
>>> +};
>>> +static const unsigned int avb_mii_mux[] = {
>>> + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
>>> + AVB_TXD3_MARK,
>>> +
>>> + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
>>> + AVB_RXD3_MARK,
>>> +
>>> + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
>>> + AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_CLK_MARK,
>>> + AVB_COL_MARK,
>>> +};
>>
>> The MII pin list include RX_ER, but not TX_ER...
>
> Wikipedia tells me TX_ER is optional for MII.
OK. So it may make sense to have a separate pinmux group for it.
BTW, I've just noticed the R-Car Gen2 sh_eth Ethernet (which does 10/100 only)
doesn't have the pin.
>> ... while the GMII pin list includes both RX_ER and TX_ER. Is that
>> correct?
>> Should it be the other way around?
>>
>> Section "45A.3.13.1 MII Frame Transmission/Reception Timing" of the R-Car
>> Gen2
>> datasheet shows timing diagrams for both AVB_TX_ER and AVB_RX_ER, so I'd
>> expect
>> both pins to be needed for MII.
>
>
> Hm, interesting...
>
>> Unfortunately Section "45A.3.13.2 GMII Frame Reception Timing" shows
>> timing
>> diagrams for receive only (thus involving AVB_RX_ER only), so I'm not sure
>> the
>> AVB_TX_ER pin is actually needed for GMII.
>
> It is.
OK.
>> I don't have schematics for any R-Car Gen2 board that has AVB support, so
>> I
>> can't check myself how the MII/GMII is really wired.
>
> The standard Lager/Porter boards require some modification to use an an
> AVB daughter board, AFAIK.
Do you have schematics for those?
>> Note that this also applies to the existing AVB pinmux data in
>> pfc-r8a7790.c.
>
> And we haven't really tested MII, only GMII.
So I guess the daughterboard uses both RX_ER and TX_ER?
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] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-08 13:06 ` Geert Uytterhoeven
@ 2015-12-08 13:41 ` Sergei Shtylyov
2015-12-08 13:50 ` Geert Uytterhoeven
0 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-12-08 13:41 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
On 12/08/2015 04:06 PM, Geert Uytterhoeven wrote:
>>>> Add the EtherAVB pin groups to the R8A7791 PFC driver.
>>>
>>> Thanks for your patch!
>>>
>>>> +static const unsigned int avb_mii_pins[] = {
>>>> + RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
>>>> + RCAR_GP_PIN(5, 21),
>>>> +
>>>> + RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
>>>> + RCAR_GP_PIN(5, 3),
>>>> +
>>>> + RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
>>>> + RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 28),
>>>> + RCAR_GP_PIN(5, 29),
>>>> +};
>>>> +static const unsigned int avb_mii_mux[] = {
>>>> + AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
>>>> + AVB_TXD3_MARK,
>>>> +
>>>> + AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
>>>> + AVB_RXD3_MARK,
>>>> +
>>>> + AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
>>>> + AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_CLK_MARK,
>>>> + AVB_COL_MARK,
>>>> +};
>>>
>>> The MII pin list include RX_ER, but not TX_ER...
>>
>> Wikipedia tells me TX_ER is optional for MII.
>
> OK. So it may make sense to have a separate pinmux group for it.
Hm... since this is MAC-to-PHY signal, I'd prefer just adding it to the
MII group... but you may have a point here.
> BTW, I've just noticed the R-Car Gen2 sh_eth Ethernet (which does 10/100 only)
> doesn't have the pin.
Th EtherMAC only support RMII which doesn't have this signal at all.
>>> ... while the GMII pin list includes both RX_ER and TX_ER. Is that
>>> correct?
>>> Should it be the other way around?
>>>
>>> Section "45A.3.13.1 MII Frame Transmission/Reception Timing" of the R-Car
>>> Gen2
>>> datasheet shows timing diagrams for both AVB_TX_ER and AVB_RX_ER, so I'd
>>> expect
>>> both pins to be needed for MII.
>> Hm, interesting...
>>> I don't have schematics for any R-Car Gen2 board that has AVB support, so
>>> I
>>> can't check myself how the MII/GMII is really wired.
>>
>> The standard Lager/Porter boards require some modification to use an an
>> AVB daughter board, AFAIK.
>
> Do you have schematics for those?
Daughterboards, you mean? Yes. There are 2 of them, one with Gigabit PHY,
the other with 100 Mbit one (I don't have that one and haven't tested it).
>>> Note that this also applies to the existing AVB pinmux data in
>>> pfc-r8a7790.c.
>>
>> And we haven't really tested MII, only GMII.
>
> So I guess the daughterboard uses both RX_ER and TX_ER?
Yes, for the one with Gigabit PHY and no, for the one with 100 Mbit (that
one doesn't even seem to have RX_ER connected to anything).
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergei
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-08 13:41 ` Sergei Shtylyov
@ 2015-12-08 13:50 ` Geert Uytterhoeven
0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-12-08 13:50 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
On Tue, Dec 8, 2015 at 2:41 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
>> So I guess the daughterboard uses both RX_ER and TX_ER?
>
> Yes, for the one with Gigabit PHY and no, for the one with 100 Mbit (that
> one doesn't even seem to have RX_ER connected to anything).
Which means the pin could be used for something else, modulo the fact that
it's part of the avb_mii group, and thus configured for avb...
Thanks for checking!
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] 32+ messages in thread
* [PATCH v2] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-08-18 22:25 [PATCH 0/2] Add Renesas R8A7794 USB/VIN PFC support Sergei Shtylyov
` (9 preceding siblings ...)
2015-12-02 20:11 ` [PATCH] pinctrl: sh-pfc: r8a7791: add EtherAVB " Sergei Shtylyov
@ 2015-12-14 22:06 ` Sergei Shtylyov
2015-12-16 10:27 ` Geert Uytterhoeven
10 siblings, 1 reply; 32+ messages in thread
From: Sergei Shtylyov @ 2015-12-14 22:06 UTC (permalink / raw)
To: linus.walleij, linux-sh, laurent.pinchart, linux-gpio, geert
Add the EtherAVB pin groups to the R8A7791 PFC driver.
Also add the copyright for all the Cogent Embedded's past work on this file.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
Changes in version 2:
- added AVB_TX_ER pin to the AVB MII group;
- added Cogent Embedded's copyright;
- refreshed the patch.
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 93 +++++++++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -2,6 +2,7 @@
* r8a7791 processor support - PFC hardware block.
*
* Copyright (C) 2013 Renesas Electronics Corporation
+ * Copyright (C) 2014-2015 Cogent Embedded, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -1725,6 +1726,82 @@ static const unsigned int audio_clkout_m
AUDIO_CLKOUT_MARK,
};
+/* - AVB -------------------------------------------------------------------- */
+static const unsigned int avb_link_pins[] = {
+ RCAR_GP_PIN(5, 14),
+};
+static const unsigned int avb_link_mux[] = {
+ AVB_LINK_MARK,
+};
+static const unsigned int avb_magic_pins[] = {
+ RCAR_GP_PIN(5, 11),
+};
+static const unsigned int avb_magic_mux[] = {
+ AVB_MAGIC_MARK,
+};
+static const unsigned int avb_phy_int_pins[] = {
+ RCAR_GP_PIN(5, 16),
+};
+static const unsigned int avb_phy_int_mux[] = {
+ AVB_PHY_INT_MARK,
+};
+static const unsigned int avb_mdio_pins[] = {
+ RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 9),
+};
+static const unsigned int avb_mdio_mux[] = {
+ AVB_MDC_MARK, AVB_MDIO_MARK,
+};
+static const unsigned int avb_mii_pins[] = {
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
+ RCAR_GP_PIN(5, 21),
+
+ RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+ RCAR_GP_PIN(5, 3),
+
+ RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
+ RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27),
+ RCAR_GP_PIN(5, 28), RCAR_GP_PIN(5, 29),
+};
+static const unsigned int avb_mii_mux[] = {
+ AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+ AVB_TXD3_MARK,
+
+ AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+ AVB_RXD3_MARK,
+
+ AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+ AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_ER_MARK,
+ AVB_TX_CLK_MARK, AVB_COL_MARK,
+};
+static const unsigned int avb_gmii_pins[] = {
+ RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
+ RCAR_GP_PIN(5, 21), RCAR_GP_PIN(5, 22), RCAR_GP_PIN(5, 23),
+ RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
+
+ RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+ RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 5),
+ RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 7),
+
+ RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 10),
+ RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 30), RCAR_GP_PIN(5, 17),
+ RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27), RCAR_GP_PIN(5, 28),
+ RCAR_GP_PIN(5, 29),
+};
+static const unsigned int avb_gmii_mux[] = {
+ AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+ AVB_TXD3_MARK, AVB_TXD4_MARK, AVB_TXD5_MARK,
+ AVB_TXD6_MARK, AVB_TXD7_MARK,
+
+ AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+ AVB_RXD3_MARK, AVB_RXD4_MARK, AVB_RXD5_MARK,
+ AVB_RXD6_MARK, AVB_RXD7_MARK,
+
+ AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+ AVB_CRS_MARK, AVB_GTX_CLK_MARK, AVB_GTXREFCLK_MARK,
+ AVB_TX_EN_MARK, AVB_TX_ER_MARK, AVB_TX_CLK_MARK,
+ AVB_COL_MARK,
+};
+
/* - CAN -------------------------------------------------------------------- */
static const unsigned int can0_data_pins[] = {
@@ -4260,6 +4337,12 @@ static const struct sh_pfc_pin_group pin
SH_PFC_PIN_GROUP(audio_clk_b_b),
SH_PFC_PIN_GROUP(audio_clk_c),
SH_PFC_PIN_GROUP(audio_clkout),
+ SH_PFC_PIN_GROUP(avb_link),
+ SH_PFC_PIN_GROUP(avb_magic),
+ SH_PFC_PIN_GROUP(avb_phy_int),
+ SH_PFC_PIN_GROUP(avb_mdio),
+ SH_PFC_PIN_GROUP(avb_mii),
+ SH_PFC_PIN_GROUP(avb_gmii),
SH_PFC_PIN_GROUP(can0_data),
SH_PFC_PIN_GROUP(can0_data_b),
SH_PFC_PIN_GROUP(can0_data_c),
@@ -4601,6 +4684,15 @@ static const char * const audio_clk_grou
"audio_clkout",
};
+static const char * const avb_groups[] = {
+ "avb_link",
+ "avb_magic",
+ "avb_phy_int",
+ "avb_mdio",
+ "avb_mii",
+ "avb_gmii",
+};
+
static const char * const can0_groups[] = {
"can0_data",
"can0_data_b",
@@ -5090,6 +5182,7 @@ static const char * const vin2_groups[]
static const struct sh_pfc_function pinmux_functions[] = {
SH_PFC_FUNCTION(audio_clk),
+ SH_PFC_FUNCTION(avb),
SH_PFC_FUNCTION(can0),
SH_PFC_FUNCTION(can1),
SH_PFC_FUNCTION(du),
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v2] pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups
2015-12-14 22:06 ` [PATCH v2] " Sergei Shtylyov
@ 2015-12-16 10:27 ` Geert Uytterhoeven
0 siblings, 0 replies; 32+ messages in thread
From: Geert Uytterhoeven @ 2015-12-16 10:27 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Linus Walleij, Linux-sh list, Laurent Pinchart,
linux-gpio@vger.kernel.org
On Mon, Dec 14, 2015 at 11:06 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Add the EtherAVB pin groups to the R8A7791 PFC driver.
>
> Also add the copyright for all the Cogent Embedded's past work on this file.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thank you, queued for v4.5.
> ---
> The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo.
>
> Changes in version 2:
> - added AVB_TX_ER pin to the AVB MII group;
> - added Cogent Embedded's copyright;
> - refreshed the patch.
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] 32+ messages in thread