rk2928: sdk: add gsensor mxc6225 support
authorgy@rock-chips.com <gy@rock-chips.com>
Thu, 22 Nov 2012 08:27:11 +0000 (16:27 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 22 Nov 2012 13:16:36 +0000 (21:16 +0800)
arch/arm/mach-rk2928/board-rk2928-sdk.c

index 656791a697288adc542b232528982bfcea82702b..295606ed211b53337c95732207c00b3791d0fa4a 100755 (executable)
@@ -423,6 +423,23 @@ static struct sensor_platform_data mma7660_info = {
 };
 #endif
 
+#if defined (CONFIG_GS_MXC6225)
+#define MXC6225_INT_PIN   RK2928_PIN3_PD1
+
+static int mxc6225_init_platform_hw(void)
+{
+       rk30_mux_api_set(GPIO1B1_SPI_TXD_UART1_SOUT_NAME, GPIO1B_GPIO1B1);
+       return 0;
+}
+
+static struct sensor_platform_data mxc6225_info = {
+       .type = SENSOR_TYPE_ACCEL,
+       .irq_enable = 0,
+       .poll_delay_ms = 30,
+       .init_platform_hw = mxc6225_init_platform_hw,
+       .orientation = { 0, 0, 0, 0, 1, 0, 1, 0, 0 },
+};
+#endif
 
 #if CONFIG_RK30_PWM_REGULATOR
 static int pwm_voltage_map[] = {
@@ -895,7 +912,15 @@ static struct i2c_board_info __initdata i2c1_info[] = {
                        .platform_data = &mma7660_info,
                },
 #endif
-
+#if defined (CONFIG_GS_MXC6225)
+       {
+               .type           = "gs_mxc6225",
+               .addr           = 0x15,
+               .flags          = 0,
+               .irq            = MXC6225_INT_PIN,
+               .platform_data  = &mxc6225_info,
+       },
+#endif
 };
 #endif
 #ifdef CONFIG_I2C2_RK30