All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v3] pinctrl: sh-pfc: r8a7791: add R8A7743 support
Date: Thu, 20 Apr 2017 13:33:57 +0200	[thread overview]
Message-ID: <CAMuHMdXxf3qq3G=8ubmt=1a6h6FG3wKRtCXHNqUYfnqyy=y4LA@mail.gmail.com> (raw)
In-Reply-To: <20170413201346.358012116@cogentembedded.com>

Hi Sergei,

On Thu, Apr 13, 2017 at 10:13 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Renesas RZ/G1M (R8A7743) is pin compatible with R-Car M2-W/N (R8A7791/3),
> however it doesn't have several automotive specific peripherals. Annotate
> all the items that only exist on the R-Car SoCs and only supply  the pin
> groups/functions existing on a given SoC...
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> This patch is against the 'devel' branch of Linus Walleij's 'linux-pinctrl.git'
> repo plus  4  R8A7791 PFC fixes and the "grand I2C rename" patch...
>
> Changes in version 3:
> - updated the PFC bindings.
>
> Changes in version 2:
> - switch to supplying exactly the groups/functions existing on a given SoC,
>   update the patch descriptions accordingly;
> - resolved rejects due to the "grand I2C rename" patch being updated.

Thanks for the update!

> --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
> +++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c

> @@ -129,11 +129,12 @@ enum {
>         FN_A9, FN_MSIOF1_SS2, FN_I2C0_SDA,
>         FN_A10, FN_MSIOF1_TXD, FN_MSIOF1_TXD_D,
>         FN_A11, FN_MSIOF1_RXD, FN_I2C3_SCL_D, FN_MSIOF1_RXD_D,
> -       FN_A12, FN_FMCLK, FN_I2C3_SDA_D, FN_MSIOF1_SCK_D,
> -       FN_A13, FN_ATAG0_N_C, FN_BPFCLK, FN_MSIOF1_SS1_D,
> -       FN_A14, FN_ATADIR0_N_C, FN_FMIN, FN_FMIN_C, FN_MSIOF1_SYNC_D,
> -       FN_A15, FN_BPFCLK_C,
> -       FN_A16, FN_DREQ2_B, FN_FMCLK_C, FN_SCIFA1_SCK_B,
> +       FN_A12, FN_FMCLK /* R8A779x only */, FN_I2C3_SDA_D, FN_MSIOF1_SCK_D,
> +       FN_A13, FN_ATAG0_N_C, FN_BPFCLK /* R8A779x only */, FN_MSIOF1_SS1_D,
> +       FN_A14, FN_ATADIR0_N_C, FN_FMIN /* R8A779x only */,
> +       FN_FMIN_C /* R8A779x only */, FN_MSIOF1_SYNC_D,
> +       FN_A15, FN_BPFCLK_C /* R8A779x only */,
> +       FN_A16, FN_DREQ2_B, FN_FMCLK_C /* R8A779x only */, FN_SCIFA1_SCK_B,

I still have mixed feelings about adding all these annotations.
IMHO the groups and functions provide sufficient documentation, and not adding
the annotations means less code has to be changed now, and perhaps in the
future.

More about that in the r8a7794 patch...

> @@ -4419,359 +4506,367 @@ static const unsigned int vin2_clk_mux[]
>         VI2_CLK_MARK,
>  };
>
> -static const struct sh_pfc_pin_group pinmux_groups[] = {
> -       SH_PFC_PIN_GROUP(adi_common),
> -       SH_PFC_PIN_GROUP(adi_chsel0),

[...]

> -       SH_PFC_PIN_GROUP(vin2_clkenb),
> -       SH_PFC_PIN_GROUP(vin2_clk),
> +static const struct {
> +       struct sh_pfc_pin_group common[341];
> +       struct sh_pfc_pin_group r8a779x[9];
> +} pinmux_groups = {

Thanks, that's exactly what I had in mind!

> +       .common = {
> +               SH_PFC_PIN_GROUP(audio_clk_a),
> +               SH_PFC_PIN_GROUP(audio_clk_b),

[...]

> +               SH_PFC_PIN_GROUP(i2c4),
> +               SH_PFC_PIN_GROUP(i2c4_b),
> +               SH_PFC_PIN_GROUP(i2c4_c),
> +               SH_PFC_PIN_GROUP(i2c8),
> +               SH_PFC_PIN_GROUP(i2c8_b),
> +               SH_PFC_PIN_GROUP(i2c8_c),

What happened to i2c7? (revealed by "git show -b").

> +               SH_PFC_PIN_GROUP(i2c8),
> +               SH_PFC_PIN_GROUP(i2c8_b),
> +               SH_PFC_PIN_GROUP(i2c8_c),

[...]

> +               SH_PFC_PIN_GROUP(vin2_clkenb),
> +               SH_PFC_PIN_GROUP(vin2_clk),
> +       },
> +       .r8a779x = {
> +               SH_PFC_PIN_GROUP(adi_common),
> +               SH_PFC_PIN_GROUP(adi_chsel0),
> +               SH_PFC_PIN_GROUP(adi_chsel1),
> +               SH_PFC_PIN_GROUP(adi_chsel2),
> +               SH_PFC_PIN_GROUP(adi_common_b),
> +               SH_PFC_PIN_GROUP(adi_chsel0_b),
> +               SH_PFC_PIN_GROUP(adi_chsel1_b),
> +               SH_PFC_PIN_GROUP(adi_chsel2_b),
> +               SH_PFC_PIN_GROUP(mlb_3pin),
> +       }

Given the relatively small additional set of data needed to support
r8a779[13], it's probably not worth protecting it with #if
defined(CONFIG_PINCTRL_PFC_R8A7791) || defined(CONFIG_PINCTRL_PFC_R8A7793).

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

      parent reply	other threads:[~2017-04-20 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13 20:13 [PATCH v3] pinctrl: sh-pfc: r8a7791: add R8A7743 support Sergei Shtylyov
2017-04-19 22:36 ` Rob Herring
2017-04-20 11:33 ` Geert Uytterhoeven [this message]

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='CAMuHMdXxf3qq3G=8ubmt=1a6h6FG3wKRtCXHNqUYfnqyy=y4LA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.