]> Pileus Git - ~andy/linux/commitdiff
[ARM] pxa/ezx: add leds-lp3944 support for A910 EZX phone
authorAntonio Ospite <ospite@studenti.unina.it>
Tue, 3 Nov 2009 16:45:33 +0000 (17:45 +0100)
committerEric Miao <eric.y.miao@gmail.com>
Tue, 1 Dec 2009 01:03:03 +0000 (09:03 +0800)
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
arch/arm/mach-pxa/ezx.c

index 320e2f8c599edaff626d8e5b539bf5e33f2bcd14..626c82b1397031bef376ddf1acbfd5feb8a9fe41 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
+#include <linux/leds-lp3944.h>
 
 #include <media/soc_camera.h>
 
@@ -1037,6 +1038,57 @@ static struct platform_device a910_camera = {
        },
 };
 
+/* leds-lp3944 */
+static struct lp3944_platform_data a910_lp3944_leds = {
+       .leds_size = LP3944_LEDS_MAX,
+       .leds = {
+               [0] = {
+                       .name = "a910:red:",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED,
+               },
+               [1] = {
+                       .name = "a910:green:",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED,
+               },
+               [2] {
+                       .name = "a910:blue:",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED,
+               },
+               /* Leds 3 and 4 are used as display power switches */
+               [3] = {
+                       .name = "a910::cli_display",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED_INVERTED
+               },
+               [4] = {
+                       .name = "a910::main_display",
+                       .status = LP3944_LED_STATUS_ON,
+                       .type = LP3944_LED_TYPE_LED_INVERTED
+               },
+               [5] = { .type = LP3944_LED_TYPE_NONE },
+               [6] = {
+                       .name = "a910::torch",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED,
+               },
+               [7] = {
+                       .name = "a910::flash",
+                       .status = LP3944_LED_STATUS_OFF,
+                       .type = LP3944_LED_TYPE_LED_INVERTED,
+               },
+       },
+};
+
+static struct i2c_board_info __initdata a910_i2c_board_info[] = {
+       {
+               I2C_BOARD_INFO("lp3944", 0x60),
+               .platform_data = &a910_lp3944_leds,
+       },
+};
+
 static struct platform_device *a910_devices[] __initdata = {
        &a910_gpio_keys,
 };
@@ -1052,6 +1104,7 @@ static void __init a910_init(void)
        pxa_set_stuart_info(NULL);
 
        pxa_set_i2c_info(NULL);
+       i2c_register_board_info(0, ARRAY_AND_SIZE(a910_i2c_board_info));
 
        set_pxa_fb_info(&ezx_fb_info_2);