From deabf556a50b94d328343344a0706434c6669d5c Mon Sep 17 00:00:00 2001 From: lw Date: Wed, 13 Jun 2012 18:56:56 +0800 Subject: [PATCH] rk30_phone_loquat:use new sensors driver --- arch/arm/configs/rk30_phone_loquat_defconfig | 14 +++-- arch/arm/mach-rk30/board-rk30-phone-loquat.c | 59 +++++++++++++++++--- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/arch/arm/configs/rk30_phone_loquat_defconfig b/arch/arm/configs/rk30_phone_loquat_defconfig index edcec87c9b2c..dc46923709f1 100755 --- a/arch/arm/configs/rk30_phone_loquat_defconfig +++ b/arch/arm/configs/rk30_phone_loquat_defconfig @@ -237,17 +237,20 @@ CONFIG_RMI4_F1A=y CONFIG_RMI4_F11=y CONFIG_RMI4_F34=y CONFIG_INPUT_MISC=y -CONFIG_INPUT_LPSENSOR_AL3006=y CONFIG_INPUT_KEYCHORD=y CONFIG_INPUT_TWL6030_PWRBUTTON=y CONFIG_INPUT_UINPUT=y -CONFIG_MAG_SENSORS=y CONFIG_COMPASS_AK8975=y -CONFIG_G_SENSOR_DEVICE=y CONFIG_GS_MMA8452=y -CONFIG_GYRO_SENSOR_DEVICE=y CONFIG_GYRO_L3G4200D=y -CONFIG_LIGHT_SENSOR_DEVICE=y +CONFIG_SENSOR_DEVICE=y +CONFIG_GSENSOR_DEVICE=y +CONFIG_COMPASS_DEVICE=y +CONFIG_GYROSCOPE_DEVICE=y +CONFIG_LIGHT_DEVICE=y +CONFIG_LS_AL3006=y +CONFIG_PROXIMITY_DEVICE=y +CONFIG_PS_AL3006=y # CONFIG_SERIO is not set # CONFIG_CONSOLE_TRANSLATIONS is not set # CONFIG_LEGACY_PTYS is not set @@ -298,7 +301,6 @@ CONFIG_DISPLAY_SUPPORT=y CONFIG_LCD_HJ050NA_06A=y CONFIG_FB_ROCKCHIP=y CONFIG_LCDC_RK30=y -# CONFIG_LCDC1_RK30 is not set CONFIG_RGA_RK30=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set diff --git a/arch/arm/mach-rk30/board-rk30-phone-loquat.c b/arch/arm/mach-rk30/board-rk30-phone-loquat.c index 482e156d934b..777c9416c149 100755 --- a/arch/arm/mach-rk30/board-rk30-phone-loquat.c +++ b/arch/arm/mach-rk30/board-rk30-phone-loquat.c @@ -46,7 +46,7 @@ #include #include #endif - +#include #include #include @@ -886,10 +886,10 @@ static int mma8452_init_platform_hw(void) return 0; } -static struct gsensor_platform_data mma8452_info = { - .model = 8452, - .swap_xy = 0, - .swap_xyz = 1, +static struct sensor_platform_data mma8452_info = { + .type = SENSOR_TYPE_ACCEL, + .irq_enable = 1, + .poll_delay_ms = 30, .init_platform_hw = mma8452_init_platform_hw, .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0}, }; @@ -949,8 +949,11 @@ struct platform_device rk_device_headset = { #endif #if defined (CONFIG_COMPASS_AK8975) -static struct akm8975_platform_data akm8975_info = +static struct sensor_platform_data akm8975_info = { + .type = SENSOR_TYPE_COMPASS, + .irq_enable = 1, + .poll_delay_ms = 30, .m_layout = { { @@ -993,9 +996,12 @@ static int l3g4200d_init_platform_hw(void) return 0; } -static struct l3g4200d_platform_data l3g4200d_info = { +static struct sensor_platform_data l3g4200d_info = { + .type = SENSOR_TYPE_GYROSCOPE, + .irq_enable = 1, + .poll_delay_ms = 30, .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1}, - .init = l3g4200d_init_platform_hw, + .init_platform_hw = l3g4200d_init_platform_hw, .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware .y_min = 40, .z_min = 20, @@ -1044,6 +1050,23 @@ static struct cm3217_platform_data cm3217_info = { }; #endif +#if defined(CONFIG_PS_AL3006) +static struct sensor_platform_data proximity_info = { + .type = SENSOR_TYPE_PROXIMITY, + .irq_enable = 1, + .poll_delay_ms = 200, +}; +#endif + +#if defined(CONFIG_LS_AL3006) +static struct sensor_platform_data light_info = { + .type = SENSOR_TYPE_LIGHT, + .irq_enable = 1, + .poll_delay_ms = 200, +}; +#endif + + #ifdef CONFIG_FB_ROCKCHIP /***************************************************************************************** @@ -1724,6 +1747,26 @@ static struct i2c_board_info __initdata i2c0_info[] = { .irq = RK30_PIN6_PA2, }, #endif +#if defined (CONFIG_LS_AL3006) + { + .type = "light_al3006", + .addr = 0x1c, //sel = 0; if sel =1, then addr = 0x1D + .flags = 0, + .irq = RK30_PIN6_PA2, + .platform_data = &light_info, + }, +#endif + +#if defined (CONFIG_PS_AL3006) + { + .type = "proximity_al3006", + .addr = 0x1c, //sel = 0; if sel =1, then addr = 0x1D + .flags = 0, + .irq = RK30_PIN6_PA2, + .platform_data = &proximity_info, + }, +#endif + #if defined (CONFIG_SND_SOC_RK1000) { .type = "rk1000_i2c_codec", -- 2.34.1