Skip to contentSkip to conversation

MIPS: BCM47XX: Use "timer" trigger for status LEDs

PATCH New Rafał Miłecki 1 participant 1 message Jan 3, 2014

Subsystems (2)
lore
Share & tools
lore

Rafał Miłecki

author maintainer
#0 lore raw

PATCH 1/1 MIPS: BCM47XX: Use "timer" trigger for status LEDs

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.

---
 arch/mips/bcm47xx/leds.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
arch/mips/bcm47xx/leds.c +12 -2
index cc141c1..28d281c 100644
@@ -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),
 };
Signature · 1 line
1.7.10.4