]> Pileus Git - ~andy/linux/commitdiff
MIPS: BCM47XX: Use "timer" trigger for status LEDs
authorRafał Miłecki <zajec5@gmail.com>
Fri, 3 Jan 2014 08:04:39 +0000 (09:04 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 24 Jan 2014 21:39:52 +0000 (22:39 +0100)
Some devices have power LED as well as status LED. The second one is
used to show the firmware is up and running. Set "timer" trigger for
such LEDs.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6312/

arch/mips/bcm47xx/leds.c

index cc141c1e668f3bd7ceea5fbd4192e45c65d8a6bc..28d281cc2e7d53736e28faaf1ad3781a93011d44 100644 (file)
                .default_state  = _default_state,                       \
        }
 
+#define BCM47XX_GPIO_LED_TRIGGER(_gpio, _color, _function, _active_low,        \
+                                _default_trigger)                      \
+       {                                                               \
+               .name           = "bcm47xx:" _color ":" _function,      \
+               .gpio           = _gpio,                                \
+               .active_low     = _active_low,                          \
+               .default_state  = LEDS_GPIO_DEFSTATE_OFF,               \
+               .default_trigger        = _default_trigger,             \
+       }
+
 /* Asus */
 
 static const struct gpio_led
@@ -176,13 +186,13 @@ bcm47xx_leds_dell_tm2300[] __initconst = {
 
 static const struct gpio_led
 bcm47xx_leds_dlink_dir130[] __initconst = {
-       BCM47XX_GPIO_LED(0, "green", "status", 1, LEDS_GPIO_DEFSTATE_OFF), /* Originally blinking when device is ready, separated from "power" LED */
+       BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
        BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF),
 };
 
 static const struct gpio_led
 bcm47xx_leds_dlink_dir330[] __initconst = {
-       BCM47XX_GPIO_LED(0, "green", "status", 1, LEDS_GPIO_DEFSTATE_OFF), /* Originally blinking when device is ready, separated from "power" LED */
+       BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */
        BCM47XX_GPIO_LED(4, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
        BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF),
 };