diff options
author | Simon Horman <horms+renesas@verge.net.au> | 2016-12-06 11:01:28 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-12-11 16:48:53 -0500 |
commit | ad4a8dc3fec6485b18654d1090ef8012fcfc37b8 (patch) | |
tree | ea4789755c3134f89629799925f3dad4f85598cd | |
parent | a55fa9d0e42e31b0292540e6324d481aad307644 (diff) |
i2c: rcar: Add per-Generation fallback bindings
In the case of Renesas R-Car hardware we know that there are generations of
SoCs, e.g. Gen 2 and Gen 3. But beyond that it's 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 is being adopted for
drivers for Renesas SoCs.
Also:
* Deprecate renesas,i2c-rcar. It seems poorly named as it is only
compatible with R-Car Gen 1. It also appears unused in mainline.
* Add some text to describe per-SoC bindings
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 32 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 5 |
2 files changed, 24 insertions, 13 deletions
diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt index 239632a0d709..2b8bd33dbf8d 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt | |||
@@ -1,17 +1,25 @@ | |||
1 | I2C for R-Car platforms | 1 | I2C for R-Car platforms |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible: Must be one of | 4 | - compatible: |
5 | "renesas,i2c-rcar" | 5 | "renesas,i2c-r8a7778" if the device is a part of a R8A7778 SoC. |
6 | "renesas,i2c-r8a7778" | 6 | "renesas,i2c-r8a7779" if the device is a part of a R8A7779 SoC. |
7 | "renesas,i2c-r8a7779" | 7 | "renesas,i2c-r8a7790" if the device is a part of a R8A7790 SoC. |
8 | "renesas,i2c-r8a7790" | 8 | "renesas,i2c-r8a7791" if the device is a part of a R8A7791 SoC. |
9 | "renesas,i2c-r8a7791" | 9 | "renesas,i2c-r8a7792" if the device is a part of a R8A7792 SoC. |
10 | "renesas,i2c-r8a7792" | 10 | "renesas,i2c-r8a7793" if the device is a part of a R8A7793 SoC. |
11 | "renesas,i2c-r8a7793" | 11 | "renesas,i2c-r8a7794" if the device is a part of a R8A7794 SoC. |
12 | "renesas,i2c-r8a7794" | 12 | "renesas,i2c-r8a7795" if the device is a part of a R8A7795 SoC. |
13 | "renesas,i2c-r8a7795" | 13 | "renesas,i2c-r8a7796" if the device is a part of a R8A7796 SoC. |
14 | "renesas,i2c-r8a7796" | 14 | "renesas,rcar-gen1-i2c" for a generic R-Car Gen1 compatible device. |
15 | "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 compatible device. | ||
16 | "renesas,rcar-gen3-i2c" for a generic R-Car Gen3 compatible device. | ||
17 | "renesas,i2c-rcar" (deprecated) | ||
18 | |||
19 | When compatible with the generic version, nodes must list the | ||
20 | SoC-specific version corresponding to the platform first followed | ||
21 | by the generic version. | ||
22 | |||
15 | - reg: physical base address of the controller and length of memory mapped | 23 | - reg: physical base address of the controller and length of memory mapped |
16 | region. | 24 | region. |
17 | - interrupts: interrupt specifier. | 25 | - interrupts: interrupt specifier. |
@@ -33,7 +41,7 @@ Examples : | |||
33 | i2c0: i2c@e6508000 { | 41 | i2c0: i2c@e6508000 { |
34 | #address-cells = <1>; | 42 | #address-cells = <1>; |
35 | #size-cells = <0>; | 43 | #size-cells = <0>; |
36 | compatible = "renesas,i2c-r8a7791"; | 44 | compatible = "renesas,i2c-r8a7791", "renesas,rcar-gen2-i2c"; |
37 | reg = <0 0xe6508000 0 0x40>; | 45 | reg = <0 0xe6508000 0 0x40>; |
38 | interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>; | 46 | interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>; |
39 | clocks = <&mstp9_clks R8A7791_CLK_I2C0>; | 47 | clocks = <&mstp9_clks R8A7791_CLK_I2C0>; |
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 726615e54f2a..26f2ff22e97e 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c | |||
@@ -793,7 +793,6 @@ static const struct i2c_algorithm rcar_i2c_algo = { | |||
793 | }; | 793 | }; |
794 | 794 | ||
795 | static const struct of_device_id rcar_i2c_dt_ids[] = { | 795 | static const struct of_device_id rcar_i2c_dt_ids[] = { |
796 | { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 }, | ||
797 | { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 }, | 796 | { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 }, |
798 | { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 }, | 797 | { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 }, |
799 | { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 }, | 798 | { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 }, |
@@ -803,6 +802,10 @@ static const struct of_device_id rcar_i2c_dt_ids[] = { | |||
803 | { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 }, | 802 | { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 }, |
804 | { .compatible = "renesas,i2c-r8a7795", .data = (void *)I2C_RCAR_GEN3 }, | 803 | { .compatible = "renesas,i2c-r8a7795", .data = (void *)I2C_RCAR_GEN3 }, |
805 | { .compatible = "renesas,i2c-r8a7796", .data = (void *)I2C_RCAR_GEN3 }, | 804 | { .compatible = "renesas,i2c-r8a7796", .data = (void *)I2C_RCAR_GEN3 }, |
805 | { .compatible = "renesas,i2c-rcar", .data = (void *)I2C_RCAR_GEN1 }, /* Deprecated */ | ||
806 | { .compatible = "renesas,rcar-gen1-i2c", .data = (void *)I2C_RCAR_GEN1 }, | ||
807 | { .compatible = "renesas,rcar-gen2-i2c", .data = (void *)I2C_RCAR_GEN2 }, | ||
808 | { .compatible = "renesas,rcar-gen3-i2c", .data = (void *)I2C_RCAR_GEN3 }, | ||
806 | {}, | 809 | {}, |
807 | }; | 810 | }; |
808 | MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids); | 811 | MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids); |