From 53b66248f4ad4767f19ff243d8f839d9dea15b00 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Thu, 19 Mar 2020 19:43:39 +0800 Subject: [PATCH] ramips: use SoC I2C instead of bitbanged for Ubiquiti ER-X-SFP 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 --- .../dts/mt7621_ubiquiti_edgerouterx-sfp.dts | 17 ++++++----------- .../ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi | 2 +- target/linux/ramips/image/mt7621.mk | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts index c6a64c05282d..b4deb490ed1c 100644 --- a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx-sfp.dts @@ -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>; }; }; diff --git a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi index b10953f45ef4..4503f67a641f 100644 --- a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi @@ -109,7 +109,7 @@ &state_default { gpio { - groups = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag"; + groups = "uart2", "uart3", "pcie", "rgmii2", "jtag"; function = "gpio"; }; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b2590c575972..cd5be15837b7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -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 -- 2.30.2