Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Simon Horman and committed by
Linus Walleij
dbd1dad2 4a5c886e

+21 -4
+11 -4
Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
··· 2 2 3 3 Required Properties: 4 4 5 - - compatible: should contain one of the following. 5 + - compatible: should contain one or more of the following: 6 6 - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller. 7 7 - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. 8 8 - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. ··· 13 13 - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller. 14 14 - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller. 15 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 25 - reg: Base address and length of each memory resource used by the GPIO 19 26 controller hardware module. ··· 50 43 Example: R8A7779 (R-Car H1) GPIO controller nodes 51 44 52 45 gpio0: gpio@ffc40000 { 53 - compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; 46 + compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; 54 47 reg = <0xffc40000 0x2c>; 55 48 interrupt-parent = <&gic>; 56 49 interrupts = <0 141 0x4>; ··· 62 55 }; 63 56 ... 64 57 gpio6: gpio@ffc46000 { 65 - compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; 58 + compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; 66 59 reg = <0xffc46000 0x2c>; 67 60 interrupt-parent = <&gic>; 68 61 interrupts = <0 147 0x4>;
+10
drivers/gpio/gpio-rcar.c
··· 371 371 /* Gen3 GPIO is identical to Gen2. */ 372 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 384 .compatible = "renesas,gpio-rcar", 375 385 .data = &gpio_rcar_info_gen1, 376 386 }, {