gsensor:add lis3dh support
authorlw <lw@rock-chips.com>
Wed, 23 May 2012 07:36:26 +0000 (15:36 +0800)
committerlw <lw@rock-chips.com>
Wed, 23 May 2012 07:36:26 +0000 (15:36 +0800)
arch/arm/mach-rk30/board-rk30-phone-loquat.c
drivers/input/gsensor/Makefile

index b764fd96eb1e21269bdb623622df4a909f44dfb9..c0df9367017a7c3cd7a4d4c34e82ea58c91fd060 100755 (executable)
@@ -821,6 +821,26 @@ static struct gsensor_platform_data mma8452_info = {
 };
 #endif
 
+#if defined (CONFIG_GS_LIS3DH)
+#define LIS3DH_INT_PIN   RK30_PIN4_PC0
+
+static int lis3dh_init_platform_hw(void)
+{
+       rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
+
+       return 0;
+}
+
+static struct gsensor_platform_data lis3dh_info = {
+       .model = 8452,
+       .swap_xy = 0,
+       .swap_xyz = 1,
+       .init_platform_hw = lis3dh_init_platform_hw,
+       .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0},
+};
+#endif
+
+
 #if defined (CONFIG_RK_HEADSET_DET) || defined (CONFIG_RK_HEADSET_IRQ_HOOK_ADC_DET)
 
 static int rk_headset_io_init(int gpio, char *iomux_name, int iomux_mode)
@@ -1535,6 +1555,16 @@ static struct i2c_board_info __initdata i2c0_info[] = {
                .platform_data = &mma8452_info,
        },
 #endif
+#if defined (CONFIG_GS_LIS3DH)
+       {
+               .type           = "lis3dh",
+               .addr           = 0x19,
+               .flags          = 0,
+               .irq            = LIS3DH_INT_PIN,
+               .platform_data = &lis3dh_info,
+       },
+#endif
+
 #if defined (CONFIG_COMPASS_AK8975)
        {
                .type          = "ak8975",
index f1bdebf8c1f8ae2925533b9ed640a25ef9822aab..55e9bc973f5067826c4617d80a6030349355273b 100755 (executable)
@@ -4,5 +4,5 @@ obj-$(CONFIG_GS_MMA7660)        += mma7660.o
 obj-$(CONFIG_GS_MMA8452)       += mma8452.o
 obj-$(CONFIG_GS_L3G4200D)      += l3g4200d.o
 obj-$(CONFIG_GS_KXTF9)         += kxtf9.o
-obj-$(CONFIG_GS_LIS3DH)                += lis3dh_acc_misc.o
+obj-$(CONFIG_GS_LIS3DH)                += lis3dh.o
 obj-$(CONFIG_GS_BMA023)        += bma023.o