modify some board file according to mpu3050 driver
authorlw@rock-chips.com <lw@rock-chips.com>
Mon, 12 Dec 2011 12:54:19 +0000 (20:54 +0800)
committerlw <lw@rock-chips.com>
Mon, 12 Dec 2011 12:55:15 +0000 (20:55 +0800)
arch/arm/mach-rk29/board-rk29-ddr3sdk.c
arch/arm/mach-rk29/board-rk29-fih.c
arch/arm/mach-rk29/board-rk29-td8801_v2.c

index 20df96df44703fb8447b6c3b2bcad3e51acda204..3a17560f22eaeeeff6da01617b7b1d0b19a53d80 100755 (executable)
@@ -58,7 +58,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/i2c-gpio.h>
-
+#include <linux/mpu.h>
 #include "devices.h"
 #include "../../../drivers/input/touchscreen/xpt2046_cbn_ts.h"
 
@@ -950,55 +950,32 @@ static struct mma8452_platform_data mma8452_info = {
 
 };
 #endif
-#if defined (CONFIG_MPU_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 },
-               .orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
-               .level_shifter = 0,
+#if defined (CONFIG_MPU_SENSORS_MPU3050)
+static struct mpu_platform_data mpu3050_data = {
+       .int_config = 0x10,
+       .orientation = { 1, 0, 0,0, 1, 0, 0, 0, 1 },
+};
+#endif
+
+/* accel */
 #if defined (CONFIG_MPU_SENSORS_KXTF9)
-               .accel = {
-#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
-                               .get_slave_descr = NULL ,
-#else
-                               .get_slave_descr = get_accel_slave_descr ,                      
-#endif
-                               .adapt_num = 0, // The i2c bus to which the mpu device is
-                               // connected
-                               //.irq = RK29_PIN0_PA3,
-                               .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 = { 0, 1 ,0, -1 ,0, 0, 0, 0, 1 },
-               },
+static struct ext_slave_platform_data inv_mpu_kxtf9_data = {
+       .bus         = EXT_SLAVE_BUS_SECONDARY,
+       .adapt_num = 0,
+       .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
+};
 #endif
+
+/* compass */
 #if defined (CONFIG_MPU_SENSORS_AK8975)
-               .compass = {
-#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
-                               .get_slave_descr = NULL,/*ak5883_get_slave_descr,*/
-#else
-                               .get_slave_descr = get_compass_slave_descr,
-#endif                                         
-                               .adapt_num = 0, // The i2c bus to which the compass device is. 
-                               // It can be difference with mpu
-                               // connected
-                               //.irq = RK29_PIN0_PA4,
-                               .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 },
-                               //.orientation = { 0, -1, 0, 1, 0, 0, 0, 0, 1 },
-                               .orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
-               },
+static struct ext_slave_platform_data inv_mpu_ak8975_data = {
+       .bus         = EXT_SLAVE_BUS_PRIMARY,
+       .adapt_num = 0,
+       .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
 };
 #endif
-#endif
+
 #if defined (CONFIG_BATTERY_BQ27510)
 #define        DC_CHECK_PIN    RK29_PIN4_PA1
 #define        LI_LION_BAT_NUM 2
@@ -1513,16 +1490,34 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .irq                    = RK29_PIN0_PA4,
        },
 #endif
-/*mpu3050*/
 #if defined (CONFIG_MPU_SENSORS_MPU3050) 
        {
-               .type                   = "mpu3050",
+               .type                   = "mpu3050",
                .addr                   = 0x68,
                .flags                  = 0,
-               .irq                    = RK29_PIN5_PA3,
-               .platform_data  = &mpu3050_data,
+               .irq                    = RK29_PIN4_PC4,
+               .platform_data  = &mpu3050_data,
+       },
+#endif
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
+       {
+               .type                   = "kxtf9",
+               .addr           = 0x0f,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC4,
+               .platform_data = &inv_mpu_kxtf9_data,
+       },
+#endif
+#if defined (CONFIG_MPU_SENSORS_AK8975)
+       {
+               .type                   = "ak8975",
+               .addr                   = 0x0d,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC5,
+               .platform_data = &inv_mpu_ak8975_data,
        },
 #endif
+
 #if defined (CONFIG_SND_SOC_CS42L52)
        {
                .type                   = "cs42l52",
index 3d2af3ba872badb59913af2194422c8711a2b6d5..24fa6d4d2979069925e7d6e964c9a6acd3474dde 100755 (executable)
@@ -534,43 +534,32 @@ 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_PIN0_PA3,
-                               .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 },
-               },
+#if defined (CONFIG_MPU_SENSORS_MPU3050)
+static struct mpu_platform_data mpu3050_data = {
+       .int_config = 0x10,
+       .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_PIN0_PA4,
-                               .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 },
-               },
+
+/* accel */
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
+static struct ext_slave_platform_data inv_mpu_kxtf9_data = {
+       .bus         = EXT_SLAVE_BUS_SECONDARY,
+       .adapt_num = 0,
+       .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
 };
 #endif
+
+/* compass */
+#if defined (CONFIG_MPU_SENSORS_AK8975)
+static struct ext_slave_platform_data inv_mpu_ak8975_data = {
+       .bus         = EXT_SLAVE_BUS_PRIMARY,
+       .adapt_num = 0,
+       .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
+};
 #endif
+
 #if defined (CONFIG_BATTERY_BQ27510)
  
 #define DC_CHECK_PIN RK29_PIN4_PA1
@@ -1110,16 +1099,34 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .irq                    = RK29_PIN0_PA4,
        },
 #endif
-/*mpu3050*/
-#if defined (CONFIG_SENSORS_MPU3050) 
+#if defined (CONFIG_MPU_SENSORS_MPU3050) 
        {
-               .type                   = "mpu3050",
+               .type                   = "mpu3050",
                .addr                   = 0x68,
                .flags                  = 0,
-               .irq                    = RK29_PIN5_PA3,
-               .platform_data  = &mpu3050_data,
+               .irq                    = RK29_PIN4_PC4,
+               .platform_data  = &mpu3050_data,
        },
 #endif
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
+       {
+               .type                   = "kxtf9",
+               .addr           = 0x0f,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC4,
+               .platform_data = &inv_mpu_kxtf9_data,
+       },
+#endif
+#if defined (CONFIG_MPU_SENSORS_AK8975)
+       {
+               .type                   = "ak8975",
+               .addr                   = 0x0d,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC5,
+               .platform_data = &inv_mpu_ak8975_data,
+       },
+#endif
+
 };
 #endif
 
index 280d409179a616c05d08373c68e1acbd6dc30459..342bb8a9398cfd2fcf79343d84223661be8f22c6 100755 (executable)
@@ -656,55 +656,29 @@ static struct bma023_platform_data bma023_info = {
 
 };
 #endif
-#if defined (CONFIG_MPU_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 },
-               //.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_MPU_SENSORS_MPU3050)
+static struct mpu_platform_data mpu3050_data = {
+       .int_config = 0x10,
+       .orientation = { 1, 0, 0,0, 1, 0, 0, 0, 1 },
+};
+#endif
+
+/* accel */
 #if defined (CONFIG_MPU_SENSORS_KXTF9)
-               .accel = {
-#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
-                               .get_slave_descr = NULL ,
-#else
-                               .get_slave_descr = get_accel_slave_descr ,
-#endif
-                               .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 = { 0, 1 ,0, -1 ,0, 0, 0, 0, 1 },
-                               .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
-               },
+static struct ext_slave_platform_data inv_mpu_kxtf9_data = {
+       .bus         = EXT_SLAVE_BUS_SECONDARY,
+       .adapt_num = 0,
+       .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1},
+};
 #endif
+
+/* compass */
 #if defined (CONFIG_MPU_SENSORS_AK8975)
-               .compass = {
-#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
-                               .get_slave_descr = NULL,/*ak5883_get_slave_descr,*/
-#else
-                               .get_slave_descr = get_compass_slave_descr,
-#endif
-                               .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 },
-                               //.orientation = { 0, -1, 0, 1, 0, 0, 0, 0, 1 },
-                               .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
-               },
-#endif
+static struct ext_slave_platform_data inv_mpu_ak8975_data = {
+       .bus         = EXT_SLAVE_BUS_PRIMARY,
+       .adapt_num = 0,
+       .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
 };
 #endif
 
@@ -1996,7 +1970,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .platform_data  = &l3g4200d_info,
        },
 #endif
-#if defined (CONFIG_MPU_SENSORS_MPU3050)
+#if defined (CONFIG_MPU_SENSORS_MPU3050) 
        {
                .type                   = "mpu3050",
                .addr                   = 0x68,
@@ -2005,6 +1979,24 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
                .platform_data  = &mpu3050_data,
        },
 #endif
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
+       {
+               .type                   = "kxtf9",
+               .addr           = 0x0f,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC4,
+               .platform_data = &inv_mpu_kxtf9_data,
+       },
+#endif
+#if defined (CONFIG_MPU_SENSORS_AK8975)
+       {
+               .type                   = "ak8975",
+               .addr                   = 0x0d,
+               .flags                  = 0,    
+               //.irq                  = RK29_PIN6_PC5,
+               .platform_data = &inv_mpu_ak8975_data,
+       },
+#endif
 };
 #endif