From 5415fb99ac5b9f638199db2e09a86a82ccbdd44b Mon Sep 17 00:00:00 2001 From: luowei Date: Wed, 26 Sep 2012 19:37:59 +0800 Subject: [PATCH] phonepad:add light sensor isl29023 support --- .../arm/configs/rk30_phonepad_c8003_defconfig | 2 + arch/arm/mach-rk30/board-rk30-phonepad.c | 41 +++++++++++++++---- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/arch/arm/configs/rk30_phonepad_c8003_defconfig b/arch/arm/configs/rk30_phonepad_c8003_defconfig index 57924ec53264..cfe08bd91f29 100755 --- a/arch/arm/configs/rk30_phonepad_c8003_defconfig +++ b/arch/arm/configs/rk30_phonepad_c8003_defconfig @@ -256,6 +256,8 @@ CONFIG_GSENSOR_DEVICE=y CONFIG_GS_KXTIK=y CONFIG_COMPASS_DEVICE=y CONFIG_GYROSCOPE_DEVICE=y +CONFIG_LIGHT_DEVICE=y +CONFIG_LS_ISL29023=y # CONFIG_SERIO is not set # CONFIG_CONSOLE_TRANSLATIONS is not set # CONFIG_LEGACY_PTYS is not set diff --git a/arch/arm/mach-rk30/board-rk30-phonepad.c b/arch/arm/mach-rk30/board-rk30-phonepad.c index 428d72a604c5..9406f968eef3 100755 --- a/arch/arm/mach-rk30/board-rk30-phonepad.c +++ b/arch/arm/mach-rk30/board-rk30-phonepad.c @@ -837,7 +837,7 @@ struct goodix_platform_data goodix_info = { #define TOUCH_INT_PIN RK30_PIN4_PC2 int ft5306_init_platform_hw(void) { - printk("ft5406_init_platform_hw\n"); + printk("ft5306_init_platform_hw\n"); rk30_mux_api_set(GPIO4C2_SMCDATA2_TRACEDATA2_NAME, 0); if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){ @@ -888,14 +888,17 @@ int ft5306_platform_wakeup(void) } struct ft5x0x_platform_data ft5306_info = { - .max_x = 1024, - .max_y = 768, - .key_min_x = 1024, - .init_platform_hw= ft5306_init_platform_hw, - .exit_platform_hw= ft5306_exit_platform_hw, - .ft5x0x_platform_sleep = ft5306_platform_sleep, - .ft5x0x_platform_wakeup = ft5306_platform_wakeup, - + .model = 5306, + .max_x = 1024, + .max_y = 768, + .key_min_x = 1024, + .xy_swap = 1, + .x_revert = 1, + .y_revert = 0, + .init_platform_hw= ft5306_init_platform_hw, + .exit_platform_hw= ft5306_exit_platform_hw, + .ft5x0x_platform_sleep = ft5306_platform_sleep, + .ft5x0x_platform_wakeup = ft5306_platform_wakeup, }; @@ -1523,6 +1526,15 @@ static struct sensor_platform_data light_stk3171_info = { }; #endif +#if defined(CONFIG_LS_ISL29023) +static struct sensor_platform_data light_isl29023_info = { + .type = SENSOR_TYPE_LIGHT, + .irq_enable = 1, + .poll_delay_ms = 200, +}; +#endif + + #ifdef CONFIG_FB_ROCKCHIP @@ -2569,6 +2581,17 @@ static struct i2c_board_info __initdata i2c2_info[] = { .platform_data = &goodix_info, }, #endif + +#if defined (CONFIG_LS_ISL29023) + { + .type = "ls_isl29023", + .addr = 0x44, + .flags = 0, + .irq = RK30_PIN4_PC6, + .platform_data = &light_isl29023_info, + }, +#endif + }; #endif -- 2.34.1