rk30_phone_loquat:use new sensors driver
authorlw <lw@rock-chips.com>
Wed, 13 Jun 2012 10:56:56 +0000 (18:56 +0800)
committerlw <lw@rock-chips.com>
Wed, 13 Jun 2012 10:56:56 +0000 (18:56 +0800)
arch/arm/configs/rk30_phone_loquat_defconfig
arch/arm/mach-rk30/board-rk30-phone-loquat.c

index edcec87c9b2ca16400472aebfdf62758355e4c81..dc46923709f1b64ae810968d9210f26c686e15e1 100755 (executable)
@@ -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
index 482e156d934b59fcb1f5c267a66d09be751ee717..777c9416c149992d14f7e7381199a904e354fbfa 100755 (executable)
@@ -46,7 +46,7 @@
 #include <linux/interrupt.h>
 #include <linux/rmi.h>
 #endif
-
+#include <linux/sensor-dev.h>
 #include <linux/regulator/machine.h>
 #include <linux/rfkill-rk.h>
 
@@ -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",