ARM: dts: rainier: Describe GPIO mux on I2C3
authorAndrew Jeffery <andrew@aj.id.au>
Fri, 24 Jul 2020 06:52:27 +0000 (16:22 +0930)
committerJoel Stanley <joel@jms.id.au>
Mon, 27 Jul 2020 23:32:07 +0000 (09:02 +0930)
We have a 4-bus mux whose output is selected by two GPIO inputs. Wire it
up in the devicetree and ensure the output is enabled by hogging the
appropriate line.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts

index e91f3bc..d20cdf3 100644 (file)
 
        aliases {
                serial4 = &uart5;
+               i2c16 = &i2c2mux0;
+               i2c17 = &i2c2mux1;
+               i2c18 = &i2c2mux2;
+               i2c19 = &i2c2mux3;
        };
 
        chosen {
                };
        };
 
+       i2c2mux: i2cmux {
+               compatible = "i2c-mux-gpio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "okay";
+
+               i2c-parent = <&i2c2>;
+               mux-gpios = <&gpio0 ASPEED_GPIO(G, 4) GPIO_ACTIVE_HIGH>,
+                           <&gpio0 ASPEED_GPIO(G, 5) GPIO_ACTIVE_HIGH>;
+               idle-state = <0>;
+
+               i2c2mux0: i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0>;
+               };
+
+               i2c2mux1: i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <1>;
+               };
+
+               i2c2mux2: i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <2>;
+               };
+
+               i2c2mux3: i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <3>;
+               };
+       };
 };
 
 &gpio0 {
                output-high;
                line-name = "mclr_vpp";
        };
+
+       i2c3_mux_oe_n {
+               gpio-hog;
+               gpios = <ASPEED_GPIO(G, 6) GPIO_ACTIVE_LOW>;
+               output-high;
+               line-name = "I2C3_MUX_OE_N";
+       };
 };
 
 &emmc_controller {