phonesdk: add mpu3050 sensors
authorlyx <lyx@rock-chips.com>
Tue, 14 Jun 2011 03:16:34 +0000 (20:16 -0700)
committerlyx <lyx@rock-chips.com>
Tue, 14 Jun 2011 03:21:24 +0000 (20:21 -0700)
arch/arm/configs/rk29_phonesdk_defconfig [changed mode: 0644->0755]
arch/arm/mach-rk29/board-rk29-phonesdk.c

old mode 100644 (file)
new mode 100755 (executable)
index 70c976c..147d705
@@ -651,8 +651,29 @@ CONFIG_GPS_GNS7560=y
 # Motion Sensors Support
 #
 # CONFIG_MPU_NONE is not set
-# CONFIG_SENSORS_MPU3050 is not set
+CONFIG_SENSORS_MPU3050=y
 # CONFIG_SENSORS_MPU6000 is not set
+# CONFIG_SENSORS_ACCELEROMETER_NONE is not set
+# CONFIG_SENSORS_ADXL346 is not set
+# CONFIG_SENSORS_BMA150 is not set
+# CONFIG_SENSORS_BMA222 is not set
+# CONFIG_SENSORS_KXSD9 is not set
+CONFIG_SENSORS_KXTF9=y
+# CONFIG_SENSORS_LIS331DLH is not set
+# CONFIG_SENSORS_LSM303DLHA is not set
+# CONFIG_SENSORS_MMA8450 is not set
+# CONFIG_SENSORS_MMA8451 is not set
+# CONFIG_SENSORS_COMPASS_NONE is not set
+CONFIG_SENSORS_AK8975=y
+# CONFIG_SENSORS_MMC314X is not set
+# CONFIG_SENSORS_AMI30X is not set
+# CONFIG_SENSORS_HMC5883 is not set
+# CONFIG_SENSORS_LSM303DLHM is not set
+# CONFIG_SENSORS_YAS529 is not set
+# CONFIG_SENSORS_HSCDTD00XX is not set
+CONFIG_SENSORS_PRESSURE_NONE=y
+# CONFIG_SENSORS_BMA085 is not set
+# CONFIG_SENSORS_MPU_DEBUG is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
@@ -887,7 +908,7 @@ CONFIG_INPUT_WM831X_ON=y
 # CONFIG_MAG_SENSORS is not set
 CONFIG_G_SENSOR_DEVICE=y
 # CONFIG_GS_MMA7660 is not set
-CONFIG_GS_MMA8452=y
+# CONFIG_GS_MMA8452 is not set
 # CONFIG_GS_L3G4200D is not set
 # CONFIG_INPUT_JOGBALL is not set
 # CONFIG_LIGHT_SENSOR_DEVICE is not set
index 5fa25ecdd46253beeb9c86626de757085e1d03ff..84604ed82fd9f0f41cdcbf16d0c9f43d8f04593f 100755 (executable)
@@ -56,7 +56,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/i2c-gpio.h>
-
+#include <linux/mpu.h>
 #include "devices.h"
 
 #if defined(CONFIG_MTK23D)
@@ -546,6 +546,45 @@ static struct mma8452_platform_data mma8452_info = {
 };
 #endif
 
+#if defined (CONFIG_SENSORS_MPU3050)
+/*mpu3050*/
+static struct mpu3050_platform_data mpu3050_data = {
+               .int_config = 0x10,
+               //.orientation = { 1, 0, 0,0, -1, 0,0, 0, 1 },
+               //.orientation = { 0, 1, 0,-1, 0, 0,0, 0, -1 },
+               .orientation = { 1, 0, 0,0, 1, 0, 0, 0, 1 },
+               .level_shifter = 0,
+#if defined (CONFIG_SENSORS_KXTF9)
+               .accel = {
+                               .get_slave_descr = kxtf9_get_slave_descr ,
+                               .adapt_num = 0, // The i2c bus to which the mpu device is
+                               // connected
+                               .irq = RK29_PIN6_PC4,
+                               .bus = EXT_SLAVE_BUS_SECONDARY,  //The secondary I2C of MPU
+                               .address = 0x0f,
+                               //.orientation = { 1, 0, 0,0, 1, 0,0, 0, 1 },
+                               //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
+                               //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 },
+                               .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
+               },
+#endif
+#if defined (CONFIG_SENSORS_AK8975)
+               .compass = {
+                               .get_slave_descr = ak8975_get_slave_descr,/*ak5883_get_slave_descr,*/
+                               .adapt_num = 0, // The i2c bus to which the compass device is. 
+                               // It can be difference with mpu
+                               // connected
+                               .irq = RK29_PIN6_PC5,
+                               .bus = EXT_SLAVE_BUS_PRIMARY,
+                               .address = 0x0d,
+                               //.orientation = { -1, 0, 0,0, -1, 0,0, 0, 1 },
+                               //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
+                               .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
+               },
+#endif
+};
+#endif
+
 #if defined(CONFIG_GPIO_WM831X)
 struct rk29_gpio_expander_info  wm831x_gpio_settinginfo[] = {
        {
@@ -1763,6 +1802,15 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .platform_data  = &l3g4200d_info,
        },
 #endif
+#if defined (CONFIG_SENSORS_MPU3050) 
+       {
+               .type                   = "mpu3050",
+               .addr                   = 0x68,
+               .flags                  = 0,
+               .irq                    = RK29_PIN4_PC4,
+               .platform_data  = &mpu3050_data,
+       },
+#endif
 };
 #endif