ath79: correctly define WiFi switch for TL-WR841ND v8
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 8 Jul 2020 18:48:57 +0000 (20:48 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 21 Jul 2020 10:02:35 +0000 (12:02 +0200)
The TL-WR841ND v8 feature a WiFi switch instead of a button.
This adds the corresponding input-type to prevent booting into
failsafe regularly.

This has been defined correctly in ar71xx, but was overlooked
when migrating to ath79. In contrast, the TL-WR842ND v2, which
has the key set up as switch in ar71xx, actually has a button.
The TL-MR3420 v2 has a button as well and is set up correctly
for both targets. (Information based on TP-Link user guide)

Note:

While looking into this, I found that support PR for TL-MR3420 v2
switched reset button to ACTIVE_HIGH. However, the other two
device still use ACTIVE_LOW. This seems strange, but I cannot
verify it lacking the affected devices.

Fixes: FS#2733
Fixes: 9601d94138de ("add support for TP-Link TL-WR841N/ND v8")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/dts/ar9341_tplink.dtsi
target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts
target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts
target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts

index 6bd7c3409bac75c08db54d60677deff27be1e468..c96dbe19186b4e8389a031890e918bb1768ddc3f 100644 (file)
                label-mac-device = &wmac;
        };
 
-       keys: keys {
-               compatible = "gpio-keys";
-
-               rfkill {
-                       label = "WiFi";
-                       linux,code = <KEY_RFKILL>;
-                       gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
-                       debounce-interval = <60>;
-               };
-       };
-
        leds: leds {
                compatible = "gpio-leds";
 
index f864381520c5c73f7ff7ba8cf42978fb06328413..e6cf6ef8633564fadee9b7e5960156c87195a5ae 100644 (file)
@@ -6,14 +6,23 @@
 / {
        model = "TP-Link TL-MR3420 v2";
        compatible = "tplink,tl-mr3420-v2", "qca,ar9341";
-};
 
-&keys {
-       reset {
-               label = "Reset";
-               linux,code = <KEY_RESTART>;
-               gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
-               debounce-interval = <60>;
+       keys {
+               compatible = "gpio-keys";
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <60>;
+               };
+
+               reset {
+                       label = "Reset/WPS";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <60>;
+               };
        };
 };
 
index 3577e4994f31887a435760a2ec22d16a5e874182..95a047c6d4d27a46643779877ceafedba423d0ec 100644 (file)
@@ -6,14 +6,24 @@
 / {
        model = "TP-Link TL-WR841N/ND v8";
        compatible = "tplink,tl-wr841-v8", "qca,ar9341";
-};
 
-&keys {
-       reset {
-               label = "Reset";
-               linux,code = <KEY_RESTART>;
-               gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
-               debounce-interval = <60>;
+       keys {
+               compatible = "gpio-keys";
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       linux,input-type = <EV_SW>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <60>;
+               };
+
+               reset {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <60>;
+               };
        };
 };
 
index d9b0ee86f501f50ae0926f5a659d40840546de60..4df0feae98fe7b28ccab5e8381173fad36fa94b4 100644 (file)
@@ -7,6 +7,24 @@
        model = "TP-Link TL-WR842N/ND v2";
        compatible = "tplink,tl-wr842n-v2", "qca,ar9341";
 
+       keys {
+               compatible = "gpio-keys";
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <60>;
+               };
+
+               reset {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <60>;
+               };
+       };
+
        gpio-export {
                compatible = "gpio-export";
 
        };
 };
 
-&keys {
-       reset {
-               label = "Reset";
-               linux,code = <KEY_RESTART>;
-               gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
-               debounce-interval = <60>;
-       };
-};
-
 &leds {
        usb {
                label = "tp-link:green:usb";