Skip to content

Commit

Permalink
ARM: pxa: Add gpio-leds and vibrator support to PalmTC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Vasut authored and Eric Miao committed Dec 20, 2010
1 parent 4c6a832 commit 5fe2acc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions arch/arm/mach-pxa/palmtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,46 @@ static void __init palmtc_ts_init(void)
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
******************************************************************************/
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5fe2acc

Please sign in to comment.