Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: jacopo mondi <jacopo@jmondi.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Simon Horman" <horms@verge.net.au>,
	"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Magnus Damm" <damm+renesas@opensource.se>,
	"Ulrich Hecht" <ulrich.hecht+renesas@gmail.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v2 5/8] pinctrl: sh-pfc: r8a77990: Add VIN pins, groups and functions
Date: Fri, 19 Oct 2018 18:55:44 +0200	[thread overview]
Message-ID: <20181019165544.GH11703@w540> (raw)
In-Reply-To: <CAMuHMdV1NKag-1KWFuWwgxgj+HDG-kB0F7L-WDVM+1E4-RncRw@mail.gmail.com>

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

Hi Geert, Simon,
   sorry to resurect this one, but while upporting VIN pin definition
for R8A77965 I have noticed something in this patch.

Please see below.

On Tue, Oct 02, 2018 at 11:25:31AM +0200, Geert Uytterhoeven wrote:
> Hi Jacopo,

[snip]

> > @@ -1889,6 +2077,32 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
> >         SH_PFC_PIN_GROUP(usb0_id),
> >         SH_PFC_PIN_GROUP(usb30),
> >         SH_PFC_PIN_GROUP(usb30_id),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 8),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 10),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 12),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 16),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 20),
> > +       VIN_DATA_PIN_GROUP(vin4_data_a, 24),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 8),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 10),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 12),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 16),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 20),
> > +       VIN_DATA_PIN_GROUP(vin4_data_b, 24),

look here...

[snip]

> >
> > +static const char * const vin4_groups[] = {
> > +       "vin4_data8_a",
> > +       "vin4_data10_a",
> > +       "vin4_data12_a",
> > +       "vin4_data16_a",
> > +       "vin4_data20_a",
> > +       "vin4_data24_a",
> > +       "vin4_data8_b",
> > +       "vin4_data10_b",
> > +       "vin4_data12_b",
> > +       "vin4_data16_b",
> > +       "vin4_data20_b",
> > +       "vin4_data24_b",

Then here.

VIN_DATA_PIN_GROUP() expands as:

#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),	\
	}

So these groups should not be named
        "vin4_dataX_a" and
        "vin4_dataX_b"

But instead
        "vin4_data_aX" and
        "vin4_data_bX"

Am I wrong?

The only Gen3 SoC in mainline which uses the VIN data pins defined
through this macro is D3, which fortunately does not have any 'a' or
'b' group.

$ git grep vin\.*_data* arch/arm64/boot/dts/
arch/arm64/boot/dts/renesas/r8a77995-draak.dts:        groups =  "vin4_data8", "vin4_sync", "vin4_clk";

$ cat drivers/pinctrl/sh-pfc/pfc-r8a77995.c | grep "vin4_data, 8"
        VIN_DATA_PIN_GROUP(vin4_data, 8),

Going forward we might see some user of vin data groups having to
refer to "vin4_data_a8" and so on, which is not nice compared to
"vin4_data8_a".

What do you think?
In any case, this patch is indeed wrong. Or we align the group names
to what the macro produces, or change the macro, but I cannot tell how
to do that in a sane way? (introduce a new one that wants a 'group'
argument too?)

Thanks
  j

> > +       "vin4_data8_sft8",
>
> You dropped the sft8 pins, but forgot to remove the sft8 group name.
>
> > +       "vin4_sync",
> > +       "vin4_field",
> > +       "vin4_clkenb",
> > +       "vin4_clk",
> > +};
> > +
> > +static const char * const vin5_groups[] = {
> > +       "vin5_data8_a",
> > +       "vin5_data8_sft8_a",
>
> Likewise.
>
> > +       "vin5_data10_a",
> > +       "vin5_data12_a",
> > +       "vin5_data16_a",
> > +       "vin5_data8_b",
> > +       "vin5_sync_a",
> > +       "vin5_field_a",
> > +       "vin5_clkenb_a",
> > +       "vin5_clk_a",
> > +       "vin5_clk_b",
> > +};
>
> The rest looks OK to me, and matches the datasheet clarification.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

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

  reply	other threads:[~2018-10-20  1:02 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 15:29 [PATCH/RFT v2 0/8] arm64: dts: renesas: Ebisu: Add HDMI and CVBS input Jacopo Mondi
2018-09-05 15:29 ` [PATCH v2 1/8] media: dt-bindings: rcar-vin: Add R8A77990 support Jacopo Mondi
2018-09-10 12:42   ` Simon Horman
2018-09-10 13:58   ` Laurent Pinchart
2018-09-10 18:15   ` Niklas Söderlund
2018-09-05 15:29 ` [PATCH v2 2/8] media: rcar-vin: Add support for R-Car R8A77990 Jacopo Mondi
2018-09-10 14:02   ` Laurent Pinchart
2018-09-10 18:18   ` Niklas Söderlund
2018-09-05 15:29 ` [PATCH v2 3/8] media: dt-bindings: rcar-csi2: Add R8A77990 Jacopo Mondi
2018-09-10 12:45   ` Simon Horman
2018-09-10 14:04   ` Laurent Pinchart
2018-09-10 18:19   ` Niklas Söderlund
2018-09-05 15:29 ` [PATCH v2 4/8] media: rcar-csi2: Add R8A77990 support Jacopo Mondi
2018-09-10 14:05   ` Laurent Pinchart
2018-09-10 18:20   ` Niklas Söderlund
2018-09-05 15:29 ` [PATCH v2 5/8] pinctrl: sh-pfc: r8a77990: Add VIN pins, groups and functions Jacopo Mondi
2018-09-10 13:01   ` Simon Horman
2018-09-11  7:44     ` jacopo mondi
2018-09-11  8:15       ` Geert Uytterhoeven
2018-09-11  8:54         ` jacopo mondi
2018-09-11  9:44       ` jacopo mondi
2018-09-28  7:46         ` jacopo mondi
2018-10-02  9:25   ` Geert Uytterhoeven
2018-10-19 16:55     ` jacopo mondi [this message]
2018-10-20 19:04       ` Geert Uytterhoeven
2018-09-05 15:29 ` [PATCH v2 6/8] arm64: dts: r8a77990: Add VIN and CSI-2 device nodes Jacopo Mondi
2018-09-06  9:10   ` Simon Horman
2018-09-06  9:16     ` Simon Horman
2018-09-10 14:12   ` Laurent Pinchart
2018-09-17 14:37     ` Laurent Pinchart
2018-10-30 10:14     ` jacopo mondi
2018-10-30 12:57       ` Laurent Pinchart
2018-10-31 12:48         ` Simon Horman
2018-10-31 13:18           ` jacopo mondi
2018-10-31 14:37             ` Simon Horman
2018-11-05 10:32               ` jacopo mondi
2018-11-06 14:02                 ` Simon Horman
2018-09-05 15:29 ` [PATCH v2 7/8] arm64: dts: r8a77990: Add I2C " Jacopo Mondi
2018-09-05 16:12   ` Laurent Pinchart
2018-09-06  9:12   ` Simon Horman
2018-09-05 15:29 ` [PATCH v2 8/8] arm64: dts: renesas: ebisu: Add HDMI and CVBS input Jacopo Mondi
2018-09-10 14:21   ` Laurent Pinchart
2018-09-12  9:29     ` Simon Horman
2018-09-12 11:08       ` jacopo mondi
2018-09-17  7:09         ` Simon Horman
2018-09-17 15:22 ` [PATCH/RFT v2 0/8] arm64: dts: renesas: Ebisu: " Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181019165544.GH11703@w540 \
    --to=jacopo@jmondi.org \
    --cc=damm+renesas@opensource.se \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=ulrich.hecht+renesas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox