ramips: use SoC I2C instead of bitbanged for Ubiquiti ER-X-SFP
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Thu, 19 Mar 2020 11:43:39 +0000 (19:43 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 4 Apr 2020 06:56:14 +0000 (14:56 +0800)
The original idea of bitbanged I2C is to use i2c-gpio-custom
Since i2c-gpio-custom is no longer available on 5.4, use SoC I2C instead

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts
target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi
target/linux/ramips/image/mt7621.mk

index c6a64c05282d074023f9d156c50a9b006b85efdc..b4deb490ed1ce323b838586601b031ac899bcc34 100644 (file)
@@ -5,18 +5,13 @@
 / {
        model = "UBNT-ERX-SFP";
        compatible = "ubiquiti,edgerouterx-sfp", "mediatek,mt7621-soc";
+};
 
-       i2c-gpio {
-               compatible = "i2c-gpio";
-               gpios = <&gpio 3 GPIO_ACTIVE_HIGH /* sda */
-                        &gpio 4 GPIO_ACTIVE_HIGH /* scl */
-                       >;
-               #address-cells = <1>;
-               #size-cells = <0>;
+&i2c {
+       status = "okay";
 
-               pca9555@25 {
-                       compatible = "pca9555";
-                       reg = <0x25>;
-               };
+       pca9555@25 {
+               compatible = "nxp,pca9555";
+               reg = <0x25>;
        };
 };
index b10953f45ef47f2cb1530943ff94bd145b1ad17f..4503f67a641f7a193bde6b9660611d3049a08de0 100644 (file)
 
 &state_default {
        gpio {
-               groups = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag";
+               groups = "uart2", "uart3", "pcie", "rgmii2", "jtag";
                function = "gpio";
        };
 };
index b2590c57597284e8c7f83b697d962cd6811a4f9d..cd5be15837b74303bf69904310808fa619816160 100644 (file)
@@ -785,7 +785,7 @@ define Device/ubiquiti_edgerouterx-sfp
   $(Device/ubiquiti_edgerouterx)
   DEVICE_VENDOR := Ubiquiti
   DEVICE_MODEL := EdgeRouter X-SFP
-  DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
+  DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x
   SUPPORTED_DEVICES += ubnt-erx-sfp
 endef
 TARGET_DEVICES += ubiquiti_edgerouterx-sfp