ARM: tegra: tegratab: apply DVT3 mpu mount orientation
David Yu [Tue, 23 Jul 2013 10:52:54 +0000 (19:52 +0900)]
Bug 1330733

Change-Id: I77b13de86be87ab0b768bb6eb0ca5792a8bddc63
Signed-off-by: David Yu <davyu@nvidia.com>
Reviewed-on: http://git-master/r/252378
(cherry picked from commit 2f7375070142f33d00bc97fc47d2c8ba5f5f3d77)
Reviewed-on: http://git-master/r/263709
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

arch/arm/mach-tegra/board-tegratab-sensors.c
arch/arm/mach-tegra/board-tegratab.h

index 9c85a13..06f1df7 100644 (file)
@@ -435,6 +435,15 @@ static struct mpu_platform_data mpu6050_gyro_data_e1569 = {
                           0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89},
 };
 
+static struct mpu_platform_data mpu6050_gyro_data_p1640_a01 = {
+       .int_config     = 0x10,
+       .level_shifter  = 0,
+       /* Located in board_[platformname].h */
+       .orientation    = MPU_GYRO_ORIENTATION_P1640_A01,
+       .key            = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22,
+                          0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89},
+};
+
 static struct mpu_platform_data mpu6050_gyro_data = {
        .int_config     = 0x10,
        .level_shifter  = 0,
@@ -489,6 +498,11 @@ static void mpuirq_init(void)
        if (board_info.board_id == BOARD_E1569)
                inv_mpu6050_i2c2_board_info[0].platform_data =
                        &mpu6050_gyro_data_e1569;
+       else if ((board_info.board_id == BOARD_P1640) &&
+                       (board_info.fab <= BOARD_FAB_A01))
+               inv_mpu6050_i2c2_board_info[0].platform_data =
+                       &mpu6050_gyro_data_p1640_a01;
+
        i2c_register_board_info(gyro_bus_num, inv_mpu6050_i2c2_board_info,
                ARRAY_SIZE(inv_mpu6050_i2c2_board_info));
 }
index 7029ea0..70cb2a8 100644 (file)
@@ -86,7 +86,8 @@
 #define MPU_GYRO_ADDR                 0x69
 #define MPU_GYRO_BUS_NUM              0
 #define MPU_GYRO_ORIENTATION_E1569    MTMAT_TOP_CCW_180
-#define MPU_GYRO_ORIENTATION          MTMAT_TOP_CCW_0
+#define MPU_GYRO_ORIENTATION_P1640_A01 MTMAT_TOP_CCW_0
+#define MPU_GYRO_ORIENTATION          MTMAT_TOP_CCW_90
 #define MPU_COMPASS_NAME              "ak8975"
 #define MPU_COMPASS_IRQ_GPIO          0
 #define MPU_COMPASS_ADDR              0x0D