From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/23] IGEPv2: Use Red Led1 as Heartbeat if configured
Date: Wed, 17 Feb 2010 17:32:33 -0800 [thread overview]
Message-ID: <20100218013233.32075.60849.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100218013012.32075.43788.stgit@baageli.muru.com>
From: Jonas Zetterberg <jozz@jozz.se>
If not configured it will be exported as normal GPIO led.
Signed-off-by: Jonas Zetterberg <jozz@jozz.se>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-igep0020.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 4a5d663..748f418 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)
@@ -456,14 +482,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)) {
next prev parent reply other threads:[~2010-02-18 1:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 1:31 [PATCH 00/23] Series short description Tony Lindgren
2010-02-18 1:31 ` [PATCH 01/23] omap: zoom3: enable ehci support Tony Lindgren
2010-02-18 1:31 ` [PATCH 02/23] omap3evm: Add mux settings for keypad Tony Lindgren
2010-02-18 1:31 ` [PATCH 03/23] omap3evm: Fixes after moving to matrix_keypad Tony Lindgren
2010-02-18 1:31 ` [PATCH 04/23] omap3evm: Configure GPIO175 for touchscreen PEN_IRQ Tony Lindgren
2010-02-18 1:32 ` [PATCH 05/23] OMAP: pandora: add DSS2 support and related regulators Tony Lindgren
2010-02-18 1:32 ` [PATCH 06/23] omap3: pandora: update regulator setup Tony Lindgren
2010-02-18 1:32 ` [PATCH 07/23] omap3: pandora: update defconfig Tony Lindgren
2010-02-18 1:32 ` [PATCH 08/23] omap3: Add platform data for the twl4030_codec MFD on IGEP v2 Tony Lindgren
2010-02-18 1:32 ` [PATCH 09/23] omap3: Fix typo on IGEP v2 board Tony Lindgren
2010-02-18 1:32 ` [PATCH 10/23] omap3: Add platform init code for EHCI driver on IGEP v2 Tony Lindgren
2010-02-18 1:32 ` [PATCH 11/23] omap3: Enable DSS2 for IGEP v2 board Tony Lindgren
2010-02-18 1:32 ` [PATCH 12/23] omap3: Add support for flash on " Tony Lindgren
2010-02-18 1:32 ` [PATCH 13/23] ARM: OMAP3: SDRC: add timing data for Numonyx M65KxxxxAM Tony Lindgren
2010-02-18 1:32 ` [PATCH 14/23] omap3: Use timing data for omap2_init_common_hw on IGEP v2 Tony Lindgren
2010-02-18 1:32 ` [PATCH 15/23] omap3: Update defconfig for IGEP v2 to allow new drivers andfeatures Tony Lindgren
2010-02-18 1:32 ` [PATCH 16/23] IGEPv2: Added WIFI support Tony Lindgren
2010-02-18 1:32 ` Tony Lindgren [this message]
2010-02-18 1:32 ` [PATCH 18/23] AM3517: Enable basic I2C Support Tony Lindgren
2010-02-18 1:32 ` [PATCH 19/23] AM3517: Enable RTC driver support for AM3517EVM Tony Lindgren
2010-02-18 1:32 ` [PATCH 20/23] AM3517: Enable I2C-GPIO Expander " Tony Lindgren
2010-02-18 1:32 ` [PATCH 21/23] Add minimal support for DevKit8000 Tony Lindgren
2010-02-18 1:32 ` [PATCH 22/23] Add devkit8000_defconfig Tony Lindgren
2010-02-18 1:32 ` [PATCH 23/23] OMAP3EVM: PM: Update defconfig Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100218013233.32075.60849.stgit@baageli.muru.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).