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@gmail.com>
[shorten commit title, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
leds {
label = "LED control button";
- linux,code = <BTN_0>;
+ linux,code = <KEY_LIGHTS_TOGGLE>;
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
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 {
aliases {
label-mac-device = ð0;
};
-
- gpio-export {
- compatible = "gpio-export";
-
- led_control {
- gpio-export,name = "tp-link:led:control";
- gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
- };
- };
};
&partitions {