[openwrt/openwrt] ath79: fix/improve LED control for TL-WPA8630 v1/v2

LEDE Commits lede-commits at lists.infradead.org
Sat Aug 22 09:19:28 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/685d2513b51094f183d0a93f207b73c8b1c598f3

commit 685d2513b51094f183d0a93f207b73c8b1c598f3
Author: Joe Mullally <jwmullally at gmail.com>
AuthorDate: Fri Aug 21 07:02:23 2020 +0100

    ath79: fix/improve LED control for TL-WPA8630 v1/v2
    
    The TL-WPA8630 v1 and v2 have the same LED Control GPIO configuration
    according to the TP-Link GPL sources. Set the GPIO to output to make
    it work and set to Active Low. It defaults to LEDs on at bootup.
    
    To turn all LEDs off:
      echo 0 > /sys/class/gpio/tp-link\:led\:control/value
    To turn all LEDs on:
      echo 1 > /sys/class/gpio/tp-link\:led\:control/value
    
    Change the "LED" button from BTN_0 to KEY_LIGHTS_TOGGLE to match other
    devices and the button guide, and to reduce the number of unintuitive
    "BTN_X" inputs.
    
    Fixes: ab74def0db93 ("ath79: add support for TP-Link TL-WPA8630P v2")
    
    Signed-off-by: Joe Mullally <jwmullally at gmail.com>
    [shorten commit title, minor commit message adjustments]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi     | 12 +++++++++++-
 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi |  9 ---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi
index 1f16f9a617..14602a1c24 100644
--- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi
+++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi
@@ -25,7 +25,7 @@
 
 		leds {
 			label = "LED control button";
-			linux,code = <BTN_0>;
+			linux,code = <KEY_LIGHTS_TOGGLE>;
 			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
 			debounce-interval = <60>;
 		};
@@ -70,6 +70,16 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		led_control {
+			gpio-export,name = "tp-link:led:control";
+			gpio-export,output = <0>;
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+	};
 };
 
 &spi {
diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi
index 2389fe9734..2d3128e037 100644
--- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi
+++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi
@@ -6,15 +6,6 @@
 	aliases {
 		label-mac-device = &eth0;
 	};
-
-	gpio-export {
-		compatible = "gpio-export";
-
-		led_control {
-			gpio-export,name = "tp-link:led:control";
-			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
-		};
-	};
 };
 
 &partitions {



More information about the lede-commits mailing list