aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Beier <beier.florian@gmail.com>2017-10-25 20:12:24 +0200
committerMathias Kresin <dev@kresin.me>2017-11-03 20:04:52 +0100
commitc4c72a9a42e07bed8f9e9eb214c0debfb5d7ab90 (patch)
tree89ecff6269bbe08f34eb78b902d6f851ee629689
parentfdc7cc99071de6bd1d6a240d4cd306c57920ccac (diff)
downloadupstream-c4c72a9a42e07bed8f9e9eb214c0debfb5d7ab90.tar.gz
upstream-c4c72a9a42e07bed8f9e9eb214c0debfb5d7ab90.tar.bz2
upstream-c4c72a9a42e07bed8f9e9eb214c0debfb5d7ab90.zip
ar71xx: fix LED config for DIR-869 A1
This fixes the LED configuration for the D-Link DIR-869 A1. In order to support the device I probed around using an initramfs image for the UniFi AC. Pulling GPIO 15 to low enabled the LEDs while high disabled them. GPIO 16 set to low meant that the color was white while pulling it to high made the color change to orange. The past code was written based upon these findings. However, running a flashed image I now discovered that GPIO 15 controls the orange LEDs while GPIO 16 controls the white ones and that both are active when low. This means that the GPIOs were inverted and one active_low was set wrong which this patch fixes. Behavior of the LED front after this patch is applied: cat /sys/devices/platform/leds-gpio/leds/d-link:white:status/brightness 0 -> white LEDs are OFF 255 -> white LEDs are ON cat /sys/devices/platform/leds-gpio/leds/d-link:orange:status/brightness 0 -> orange LEDs are OFF 255 -> orange LEDs are ON If the brightness of both is set to 255 the LED front will be white. If the brightness of both is set to 0 the LED front will be off. Signed-off-by: Florian Beier <beier.florian@gmail.com>
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c
index 5847423891..b0894e37cc 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c
@@ -42,8 +42,8 @@
#define DIR869A1_GPIO_ENABLE_SWITCH 11
-#define DIR869A1_GPIO_LED_POWER 15
-#define DIR869A1_GPIO_LED_ORANGE 16
+#define DIR869A1_GPIO_LED_ORANGE 15
+#define DIR869A1_GPIO_LED_WHITE 16
#define DIR869A1_KEYS_POLL_INTERVAL 20 /* msecs */
#define DIR869A1_KEYS_DEBOUNCE_INTERVAL (3 * DIR869A1_KEYS_POLL_INTERVAL)
@@ -59,17 +59,14 @@
static struct gpio_led dir869a1_leds_gpio[] __initdata = {
{
- /* Actually, this GPIO controls the LED power,
- * while d-link:orange:status switches it between
- * orange and white */
.name = "d-link:white:status",
- .gpio = DIR869A1_GPIO_LED_POWER,
+ .gpio = DIR869A1_GPIO_LED_WHITE,
.active_low = 1,
},
{
.name = "d-link:orange:status",
.gpio = DIR869A1_GPIO_LED_ORANGE,
- .active_low = 0,
+ .active_low = 1,
},
};