rk2928-phonepad-sdk: add kxtik gsensor support
authorlinjh <linjh@rock-chips.com>
Tue, 9 Oct 2012 14:43:22 +0000 (22:43 +0800)
committerlinjh <linjh@rock-chips.com>
Tue, 9 Oct 2012 14:43:22 +0000 (22:43 +0800)
[reference files]

modified:
    arch/arm/configs/rk2928_phonepad_defconfig
        arch/arm/mach-rk2928/board-rk2928-phonepad.c

arch/arm/configs/rk2928_phonepad_defconfig
arch/arm/mach-rk2928/board-rk2928-phonepad.c

index 92508e9da614c10db5da48f8cecb0b55ad58d121..e9893dbad88a20518ba4503622f71856497295ac 100644 (file)
@@ -240,9 +240,9 @@ CONFIG_TOUCHSCREEN_I30=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_KEYCHORD=y
 CONFIG_INPUT_UINPUT=y
-CONFIG_GS_MMA7660=y
 CONFIG_SENSOR_DEVICE=y
 CONFIG_GSENSOR_DEVICE=y
+CONFIG_GS_KXTIK=y
 # CONFIG_SERIO is not set
 # CONFIG_CONSOLE_TRANSLATIONS is not set
 # CONFIG_LEGACY_PTYS is not set
index b85cd2e3db8e116120282cfe8e544afa1e16c050..d78acdef9a1906985e2ebffe1e544da99745459b 100755 (executable)
@@ -395,10 +395,9 @@ static struct sensor_platform_data mma7660_info = {
 };
 #endif
 
-#ifdef CONFIG_GS_KXTIK
-
+#if defined (CONFIG_GS_KXTIK)
 #define KXTIK_INT_PIN         RK2928_PIN3_PD1
-
+#if 0
 static int kxtik_init_hw(void)
 {
        int ret = 0;
@@ -425,7 +424,21 @@ static struct gsensor_platform_data kxtik_pdata = {
        .exit_platform_hw = kxtik_exit_hw,
        .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0},
 };
+#endif
+static int kxtik_init_platform_hw(void)
+{
+       printk("%s: >>>>>>>>>>>>>>>>\n\n\n", __func__);
+       return 0;
+}
 
+static struct sensor_platform_data kxtik_pdata = {
+       .type = SENSOR_TYPE_ACCEL,
+       .irq_enable = 1,
+       .poll_delay_ms = 30,
+       .init_platform_hw = kxtik_init_platform_hw,
+       .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0},
+       //.orientation = {0, 1, 0, 0, 0, -1, 1, 0, 0},
+};
 #endif /* CONFIG_GS_KXTIK*/
 
 #ifdef CONFIG_INPUT_AP321XX
@@ -754,8 +767,11 @@ static struct i2c_board_info __initdata i2c1_info[] = {
                },
 #endif
 
-#ifdef CONFIG_GS_KXTIK
-               {               I2C_BOARD_INFO("kxtik", 0x0F),
+#if defined (CONFIG_GS_KXTIK)
+               {
+                               .type           = "gs_kxtik",
+                               .addr           = 0x0F,
+                               .flags          = 0,
                                .platform_data = &kxtik_pdata,
                                .irq = KXTIK_INT_PIN, // Replace with appropriate GPIO setup
                },