diff mbox series

[v2,3/7] pinctrl: sh-pfc: r8a77965: Add HSCIF0 pins, groups, and functions

Message ID 20180812133149.7710-3-erosca@de.adit-jv.com (mailing list archive)
State Not Applicable
Delegated to: Geert Uytterhoeven
Headers show
Series [v2,1/7] dt-bindings: arm: Document Renesas R-Car M3-N-based ULCB board | expand

Commit Message

Eugeniu Rosca Aug. 12, 2018, 1:31 p.m. UTC
According to R-Car Gen3 HW manual Rev.1.00 Apr 2018, M3-N SoC implements
five (0..4) HSCIF channels, similar to H3, M3-W and E3.

The story behind this patch is tackling below dmesg warnings, which pop
up when booting M3NULCB Kingfisher board:

$ dmesg | grep sh-pfc
sh-pfc e6060000.pin-controller: r8a77965_pfc support registered
sh-pfc e6060000.pin-controller: function 'hscif0' not supported
sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
sh-pfc e6060000.pin-controller: function 'hscif0' not supported
sh-pfc e6060000.pin-controller: invalid function hscif0 in map table

To fix them, extract the HSCIF0 part from below v4.15-rc1 commits:
 - commit 7a362e3488cb ("pinctrl: sh-pfc: r8a7795: Add HSCIF pins, groups, and functions")
 - commit 0e4e4999aac1 ("pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions")

Note that `checkpatch --strict` throws several "CHECK: Please use a
blank line after function/struct/union/enum declarations", which are
ignored for the sake of staying in sync with the aforementioned commits.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---
Changes in v2:
 - Newly added.
 - IMHO mirroring the mentioned H3 and M3-W sh-pfc commits *entirely* is
   a better option to avoid work fragmentation, but I leave this
   decision to the maintainer.
---
 drivers/pinctrl/sh-pfc/pfc-r8a77965.c | 32 +++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Simon Horman Aug. 21, 2018, 1:29 p.m. UTC | #1
On Sun, Aug 12, 2018 at 03:31:45PM +0200, Eugeniu Rosca wrote:
> According to R-Car Gen3 HW manual Rev.1.00 Apr 2018, M3-N SoC implements
> five (0..4) HSCIF channels, similar to H3, M3-W and E3.
> 
> The story behind this patch is tackling below dmesg warnings, which pop
> up when booting M3NULCB Kingfisher board:
> 
> $ dmesg | grep sh-pfc
> sh-pfc e6060000.pin-controller: r8a77965_pfc support registered
> sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
> sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
> 
> To fix them, extract the HSCIF0 part from below v4.15-rc1 commits:
>  - commit 7a362e3488cb ("pinctrl: sh-pfc: r8a7795: Add HSCIF pins, groups, and functions")
>  - commit 0e4e4999aac1 ("pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions")
> 
> Note that `checkpatch --strict` throws several "CHECK: Please use a
> blank line after function/struct/union/enum declarations", which are
> ignored for the sake of staying in sync with the aforementioned commits.
> 
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Geert Uytterhoeven Aug. 27, 2018, 3:07 p.m. UTC | #2
Hi Eugeniu,

On Sun, Aug 12, 2018 at 3:33 PM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> According to R-Car Gen3 HW manual Rev.1.00 Apr 2018, M3-N SoC implements
> five (0..4) HSCIF channels, similar to H3, M3-W and E3.
>
> The story behind this patch is tackling below dmesg warnings, which pop
> up when booting M3NULCB Kingfisher board:
>
> $ dmesg | grep sh-pfc
> sh-pfc e6060000.pin-controller: r8a77965_pfc support registered
> sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
> sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
>
> To fix them, extract the HSCIF0 part from below v4.15-rc1 commits:
>  - commit 7a362e3488cb ("pinctrl: sh-pfc: r8a7795: Add HSCIF pins, groups, and functions")
>  - commit 0e4e4999aac1 ("pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions")
>
> Note that `checkpatch --strict` throws several "CHECK: Please use a
> blank line after function/struct/union/enum declarations", which are
> ignored for the sake of staying in sync with the aforementioned commits.
>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>

Thanks for your patch, but please see commit 7628fa811b8af571 ("pinctrl:
sh-pfc: r8a77965: Add HSCIF pins, groups, and functions") in v4.19-rc1.

Gr{oetje,eeting}s,

                        Geert
Eugeniu Rosca Aug. 27, 2018, 7:42 p.m. UTC | #3
Hi Geert,

On Mon, Aug 27, 2018 at 05:07:39PM +0200, Geert Uytterhoeven wrote:
> Hi Eugeniu,
> 
> On Sun, Aug 12, 2018 at 3:33 PM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> > According to R-Car Gen3 HW manual Rev.1.00 Apr 2018, M3-N SoC implements
> > five (0..4) HSCIF channels, similar to H3, M3-W and E3.
> >
> > The story behind this patch is tackling below dmesg warnings, which pop
> > up when booting M3NULCB Kingfisher board:
> >
> > $ dmesg | grep sh-pfc
> > sh-pfc e6060000.pin-controller: r8a77965_pfc support registered
> > sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> > sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
> > sh-pfc e6060000.pin-controller: function 'hscif0' not supported
> > sh-pfc e6060000.pin-controller: invalid function hscif0 in map table
> >
> > To fix them, extract the HSCIF0 part from below v4.15-rc1 commits:
> >  - commit 7a362e3488cb ("pinctrl: sh-pfc: r8a7795: Add HSCIF pins, groups, and functions")
> >  - commit 0e4e4999aac1 ("pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions")
> >
> > Note that `checkpatch --strict` throws several "CHECK: Please use a
> > blank line after function/struct/union/enum declarations", which are
> > ignored for the sake of staying in sync with the aforementioned commits.
> >
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> 
> Thanks for your patch, but please see commit 7628fa811b8af571 ("pinctrl:
> sh-pfc: r8a77965: Add HSCIF pins, groups, and functions") in v4.19-rc1.

Thanks for pointing out. Please, feel free to drop the patch. Its
purpose was to build a self-contained (no new compiler/dmesg
warnings/errors) patch series assuming v4.18.

> 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

Best regards,
Eugeniu.
diff mbox series

Patch

diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
index d2bbee656381..fe16d194f69b 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
@@ -1758,6 +1758,28 @@  static const unsigned int du_disp_mux[] = {
 	DU_DISP_MARK,
 };
 
+/* - HSCIF0 ----------------------------------------------------------------- */
+static const unsigned int hscif0_data_pins[] = {
+	/* RX, TX */
+	RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14),
+};
+static const unsigned int hscif0_data_mux[] = {
+	HRX0_MARK, HTX0_MARK,
+};
+static const unsigned int hscif0_clk_pins[] = {
+	/* SCK */
+	RCAR_GP_PIN(5, 12),
+};
+static const unsigned int hscif0_clk_mux[] = {
+	HSCK0_MARK,
+};
+static const unsigned int hscif0_ctrl_pins[] = {
+	/* RTS, CTS */
+	RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15),
+};
+static const unsigned int hscif0_ctrl_mux[] = {
+	HRTS0_N_MARK, HCTS0_N_MARK,
+};
 /* - I2C -------------------------------------------------------------------- */
 static const unsigned int i2c1_a_pins[] = {
 	/* SDA, SCL */
@@ -3169,6 +3191,9 @@  static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(du_oddf),
 	SH_PFC_PIN_GROUP(du_cde),
 	SH_PFC_PIN_GROUP(du_disp),
+	SH_PFC_PIN_GROUP(hscif0_data),
+	SH_PFC_PIN_GROUP(hscif0_clk),
+	SH_PFC_PIN_GROUP(hscif0_ctrl),
 	SH_PFC_PIN_GROUP(i2c1_a),
 	SH_PFC_PIN_GROUP(i2c1_b),
 	SH_PFC_PIN_GROUP(i2c2_a),
@@ -3379,6 +3404,12 @@  static const char * const du_groups[] = {
 	"du_disp",
 };
 
+static const char * const hscif0_groups[] = {
+	"hscif0_data",
+	"hscif0_clk",
+	"hscif0_ctrl",
+};
+
 static const char * const i2c1_groups[] = {
 	"i2c1_a",
 	"i2c1_b",
@@ -3651,6 +3682,7 @@  static const char * const usb30_groups[] = {
 static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(avb),
 	SH_PFC_FUNCTION(du),
+	SH_PFC_FUNCTION(hscif0),
 	SH_PFC_FUNCTION(i2c1),
 	SH_PFC_FUNCTION(i2c2),
 	SH_PFC_FUNCTION(i2c6),