phonepad:select all sensor items and modify orientation
authorlw <lw@rock-chips.com>
Tue, 14 Aug 2012 12:44:58 +0000 (20:44 +0800)
committerlw <lw@rock-chips.com>
Tue, 14 Aug 2012 12:44:58 +0000 (20:44 +0800)
arch/arm/configs/rk30_phonepad_defconfig
arch/arm/mach-rk30/board-rk30-phonepad.c

index 7c3d8f1fb8e27d24d84b6d6ae8416a436f71be43..d797e47a28997eec6aaef4ce657db51cf71dfab8 100755 (executable)
@@ -234,13 +234,20 @@ CONFIG_INPUT_KEYCHORD=y
 CONFIG_INPUT_UINPUT=y
 CONFIG_COMPASS_AK8975=y
 CONFIG_GS_MMA8452=y
+CONFIG_GS_LIS3DH=y
 CONFIG_GYRO_L3G4200D=y
 CONFIG_LS_CM3217=y
 CONFIG_SENSOR_DEVICE=y
 CONFIG_GSENSOR_DEVICE=y
+CONFIG_GS_KXTIK=y
 CONFIG_COMPASS_DEVICE=y
 CONFIG_GYROSCOPE_DEVICE=y
 CONFIG_LIGHT_DEVICE=y
+CONFIG_LS_AL3006=y
+CONFIG_LS_STK3171=y
+CONFIG_PROXIMITY_DEVICE=y
+CONFIG_PS_AL3006=y
+CONFIG_PS_STK3171=y
 # CONFIG_SERIO is not set
 # CONFIG_CONSOLE_TRANSLATIONS is not set
 # CONFIG_LEGACY_PTYS is not set
index c06b3936f0bce061f3573644fc5138c2eccc0c41..f70b558721ccf837f81d26c3be1f6b0260158ffe 100755 (executable)
@@ -1049,8 +1049,27 @@ static struct sensor_platform_data lis3dh_info = {
        .irq_enable = 1,
        .poll_delay_ms = 30,
         .init_platform_hw = lis3dh_init_platform_hw,
-       .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0},
+       .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0},
 };
+#endif
+#if defined (CONFIG_GS_KXTIK)
+#define KXTIK_INT_PIN   RK30_PIN4_PC0
+
+static int kxtik_init_platform_hw(void)
+{
+       rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
+
+       return 0;
+}
+
+static struct sensor_platform_data kxtik_info = {
+       .type = SENSOR_TYPE_ACCEL,
+       .irq_enable = 1,
+       .poll_delay_ms = 30,
+       .init_platform_hw = kxtik_init_platform_hw,
+       .orientation = {0, 1, 0, 0, 0, -1, 1, 0, 0},
+};
+
 #endif
 #if defined (CONFIG_COMPASS_AK8975)
 static struct sensor_platform_data akm8975_info =
@@ -1061,9 +1080,9 @@ static struct sensor_platform_data akm8975_info =
        .m_layout = 
        {
                {
-                       {1, 0, 0},
                        {0, 1, 0},
-                       {0, 0, 1},
+                       {1, 0, 0},      
+                       {0, 0, -1},
                },
 
                {
@@ -1104,7 +1123,7 @@ static struct sensor_platform_data l3g4200d_info = {
        .type = SENSOR_TYPE_GYROSCOPE,
        .irq_enable = 1,
        .poll_delay_ms = 30,
-       .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
+       .orientation = {0, 1, 0, -1, 0, 0, 0, 0, -1},
        .init_platform_hw = l3g4200d_init_platform_hw,
        .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware
        .y_min = 40,
@@ -1122,6 +1141,42 @@ static struct sensor_platform_data cm3217_info = {
 
 #endif
 
+
+#if defined(CONFIG_PS_AL3006)
+static struct sensor_platform_data proximity_al3006_info = {
+       .type = SENSOR_TYPE_PROXIMITY,
+       .irq_enable = 1,
+       .poll_delay_ms = 200,
+};
+#endif
+
+#if defined(CONFIG_PS_STK3171)
+static struct sensor_platform_data proximity_stk3171_info = {
+       .type = SENSOR_TYPE_PROXIMITY,
+       .irq_enable = 1,
+       .poll_delay_ms = 200,
+};
+#endif
+
+
+#if defined(CONFIG_LS_AL3006)
+static struct sensor_platform_data light_al3006_info = {
+       .type = SENSOR_TYPE_LIGHT,
+       .irq_enable = 1,
+       .poll_delay_ms = 200,
+};
+#endif
+
+#if defined(CONFIG_LS_STK3171)
+static struct sensor_platform_data light_stk3171_info = {
+       .type = SENSOR_TYPE_LIGHT,
+       .irq_enable = 1,
+       .poll_delay_ms = 200,
+};
+#endif
+
+
+
 #ifdef CONFIG_FB_ROCKCHIP
 
 #define LCD_CS_MUX_NAME    GPIO4C7_SMCDATA7_TRACEDATA7_NAME
@@ -1729,6 +1784,18 @@ static struct i2c_board_info __initdata i2c0_info[] = {
                .platform_data = &lis3dh_info,
        },
 #endif
+
+#if defined (CONFIG_GS_KXTIK)
+       {
+               .type           = "gs_kxtik",
+               .addr           = 0x0F,
+               .flags          = 0,
+               .irq            = KXTIK_INT_PIN,
+               .platform_data = &kxtik_info,
+       },
+#endif
+
+
 #if defined (CONFIG_COMPASS_AK8975)
        {
                .type          = "ak8975",
@@ -1747,6 +1814,56 @@ static struct i2c_board_info __initdata i2c0_info[] = {
                .platform_data = &l3g4200d_info,
        },
 #endif
+#if defined (CONFIG_INPUT_LPSENSOR_AL3006)
+       {
+               .type           = "al3006",
+               .addr           = 0x1c,             //sel = 0; if sel =1, then addr = 0x1D
+               .flags          = 0,
+               .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_al3006_info,
+       },
+#endif
+#if defined (CONFIG_LS_STK3171)
+       {
+               .type           = "ls_stk3171",
+               .addr           = 0x48,            
+               .flags          = 0,
+               .irq            = RK30_PIN6_PA2,        
+               .platform_data = &light_stk3171_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_al3006_info,
+       },
+#endif
+
+#if defined (CONFIG_PS_STK3171)
+       {
+               .type           = "ps_stk3171",
+               .addr           = 0x48,            
+               .flags          = 0,
+               .irq            = RK30_PIN6_PA2,        
+               .platform_data = &proximity_stk3171_info,
+       },
+#endif
+
+
 #if defined (CONFIG_SND_SOC_RK1000)
        {
                .type          = "rk1000_i2c_codec",
@@ -1944,7 +2061,7 @@ static struct i2c_board_info __initdata i2c2_info[] = {
 #endif
 #if defined (CONFIG_LS_CM3217)
        {
-               .type          = "lightsensor",
+               .type          = "light_cm3217",
                .addr          = 0x10,
                .flags         = 0,
                .platform_data = &cm3217_info,