add mpu3050 board struct
authorlyx <lyx@rock-chips.com>
Fri, 20 May 2011 03:04:40 +0000 (20:04 -0700)
committerlyx <lyx@rock-chips.com>
Fri, 20 May 2011 03:05:45 +0000 (20:05 -0700)
arch/arm/mach-rk29/board-rk29-a22-rfkill.c
arch/arm/mach-rk29/board-rk29-a22.c

index b28a5523a5c015ada65ef322783df5583e407037..14367abd92feac2798f3b89e097d4bdea93db8d1 100755 (executable)
@@ -45,8 +45,8 @@ struct bt_ctrl
 
 #define BT_GPIO_POWER           RK29_PIN5_PD6
 #define IOMUX_BT_GPIO_POWER     rk29_mux_api_set(GPIO5D6_SDMMC1PWREN_NAME, GPIO5H_GPIO5D6);
-#define BT_GPIO_RESET                  RK29_PIN6_PC4
-#define BT_GPIO_WAKE_UP         RK29_PIN6_PC5
+#define BT_GPIO_RESET                  RK29_PIN6_PC7
+#define BT_GPIO_WAKE_UP         RK29_PIN6_PD0
 #define BT_GPIO_WAKE_UP_HOST    //RK2818_PIN_PA7
 #define IOMUX_BT_GPIO_WAKE_UP_HOST() //rk2818_mux_api_set(GPIOA7_FLASHCS3_SEL_NAME,0);
 
index 3f1966fe00cc484804a6fd25761f513d27472a74..a9e85d13d6ef5ebce8e3b076176ef72e9182b0bc 100755 (executable)
@@ -24,6 +24,8 @@
 #include <linux/mmc/host.h>
 #include <linux/android_pmem.h>
 #include <linux/usb/android_composite.h>
+#include <linux/mpu.h>
+#include <linux/mpu3050.h>
 
 #include <mach/hardware.h>
 #include <asm/setup.h>
@@ -1434,6 +1436,46 @@ struct platform_device rk28_device_headset = {
 };
 #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
+
+
 /*****************************************************************************************
  * i2c devices
  * author: kfx@rock-chips.com
@@ -1614,6 +1656,15 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
         .irq            = RK29_PIN2_PA3,
     },
 #endif
+#if defined (CONFIG_SENSORS_MPU3050) 
+       {
+               .type                   = "mpu3050",
+               .addr                   = 0x68,
+               .flags                  = 0,
+               .irq                    = RK29_PIN5_PA3,
+               .platform_data  = &mpu3050_data,
+       },
+#endif
 };
 #endif