Create a separate bus for HDMI related I2C2 and provide fallback to GPIO.

Based on work for the r8a7790/lager by Wolfram Sang.

Cc: Wolfram Sang <wsa+rene...@sang-engineering.com>
Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
---
v3
* New patch
---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 141 ++++++++++++++++++++--------------
 1 file changed, 82 insertions(+), 59 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts 
b/arch/arm/boot/dts/r8a7791-koelsch.dts
index 744a6e2be2d2..0beb9556fe01 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -51,7 +51,9 @@
                serial0 = &scif0;
                serial1 = &scif1;
                i2c9 = "gpioi2c1";
+               i2c10 = "gpioi2c2";
                i2c12 = "i2cexio1";
+               i2c13 = "i2chdmi";
        };
 
        chosen {
@@ -301,6 +303,17 @@
                i2c-gpio,delay-us = <5>;
        };
 
+       gpioi2c2: i2c-10 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "i2c-gpio";
+               status = "disabled";
+               gpios = <&gpio2 7 GPIO_ACTIVE_HIGH /* sda */
+                        &gpio2 6 GPIO_ACTIVE_HIGH /* scl */
+                       >;
+               i2c-gpio,delay-us = <5>;
+       };
+
        /*
         * I2C1 is routed to EXIO connector B, pins 64 (SCL) + 66 (SDA).
         * A fallback to GPIO is provided.
@@ -312,6 +325,74 @@
                #address-cells = <1>;
                #size-cells = <0>;
        };
+
+       /*
+        * A fallback to GPIO is provided for I2C2.
+        */
+       i2chdmi: i2c-13 {
+               compatible = "i2c-demux-pinctrl";
+               i2c-parent = <&i2c2>, <&gpioi2c2>;
+               i2c-bus-name = "i2c-hdmi";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ak4643: codec@12 {
+                       compatible = "asahi-kasei,ak4643";
+                       #sound-dai-cells = <0>;
+                       reg = <0x12>;
+               };
+
+               composite-in@20 {
+                       compatible = "adi,adv7180";
+                       reg = <0x20>;
+                       remote = <&vin1>;
+
+                       port {
+                               adv7180: endpoint {
+                                       bus-width = <8>;
+                                       remote-endpoint = <&vin1ep>;
+                               };
+                       };
+               };
+
+               hdmi@39 {
+                       compatible = "adi,adv7511w";
+                       reg = <0x39>;
+                       interrupt-parent = <&gpio3>;
+                       interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
+
+                       adi,input-depth = <8>;
+                       adi,input-colorspace = "rgb";
+                       adi,input-clock = "1x";
+                       adi,input-style = <1>;
+                       adi,input-justification = "evenly";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       adv7511_in: endpoint {
+                                               remote-endpoint = <&du_out_rgb>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       adv7511_out: endpoint {
+                                               remote-endpoint = <&hdmi_con>;
+                                       };
+                               };
+                       };
+               };
+
+               eeprom@50 {
+                       compatible = "renesas,24c02";
+                       reg = <0x50>;
+                       pagesize = <16>;
+               };
+       };
 };
 
 &du {
@@ -575,67 +656,9 @@
 
 &i2c2 {
        pinctrl-0 = <&i2c2_pins>;
-       pinctrl-names = "default";
+       pinctrl-names = "i2c-hdmi";
 
-       status = "okay";
        clock-frequency = <100000>;
-
-       ak4643: codec@12 {
-               compatible = "asahi-kasei,ak4643";
-               #sound-dai-cells = <0>;
-               reg = <0x12>;
-       };
-
-       composite-in@20 {
-               compatible = "adi,adv7180";
-               reg = <0x20>;
-               remote = <&vin1>;
-
-               port {
-                       adv7180: endpoint {
-                               bus-width = <8>;
-                               remote-endpoint = <&vin1ep>;
-                       };
-               };
-       };
-
-       hdmi@39 {
-               compatible = "adi,adv7511w";
-               reg = <0x39>;
-               interrupt-parent = <&gpio3>;
-               interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
-
-               adi,input-depth = <8>;
-               adi,input-colorspace = "rgb";
-               adi,input-clock = "1x";
-               adi,input-style = <1>;
-               adi,input-justification = "evenly";
-
-               ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@0 {
-                               reg = <0>;
-                               adv7511_in: endpoint {
-                                       remote-endpoint = <&du_out_rgb>;
-                               };
-                       };
-
-                       port@1 {
-                               reg = <1>;
-                               adv7511_out: endpoint {
-                                       remote-endpoint = <&hdmi_con>;
-                               };
-                       };
-               };
-       };
-
-       eeprom@50 {
-               compatible = "renesas,24c02";
-               reg = <0x50>;
-               pagesize = <16>;
-       };
 };
 
 &i2c6 {
-- 
2.1.4

Reply via email to