diff options
author | Johnny Qiu <joqiu@nvidia.com> | 2012-02-11 15:09:51 +0800 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-02-15 11:46:17 -0800 |
commit | 47db27b87dc2f60a4f832a57f7fc6ca48e86a7fc (patch) | |
tree | 297c1d1e53380bd015ba0428dbd891a1d877887d /arch | |
parent | 24ee99196e2b8a56f12b867b4e1e6e6c54b36e76 (diff) |
arm: tegra: ventana: Update board file for new Invensense MPU driver
Bug 825602
Change-Id: I32b09ec561e9be41660a64e6b2dda31b9cf5604d
Signed-off-by: Johnny Qiu <joqiu@nvidia.com>
Reviewed-on: http://git-master/r/83296
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-sensors.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ventana.h | 4 |
2 files changed, 20 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c index 85987387d15b..0bed64b01d21 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -298,20 +298,28 @@ static struct i2c_board_info ventana_i2c8_board_info[] = { }, }; -#ifdef CONFIG_MPU_SENSORS_MPU3050 -static struct mpu_platform_data mpu3050_data = { +/* MPU board file definition */ +#if (MPU_GYRO_TYPE == MPU_TYPE_MPU3050) +#define MPU_GYRO_NAME "mpu3050" +#endif +#if (MPU_GYRO_TYPE == MPU_TYPE_MPU6050) +#define MPU_GYRO_NAME "mpu6050" +#endif +static struct mpu_platform_data mpu_gyro_data = { .int_config = 0x10, .level_shifter = 0, .orientation = MPU_GYRO_ORIENTATION, /* Located in board_[platformname].h */ }; -static struct ext_slave_platform_data mpu3050_accel_data = { +#if (MPU_GYRO_TYPE == MPU_TYPE_MPU3050) +static struct ext_slave_platform_data mpu_accel_data = { .address = MPU_ACCEL_ADDR, .irq = 0, .adapt_num = MPU_ACCEL_BUS_NUM, .bus = EXT_SLAVE_BUS_SECONDARY, .orientation = MPU_ACCEL_ORIENTATION, /* Located in board_[platformname].h */ }; +#endif static struct ext_slave_platform_data mpu_compass_data = { .address = MPU_COMPASS_ADDR, @@ -325,15 +333,17 @@ static struct i2c_board_info __initdata inv_mpu_i2c2_board_info[] = { { I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR), .irq = TEGRA_GPIO_TO_IRQ(MPU_GYRO_IRQ_GPIO), - .platform_data = &mpu3050_data, + .platform_data = &mpu_gyro_data, }, +#if (MPU_GYRO_TYPE == MPU_TYPE_MPU3050) { I2C_BOARD_INFO(MPU_ACCEL_NAME, MPU_ACCEL_ADDR), #if MPU_ACCEL_IRQ_GPIO .irq = TEGRA_GPIO_TO_IRQ(MPU_ACCEL_IRQ_GPIO), #endif - .platform_data = &mpu3050_accel_data, + .platform_data = &mpu_accel_data, }, +#endif }; static struct i2c_board_info __initdata inv_mpu_i2c4_board_info[] = { @@ -352,6 +362,7 @@ static void mpuirq_init(void) pr_info("*** MPU START *** mpuirq_init...\n"); +#if (MPU_GYRO_TYPE == MPU_TYPE_MPU3050) #if MPU_ACCEL_IRQ_GPIO /* ACCEL-IRQ assignment */ tegra_gpio_enable(MPU_ACCEL_IRQ_GPIO); @@ -368,6 +379,7 @@ static void mpuirq_init(void) return; } #endif +#endif /* MPU-IRQ assignment */ tegra_gpio_enable(MPU_GYRO_IRQ_GPIO); @@ -390,7 +402,6 @@ static void mpuirq_init(void) i2c_register_board_info(MPU_COMPASS_BUS_NUM, inv_mpu_i2c4_board_info, ARRAY_SIZE(inv_mpu_i2c4_board_info)); } -#endif int __init ventana_sensors_init(void) { @@ -400,9 +411,7 @@ int __init ventana_sensors_init(void) #ifdef CONFIG_SENSORS_AK8975 ventana_akm8975_init(); #endif -#ifdef CONFIG_MPU_SENSORS_MPU3050 mpuirq_init(); -#endif ventana_nct1008_init(); i2c_register_board_info(0, ventana_i2c0_board_info, diff --git a/arch/arm/mach-tegra/board-ventana.h b/arch/arm/mach-tegra/board-ventana.h index d9c142fba223..284fa43be229 100644 --- a/arch/arm/mach-tegra/board-ventana.h +++ b/arch/arm/mach-tegra/board-ventana.h @@ -91,7 +91,9 @@ int ventana_charger_init(void); #define TPS6586X_INT_END (TPS6586X_INT_BASE + 32) /* Invensense MPU Definitions */ -#define MPU_GYRO_NAME "mpu3050" +#define MPU_TYPE_MPU3050 1 +#define MPU_TYPE_MPU6050 2 +#define MPU_GYRO_TYPE MPU_TYPE_MPU3050 #define MPU_GYRO_IRQ_GPIO TEGRA_GPIO_PZ4 #define MPU_GYRO_ADDR 0x68 #define MPU_GYRO_BUS_NUM 0 |