aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-11-19 06:02:10 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2009-11-19 11:11:02 -0500
commit81057f328618181f87b25571dd9f623c86fe960e (patch)
treebce8c7c075e9fe56e6c63f82722d27dc7024db04
parenta050c8e9b70b90a3e3b808a12d985a31e19c2f95 (diff)
ARM: MX3: add support for GPIO LEDs on litekit db
The names are chosen to match the silkscreen. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index f60cf0813ced..694611d6b057 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -29,6 +29,8 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/leds.h>
33#include <linux/platform_device.h>
32 34
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
@@ -153,6 +155,36 @@ static struct spi_imx_master spi0_pdata = {
153 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), 155 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
154}; 156};
155 157
158/* GPIO LEDs */
159
160static struct gpio_led litekit_leds[] = {
161 {
162 .name = "GPIO0",
163 .gpio = IOMUX_TO_GPIO(MX31_PIN_COMPARE),
164 .active_low = 1,
165 .default_state = LEDS_GPIO_DEFSTATE_OFF,
166 },
167 {
168 .name = "GPIO1",
169 .gpio = IOMUX_TO_GPIO(MX31_PIN_CAPTURE),
170 .active_low = 1,
171 .default_state = LEDS_GPIO_DEFSTATE_OFF,
172 }
173};
174
175static struct gpio_led_platform_data litekit_led_platform_data = {
176 .leds = litekit_leds,
177 .num_leds = ARRAY_SIZE(litekit_leds),
178};
179
180static struct platform_device litekit_led_device = {
181 .name = "leds-gpio",
182 .id = -1,
183 .dev = {
184 .platform_data = &litekit_led_platform_data,
185 },
186};
187
156void __init mx31lite_db_init(void) 188void __init mx31lite_db_init(void)
157{ 189{
158 mxc_iomux_setup_multiple_pins(litekit_db_board_pins, 190 mxc_iomux_setup_multiple_pins(litekit_db_board_pins,
@@ -161,5 +193,6 @@ void __init mx31lite_db_init(void)
161 mxc_register_device(&mxc_uart_device0, &uart_pdata); 193 mxc_register_device(&mxc_uart_device0, &uart_pdata);
162 mxc_register_device(&mxcsdhc_device0, &mmc_pdata); 194 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
163 mxc_register_device(&mxc_spi_device0, &spi0_pdata); 195 mxc_register_device(&mxc_spi_device0, &spi0_pdata);
196 platform_device_register(&litekit_led_device);
164} 197}
165 198