All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] IGEPv2: Use Red Led1 as Heartbeat if configured
@ 2010-02-14 19:33 Jonas Zetterberg
  2010-02-18  0:57 ` [APPLIED] " Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Zetterberg @ 2010-02-14 19:33 UTC (permalink / raw)
  To: linux-omap; +Cc: Enric Balletbò i Serra, Anders Hedlund

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]


If not configured it will be exported as normal GPIO led.

Signed-off-by: Jonas Zetterberg <jozz@jozz.se>
---
  arch/arm/mach-omap2/board-igep0020.c |   30 ++++++++++++++++++++++++++++--
  1 files changed, 28 insertions(+), 2 deletions(-)



[-- Attachment #2: 0002-IGEPv2-Use-Red-Led1-as-Heartbeat-if-configured.patch --]
[-- Type: text/x-patch, Size: 1911 bytes --]

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 00ea2d6..9958987 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -16,6 +16,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/leds.h>
 #include <linux/interrupt.h>
 
 #include <linux/regulator/machine.h>
@@ -354,9 +355,34 @@ static void __init igep2_display_init(void)
 	    gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1))
 		pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");
 }
+#ifdef CONFIG_LEDS_TRIGGERS
+static struct gpio_led gpio_leds[] = {
+	{
+		.name = "GPIO_LED1_RED",
+		.default_trigger = "heartbeat",
+		.gpio = IGEP2_GPIO_LED1_RED,
+	},
+};
+
+static struct gpio_led_platform_data gpio_leds_info = {
+	.leds           = gpio_leds,
+	.num_leds       = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+	 .name   = "leds-gpio",
+	 .id     = -1,
+	 .dev    = {
+		 .platform_data  =  &gpio_leds_info,
+	},
+};
+#endif
 
 static struct platform_device *igep2_devices[] __initdata = {
 	&igep2_dss_device,
+#ifdef CONFIG_LEDS_TRIGGERS
+	&leds_gpio,
+#endif
 };
 
 static void __init igep2_init_irq(void)
@@ -462,14 +488,14 @@ static void __init igep2_init(void)
 		gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);
 	} else
 		pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n");
-
+#ifndef CONFIG_LEDS_TRIGGERS
 	if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) &&
 	    (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {
 		gpio_export(IGEP2_GPIO_LED1_RED, 0);
 		gpio_set_value(IGEP2_GPIO_LED1_RED, 0);
 	} else
 		pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");
-
+#endif
 	/* GPIO W-LAN + Bluetooth combo module */
 	if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) &&
 	    (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [APPLIED] [PATCH 2/2] IGEPv2: Use Red Led1 as Heartbeat if configured
  2010-02-14 19:33 [PATCH 2/2] IGEPv2: Use Red Led1 as Heartbeat if configured Jonas Zetterberg
@ 2010-02-18  0:57 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2010-02-18  0:57 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: for-next

Initial commit ID (Likely to change): 85ac89e2c373f6eef4908accf6afd5cbe2cd7c96

PatchWorks
http://patchwork.kernel.org/patch/79313/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=85ac89e2c373f6eef4908accf6afd5cbe2cd7c96



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-18  0:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-14 19:33 [PATCH 2/2] IGEPv2: Use Red Led1 as Heartbeat if configured Jonas Zetterberg
2010-02-18  0:57 ` [APPLIED] " Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.