diff options
author | Simon Horman <horms+renesas@verge.net.au> | 2017-07-11 08:38:30 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-14 09:01:12 -0400 |
commit | dbd1dad2ab8ffca57e0aa386df0d7ec621c26ca8 (patch) | |
tree | 6d87d418de756eaa773decaf1364dd9895cb0811 | |
parent | 4a5c886e7cc913b60b68825846cd43dcfe7a2be0 (diff) |
gpio: rcar: add gen[123] fallback compatibility strings
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt | 15 | ||||
-rw-r--r-- | 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 @@ | |||
2 | 2 | ||
3 | Required Properties: | 3 | Required Properties: |
4 | 4 | ||
5 | - compatible: should contain one of the following. | 5 | - compatible: should contain one or more of the following: |
6 | - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller. | 6 | - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller. |
7 | - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. | 7 | - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. |
8 | - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. | 8 | - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. |
@@ -13,7 +13,14 @@ Required Properties: | |||
13 | - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller. | 13 | - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller. |
14 | - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller. | 14 | - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller. |
15 | - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller. | 15 | - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller. |
16 | - "renesas,gpio-rcar": for generic R-Car GPIO controller. | 16 | - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller. |
17 | - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller. | ||
18 | - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller. | ||
19 | - "renesas,gpio-rcar": deprecated. | ||
20 | |||
21 | When compatible with the generic version nodes must list the | ||
22 | SoC-specific version corresponding to the platform first followed by | ||
23 | the generic version. | ||
17 | 24 | ||
18 | - reg: Base address and length of each memory resource used by the GPIO | 25 | - reg: Base address and length of each memory resource used by the GPIO |
19 | controller hardware module. | 26 | controller hardware module. |
@@ -43,7 +50,7 @@ interrupt-controller/interrupts.txt. | |||
43 | Example: R8A7779 (R-Car H1) GPIO controller nodes | 50 | Example: R8A7779 (R-Car H1) GPIO controller nodes |
44 | 51 | ||
45 | gpio0: gpio@ffc40000 { | 52 | gpio0: gpio@ffc40000 { |
46 | compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; | 53 | compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; |
47 | reg = <0xffc40000 0x2c>; | 54 | reg = <0xffc40000 0x2c>; |
48 | interrupt-parent = <&gic>; | 55 | interrupt-parent = <&gic>; |
49 | interrupts = <0 141 0x4>; | 56 | interrupts = <0 141 0x4>; |
@@ -55,7 +62,7 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes | |||
55 | }; | 62 | }; |
56 | ... | 63 | ... |
57 | gpio6: gpio@ffc46000 { | 64 | gpio6: gpio@ffc46000 { |
58 | compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; | 65 | compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; |
59 | reg = <0xffc46000 0x2c>; | 66 | reg = <0xffc46000 0x2c>; |
60 | interrupt-parent = <&gic>; | 67 | interrupt-parent = <&gic>; |
61 | interrupts = <0 147 0x4>; | 68 | 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[] = { | |||
371 | /* Gen3 GPIO is identical to Gen2. */ | 371 | /* Gen3 GPIO is identical to Gen2. */ |
372 | .data = &gpio_rcar_info_gen2, | 372 | .data = &gpio_rcar_info_gen2, |
373 | }, { | 373 | }, { |
374 | .compatible = "renesas,rcar-gen1-gpio", | ||
375 | .data = &gpio_rcar_info_gen1, | ||
376 | }, { | ||
377 | .compatible = "renesas,rcar-gen2-gpio", | ||
378 | .data = &gpio_rcar_info_gen2, | ||
379 | }, { | ||
380 | .compatible = "renesas,rcar-gen3-gpio", | ||
381 | /* Gen3 GPIO is identical to Gen2. */ | ||
382 | .data = &gpio_rcar_info_gen2, | ||
383 | }, { | ||
374 | .compatible = "renesas,gpio-rcar", | 384 | .compatible = "renesas,gpio-rcar", |
375 | .data = &gpio_rcar_info_gen1, | 385 | .data = &gpio_rcar_info_gen1, |
376 | }, { | 386 | }, { |