lantiq/xrx200: fix WLAN button actions for Fritzbox 3370
authorDustin Gathmann <dzsoftware@posteo.org>
Wed, 20 May 2020 23:22:53 +0000 (01:22 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 19 Jul 2020 22:58:30 +0000 (00:58 +0200)
The WLAN button actions are reversed, i.e. pressing the button emits a
'released' action, and vice versa.
This can easily be checked by adding
logger -t button_action "$BUTTON $ACTION"
as the second line of /etc/rc.button/rfkill, and using logread to read
the events (assuming the preceding patch has been applied).
Defining the GPIO as ACTIVE_LOW corrects this behavior.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi
target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi

index 4c4ae1a01f55b5ae73a9d6a7585509c758d7da6f..2c790a488e1fd09c6f8302c6babb8cb4fbf0a0e1 100644 (file)
@@ -44,7 +44,7 @@
 
                wifi {
                        label = "wlan";
-                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+                       gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RFKILL>;
                };
        };
index 4c4ae1a01f55b5ae73a9d6a7585509c758d7da6f..2c790a488e1fd09c6f8302c6babb8cb4fbf0a0e1 100644 (file)
@@ -44,7 +44,7 @@
 
                wifi {
                        label = "wlan";
-                       gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
+                       gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RFKILL>;
                };
        };