phonepad:add mma7660 support
authorlw <lw@rock-chips.com>
Wed, 12 Sep 2012 09:56:18 +0000 (17:56 +0800)
committerlw <lw@rock-chips.com>
Wed, 12 Sep 2012 09:59:25 +0000 (17:59 +0800)
arch/arm/configs/rk30_phonepad_c8003_defconfig
arch/arm/mach-rk30/board-rk30-phonepad.c

index de15e700eccbf18f1e6542e182e21d333fd13909..256598c9bb5a24989ec235880b7164a6c3dffa3a 100755 (executable)
@@ -247,6 +247,7 @@ CONFIG_INPUT_MISC=y
 CONFIG_INPUT_KEYCHORD=y
 CONFIG_INPUT_UINPUT=y
 CONFIG_COMPASS_AK8975=y
+CONFIG_GS_MMA7660=y
 CONFIG_GS_MMA8452=y
 CONFIG_GS_LIS3DH=y
 CONFIG_GYRO_L3G4200D=y
index 5a01a3899d38dc1731f54aae80324817a3aa2e18..dd6611489f8601f976652da78762c9c50ee4adbe 100755 (executable)
@@ -1224,6 +1224,27 @@ static struct sensor_platform_data kxtik_info = {
 };
 
 #endif
+
+/*MMA7660 gsensor*/
+#if defined (CONFIG_GS_MMA7660)
+#define MMA7660_INT_PIN   RK30_PIN4_PC0
+
+static int mma7660_init_platform_hw(void)
+{
+       rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
+
+       return 0;
+}
+
+static struct sensor_platform_data mma7660_info = {
+       .type = SENSOR_TYPE_ACCEL,
+       .irq_enable = 1,
+       .poll_delay_ms = 30,
+        .init_platform_hw = mma7660_init_platform_hw,
+        .orientation = {1, 0, 0, 0, 0, -1, 0, -1, 0},
+};
+#endif
+
 #if defined (CONFIG_COMPASS_AK8975)
 static struct sensor_platform_data akm8975_info =
 {
@@ -2034,6 +2055,15 @@ static struct i2c_board_info __initdata i2c0_info[] = {
        },
 #endif
 
+#if defined (CONFIG_GS_MMA7660)
+       {
+               .type           = "gs_mma7660",
+               .addr           = 0x4c,
+               .flags          = 0,
+               .irq            = MMA7660_INT_PIN,
+               .platform_data = &mma7660_info,
+       },
+#endif
 
 #if defined (CONFIG_COMPASS_AK8975)
        {