From: lw Date: Wed, 7 Mar 2012 07:36:45 +0000 (+0800) Subject: rk30:add leds support for sdk X-Git-Tag: firefly_0821_release~9595^2~82 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bede08105c8debe09d2fe759d20eae54932b90e9;p=firefly-linux-kernel-4.4.55.git rk30:add leds support for sdk --- diff --git a/arch/arm/mach-rk30/board-rk30-sdk.c b/arch/arm/mach-rk30/board-rk30-sdk.c index 4c80b0c4905a..9207d29ffc76 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk.c +++ b/arch/arm/mach-rk30/board-rk30-sdk.c @@ -505,6 +505,33 @@ struct platform_device rk29_device_vibrator ={ }; #endif +#ifdef CONFIG_LEDS_GPIO_PLATFORM +struct gpio_led rk29_leds[] = { + { + .name = "rk30_keyboard_led", + .gpio = RK30_PIN4_PD7, + .default_trigger = "timer", + .active_low = 0, + .retain_state_suspended = 0, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, +}; + +struct gpio_led_platform_data rk29_leds_pdata = { + .leds = &rk29_leds, + .num_leds = ARRAY_SIZE(rk29_leds), +}; + +struct platform_device rk29_device_gpio_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &rk29_leds_pdata, + }, +}; +#endif + + static struct platform_device *devices[] __initdata = { #ifdef CONFIG_BACKLIGHT_RK29_BL @@ -516,6 +543,10 @@ static struct platform_device *devices[] __initdata = { #ifdef CONFIG_ANDROID_TIMED_GPIO &rk29_device_vibrator, #endif +#ifdef CONFIG_LEDS_GPIO_PLATFORM + &rk29_device_gpio_leds, +#endif + };