]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: use i2c-gpio driver for EX400
authorDavid Bauer <mail@david-bauer.net>
Tue, 6 May 2025 16:23:50 +0000 (18:23 +0200)
committerDavid Bauer <mail@david-bauer.net>
Sat, 10 May 2025 19:26:08 +0000 (21:26 +0200)
Configure the i2c pins as GPIO outputs and use the i2c-gpio driver to
control the Semtech SX9512 touch controller.

This fixes spurious errors in i2c transactions even at 1kHz with the
native i2c driver.

leds green:wan: Setting an LED's brightness failed (-6)

Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi
target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts

index a3bc70e8cefed6612d79b6db728c9547d6a6dfb5..ebcf558359b426e41b7f57290efa89ba7a4d31de 100644 (file)
                        gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       i2c_gpio: i2c-gpio {
+               compatible = "i2c-gpio";
+
+               sda-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
+               scl-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+
+               i2c-gpio,delay-us = <50>;
+               i2c-gpio,timeout-ms = <100>;
+
+               /* Semtech SX9512 */
+       };
 };
 
 &pcie {
 };
 
 &i2c {
-       status = "okay";
+       /* Uses i2c-gpio */
+       status = "disabled";
 };
 
 &ethphy0 {
 
 &state_default {
        gpio {
-               groups = "uart2", "uart3";
+               groups = "i2c", "uart2", "uart3";
                function = "gpio";
        };
 };
index 61b3e869d7e154daabeefd856b1b74c8dd2f3f64..ad8a22ad79d369cb89ab159bc0f62c393c6db47c 100644 (file)
@@ -22,9 +22,7 @@
        };
 };
 
-&i2c {
-       clock-frequency = <1000>;
-
+&i2c_gpio {
        touch@2b {
                compatible = "semtech,sx9512";