diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-08-09 06:13:06 +0200 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-20 23:07:46 +0800 |
commit | 5fe2acce127638ccf1123e8a079ca12e8db5b7c1 (patch) | |
tree | aab7c21aa996a60aaea7b5d9069042e5cf63ab95 /arch/arm/mach-pxa/palmtc.c | |
parent | 4c6a832d2841a3bacc3327380dfc0660c22a71fb (diff) | |
download | linux-5fe2acce127638ccf1123e8a079ca12e8db5b7c1.tar.gz linux-5fe2acce127638ccf1123e8a079ca12e8db5b7c1.tar.bz2 linux-5fe2acce127638ccf1123e8a079ca12e8db5b7c1.zip |
ARM: pxa: Add gpio-leds and vibrator support to PalmTC
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/palmtc.c')
-rw-r--r-- | arch/arm/mach-pxa/palmtc.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 73de8c596f19..a09a2374697b 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c @@ -382,6 +382,46 @@ static inline void palmtc_ts_init(void) {} #endif /****************************************************************************** + * LEDs + ******************************************************************************/ +#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +struct gpio_led palmtc_gpio_leds[] = { +{ + .name = "palmtc:green:user", + .default_trigger = "none", + .gpio = GPIO_NR_PALMTC_LED_POWER, + .active_low = 1, +}, { + .name = "palmtc:vibra:vibra", + .default_trigger = "none", + .gpio = GPIO_NR_PALMTC_VIBRA_POWER, + .active_low = 1, +} + +}; + +static struct gpio_led_platform_data palmtc_gpio_led_info = { + .leds = palmtc_gpio_leds, + .num_leds = ARRAY_SIZE(palmtc_gpio_leds), +}; + +static struct platform_device palmtc_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &palmtc_gpio_led_info, + } +}; + +static void __init palmtc_leds_init(void) +{ + platform_device_register(&palmtc_leds); +} +#else +static inline void palmtc_leds_init(void) {} +#endif + +/****************************************************************************** * NOR Flash ******************************************************************************/ #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) @@ -494,6 +534,7 @@ static void __init palmtc_init(void) palmtc_ts_init(); palmtc_nor_init(); palmtc_lcd_init(); + palmtc_leds_init(); }; MACHINE_START(PALMTC, "Palm Tungsten|C") |