All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings
@ 2017-07-11 12:38 Simon Horman
  2017-07-11 17:59 ` Geert Uytterhoeven
  2017-08-01  8:27 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2017-07-11 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Magnus Damm, linux-gpio, linux-renesas-soc, Simon Horman

Add fallback compatibility string for R-Car Gen 1, 2 and 3.

In the case of Renesas R-Car hardware we know that there are generations of
SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.

We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.

For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.

Also deprecate renesas,gpio-rcar as its name is more generic than its
implementation.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
Based on linux-gpio/for-next
---
 .../devicetree/bindings/gpio/renesas,gpio-rcar.txt        | 15 +++++++++++----
 drivers/gpio/gpio-rcar.c                                  | 10 ++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
index 6826a371fb69..48634b01f1bf 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
+++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
@@ -2,7 +2,7 @@
 
 Required Properties:
 
-  - compatible: should contain one of the following.
+  - compatible: should contain one or more of the following:
     - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
     - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
     - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
@@ -13,7 +13,14 @@ Required Properties:
     - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
     - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
     - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
-    - "renesas,gpio-rcar": for generic R-Car GPIO controller.
+    - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
+    - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
+    - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller.
+    - "renesas,gpio-rcar": deprecated.
+
+    When compatible with the generic version nodes must list the
+    SoC-specific version corresponding to the platform first followed by
+    the generic version.
 
   - reg: Base address and length of each memory resource used by the GPIO
     controller hardware module.
@@ -43,7 +50,7 @@ interrupt-controller/interrupts.txt.
 Example: R8A7779 (R-Car H1) GPIO controller nodes
 
 	gpio0: gpio@ffc40000 {
-		compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+		compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio";
 		reg = <0xffc40000 0x2c>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 141 0x4>;
@@ -55,7 +62,7 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes
 	};
 	...
 	gpio6: gpio@ffc46000 {
-		compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar";
+		compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio";
 		reg = <0xffc46000 0x2c>;
 		interrupt-parent = <&gic>;
 		interrupts = <0 147 0x4>;
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 4a1536a050bc..1f0871553fd2 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -371,6 +371,16 @@ static const struct of_device_id gpio_rcar_of_table[] = {
 		/* Gen3 GPIO is identical to Gen2. */
 		.data = &gpio_rcar_info_gen2,
 	}, {
+		.compatible = "renesas,rcar-gen1-gpio",
+		.data = &gpio_rcar_info_gen1,
+	}, {
+		.compatible = "renesas,rcar-gen2-gpio",
+		.data = &gpio_rcar_info_gen2,
+	}, {
+		.compatible = "renesas,rcar-gen3-gpio",
+		/* Gen3 GPIO is identical to Gen2. */
+		.data = &gpio_rcar_info_gen2,
+	}, {
 		.compatible = "renesas,gpio-rcar",
 		.data = &gpio_rcar_info_gen1,
 	}, {
-- 
2.1.4

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

* Re: [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings
  2017-07-11 12:38 [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings Simon Horman
@ 2017-07-11 17:59 ` Geert Uytterhoeven
  2017-07-12  5:49   ` Simon Horman
  2017-08-01  8:27 ` Linus Walleij
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2017-07-11 17:59 UTC (permalink / raw)
  To: Simon Horman
  Cc: Geert Uytterhoeven, Linus Walleij, Magnus Damm, linux-gpio,
	Linux-Renesas

Hi Simon,

On Tue, Jul 11, 2017 at 2:38 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> Add fallback compatibility string for R-Car Gen 1, 2 and 3.
>
> In the case of Renesas R-Car hardware we know that there are generations of
> SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
> between IP blocks might be. For example, I believe that r8a7790 is older
> than r8a7791 but that doesn't imply that the latter is a descendant of the
> former or vice versa.
>
> We can, however, by examining the documentation and behaviour of the
> hardware at run-time observe that the current driver implementation appears
> to be compatible with the IP blocks on SoCs within a given generation.
>
> For the above reasons and convenience when enabling new SoCs a
> per-generation fallback compatibility string scheme being adopted for
> drivers for Renesas SoCs.
>
> Also deprecate renesas,gpio-rcar as its name is more generic than its
> implementation.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

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

> ---
> Based on linux-gpio/for-next
> ---
>  .../devicetree/bindings/gpio/renesas,gpio-rcar.txt        | 15 +++++++++++----
>  drivers/gpio/gpio-rcar.c                                  | 10 ++++++++++
>  2 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> index 6826a371fb69..48634b01f1bf 100644
> --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> @@ -2,7 +2,7 @@
>
>  Required Properties:
>
> -  - compatible: should contain one of the following.
> +  - compatible: should contain one or more of the following:
>      - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
>      - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
>      - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
> @@ -13,7 +13,14 @@ Required Properties:
>      - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
>      - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
>      - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
> -    - "renesas,gpio-rcar": for generic R-Car GPIO controller.
> +    - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
> +    - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
> +    - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller.
> +    - "renesas,gpio-rcar": deprecated.
> +
> +    When compatible with the generic version nodes must list the
> +    SoC-specific version corresponding to the platform first followed by
> +    the generic version.

Besides for consistency, does it make sense to deprecate "renesas,gpio-rcar"
(which means R-Car Gen1) and introduce "renesas,rcar-gen1-gpio"?
It's not like new R-Car Gen1 SoCs will pop up anytime soon (do we want Linux
support for R-Car E1?).

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] 5+ messages in thread

* Re: [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings
  2017-07-11 17:59 ` Geert Uytterhoeven
@ 2017-07-12  5:49   ` Simon Horman
  2017-07-12  6:35     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2017-07-12  5:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Linus Walleij, Magnus Damm, linux-gpio,
	Linux-Renesas

On Tue, Jul 11, 2017 at 07:59:31PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Jul 11, 2017 at 2:38 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > Add fallback compatibility string for R-Car Gen 1, 2 and 3.
> >
> > In the case of Renesas R-Car hardware we know that there are generations of
> > SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
> > between IP blocks might be. For example, I believe that r8a7790 is older
> > than r8a7791 but that doesn't imply that the latter is a descendant of the
> > former or vice versa.
> >
> > We can, however, by examining the documentation and behaviour of the
> > hardware at run-time observe that the current driver implementation appears
> > to be compatible with the IP blocks on SoCs within a given generation.
> >
> > For the above reasons and convenience when enabling new SoCs a
> > per-generation fallback compatibility string scheme being adopted for
> > drivers for Renesas SoCs.
> >
> > Also deprecate renesas,gpio-rcar as its name is more generic than its
> > implementation.
> >
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > ---
> > Based on linux-gpio/for-next
> > ---
> >  .../devicetree/bindings/gpio/renesas,gpio-rcar.txt        | 15 +++++++++++----
> >  drivers/gpio/gpio-rcar.c                                  | 10 ++++++++++
> >  2 files changed, 21 insertions(+), 4 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> > index 6826a371fb69..48634b01f1bf 100644
> > --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> > +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
> > @@ -2,7 +2,7 @@
> >
> >  Required Properties:
> >
> > -  - compatible: should contain one of the following.
> > +  - compatible: should contain one or more of the following:
> >      - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
> >      - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
> >      - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
> > @@ -13,7 +13,14 @@ Required Properties:
> >      - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
> >      - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
> >      - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
> > -    - "renesas,gpio-rcar": for generic R-Car GPIO controller.
> > +    - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
> > +    - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
> > +    - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller.
> > +    - "renesas,gpio-rcar": deprecated.
> > +
> > +    When compatible with the generic version nodes must list the
> > +    SoC-specific version corresponding to the platform first followed by
> > +    the generic version.
> 
> Besides for consistency, does it make sense to deprecate "renesas,gpio-rcar"
> (which means R-Car Gen1) and introduce "renesas,rcar-gen1-gpio"?
> It's not like new R-Car Gen1 SoCs will pop up anytime soon (do we want Linux
> support for R-Car E1?).

>From my PoV the only advantage of that portion of the change is improving
consistency. Perhaps it would be better to substitute it with something
like this:

	- "renesas,gpio-rcar": for a generic R-Car Gen1 GPIO controller.

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

* Re: [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings
  2017-07-12  5:49   ` Simon Horman
@ 2017-07-12  6:35     ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2017-07-12  6:35 UTC (permalink / raw)
  To: Simon Horman
  Cc: Geert Uytterhoeven, Linus Walleij, Magnus Damm, linux-gpio,
	Linux-Renesas, Rob Herring, Mark Rutland, devicetree

Hi Simon,

CC DT

On Wed, Jul 12, 2017 at 7:49 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Jul 11, 2017 at 07:59:31PM +0200, Geert Uytterhoeven wrote:
>> On Tue, Jul 11, 2017 at 2:38 PM, Simon Horman
>> <horms+renesas@verge.net.au> wrote:
>> > Add fallback compatibility string for R-Car Gen 1, 2 and 3.
>> >
>> > In the case of Renesas R-Car hardware we know that there are generations of
>> > SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
>> > between IP blocks might be. For example, I believe that r8a7790 is older
>> > than r8a7791 but that doesn't imply that the latter is a descendant of the
>> > former or vice versa.
>> >
>> > We can, however, by examining the documentation and behaviour of the
>> > hardware at run-time observe that the current driver implementation appears
>> > to be compatible with the IP blocks on SoCs within a given generation.
>> >
>> > For the above reasons and convenience when enabling new SoCs a
>> > per-generation fallback compatibility string scheme being adopted for
>> > drivers for Renesas SoCs.
>> >
>> > Also deprecate renesas,gpio-rcar as its name is more generic than its
>> > implementation.
>> >
>> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> > ---
>> > Based on linux-gpio/for-next
>> > ---
>> >  .../devicetree/bindings/gpio/renesas,gpio-rcar.txt        | 15 +++++++++++----
>> >  drivers/gpio/gpio-rcar.c                                  | 10 ++++++++++
>> >  2 files changed, 21 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
>> > index 6826a371fb69..48634b01f1bf 100644
>> > --- a/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
>> > +++ b/Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
>> > @@ -2,7 +2,7 @@
>> >
>> >  Required Properties:
>> >
>> > -  - compatible: should contain one of the following.
>> > +  - compatible: should contain one or more of the following:
>> >      - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
>> >      - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller.
>> >      - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
>> > @@ -13,7 +13,14 @@ Required Properties:
>> >      - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
>> >      - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
>> >      - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
>> > -    - "renesas,gpio-rcar": for generic R-Car GPIO controller.
>> > +    - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
>> > +    - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
>> > +    - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller.
>> > +    - "renesas,gpio-rcar": deprecated.
>> > +
>> > +    When compatible with the generic version nodes must list the
>> > +    SoC-specific version corresponding to the platform first followed by
>> > +    the generic version.
>>
>> Besides for consistency, does it make sense to deprecate "renesas,gpio-rcar"
>> (which means R-Car Gen1) and introduce "renesas,rcar-gen1-gpio"?
>> It's not like new R-Car Gen1 SoCs will pop up anytime soon (do we want Linux
>> support for R-Car E1?).
>
> From my PoV the only advantage of that portion of the change is improving
> consistency. Perhaps it would be better to substitute it with something
> like this:
>
>         - "renesas,gpio-rcar": for a generic R-Car Gen1 GPIO controller.

That sounds good to me. But other people may disagree.
Oh, no CC to the devicetree folks. Fixed.
Patch at https://patchwork.kernel.org/patch/9834611/

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] 5+ messages in thread

* Re: [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings
  2017-07-11 12:38 [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings Simon Horman
  2017-07-11 17:59 ` Geert Uytterhoeven
@ 2017-08-01  8:27 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2017-08-01  8:27 UTC (permalink / raw)
  To: Simon Horman; +Cc: Geert Uytterhoeven, Magnus Damm, linux-gpio, Linux-Renesas

On Tue, Jul 11, 2017 at 2:38 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:

> Add fallback compatibility string for R-Car Gen 1, 2 and 3.
>
> In the case of Renesas R-Car hardware we know that there are generations of
> SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship
> between IP blocks might be. For example, I believe that r8a7790 is older
> than r8a7791 but that doesn't imply that the latter is a descendant of the
> former or vice versa.
>
> We can, however, by examining the documentation and behaviour of the
> hardware at run-time observe that the current driver implementation appears
> to be compatible with the IP blocks on SoCs within a given generation.
>
> For the above reasons and convenience when enabling new SoCs a
> per-generation fallback compatibility string scheme being adopted for
> drivers for Renesas SoCs.
>
> Also deprecate renesas,gpio-rcar as its name is more generic than its
> implementation.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Totally uncontroversial DT binding changes so patch applied for next
with Geert's review tag.

Yours,
Linus Walleij

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

end of thread, other threads:[~2017-08-01  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11 12:38 [PATCH/RFC] gpio: rcar: add gen[123] fallback compatibility strings Simon Horman
2017-07-11 17:59 ` Geert Uytterhoeven
2017-07-12  5:49   ` Simon Horman
2017-07-12  6:35     ` Geert Uytterhoeven
2017-08-01  8:27 ` Linus Walleij

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.