linux-mips
[Top] [All Lists]

[PATCH] MIPS: BCM47XX: Use "timer" trigger for status LEDs

To: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] MIPS: BCM47XX: Use "timer" trigger for status LEDs
From: Rafał Miłecki <zajec5@gmail.com>
Date: Fri, 3 Jan 2014 09:04:39 +0100
Cc: Hauke Mehrtens <hauke@hauke-m.de>, Rafał Miłecki <zajec5@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=XF3hg4lMHv6usbq/9SUwYPr6QwEsUXNWvdmhEBvtfd8=; b=mXzfO2vXrL8TqNZzOmv4yrF5HdWtq/oQu4Yz29Rv0kOqC9wEkjoFCxOWT32YyOYIHG wK/2mplflp4xkEC51rjQeTRCKAGg+SQ0NY5JzttGiHcc6Q8I8w0Zq+okPXPu/lAviJPs 48jVO34oUU2OOZa9fKVIor8NX3egO1wj5pf6uXPXzsjGYztXsbpb+XN9GaXYmsjU+gLa gd6ZzXYxg5qpaLFc1oxFvZnkS4rjRNrTPCAHfo4bUbXcsLG175RoSX7/BqqO+fyz85x9 s1X/rk/ycUkdIqwlHeeU6qK/f/2zab7DmNkskK27mw/wRBdyWPOj5oqt8yH18G8iENBi 7S7g==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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>
---
 arch/mips/bcm47xx/leds.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c
index cc141c1..28d281c 100644
--- a/arch/mips/bcm47xx/leds.c
+++ b/arch/mips/bcm47xx/leds.c
@@ -16,6 +16,16 @@
                .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),
 };
-- 
1.7.10.4


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: BCM47XX: Use "timer" trigger for status LEDs, Rafał Miłecki <=