summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Yi <wyi@nvidia.com>2011-01-28 15:34:43 -0800
committerVarun Colbert <vcolbert@nvidia.com>2011-02-03 21:20:18 -0800
commitdf4a2fbff8471de3f75d55b93e2bf94dfd26ff7e (patch)
tree065ce3a284cf95fcc33a0ce612614816527b4e66
parent8b5712b7412cef9b63533da68e168f668e11c7eb (diff)
[ARM] tegra: ventana: Invensense MPU update
Update tegra board file to include Invensense MPU3050 drivers Depends on Change-Id: Iceb3ef8b11d4ce18fd3cb0947268744775b81758 BUG 784570 Change-Id: Ieb75676128fbde4797f8fe6298e57f29b5a2db13 Reviewed-on: http://git-master/r/17527 Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c
index 9c7ca2fdf4ce..a819a2320ba8 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -20,7 +20,7 @@
#include <linux/i2c.h>
#include <linux/akm8975.h>
-#include <linux/mpu3050.h>
+#include <linux/mpu.h>
#include <linux/i2c/pca954x.h>
#include <linux/i2c/pca953x.h>
#include <linux/nct1008.h>
@@ -181,13 +181,14 @@ static struct i2c_board_info ventana_i2c7_board_info[] = {
};
#ifdef CONFIG_SENSORS_MPU3050
+#define SENSOR_MPU_NAME "mpu3050"
static struct mpu3050_platform_data mpu3050_data = {
.int_config = 0x10,
.orientation = { 0, -1, 0, -1, 0, 0, 0, 0, -1 }, /* Orientation matrix for MPU on ventana */
.level_shifter = 0,
.accel = {
#ifdef CONFIG_SENSORS_KXTF9_MPU
- .get_slave_descr = kxtf9_get_slave_descr,
+ .get_slave_descr = get_accel_slave_descr,
#else
.get_slave_descr = NULL,
#endif
@@ -199,11 +200,11 @@ static struct mpu3050_platform_data mpu3050_data = {
.compass = {
#ifdef CONFIG_SENSORS_AK8975_MPU
- .get_slave_descr = ak8975_get_slave_descr,
+ .get_slave_descr = get_compass_slave_descr,
#else
.get_slave_descr = NULL,
#endif
- .adapt_num = 3, /* bus number 3 on ventana */
+ .adapt_num = 4, /* bus number 4 on ventana */
.bus = EXT_SLAVE_BUS_PRIMARY,
.address = 0x0C,
.orientation = { 1, 0, 0, 0, -1, 0, 0, 0, -1 }, /* Orientation matrix for AKM on ventana */
@@ -212,10 +213,20 @@ static struct mpu3050_platform_data mpu3050_data = {
static struct i2c_board_info __initdata mpu3050_i2c0_boardinfo[] = {
{
- I2C_BOARD_INFO("mpu3050", 0x68), /*.irq = 299,*/
+ I2C_BOARD_INFO(SENSOR_MPU_NAME, 0x68),
+ .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PZ4),
.platform_data = &mpu3050_data,
},
};
+
+static void ventana_mpuirq_init(void)
+{
+ pr_info("*** MPU START *** ventana_mpuirq_init...\n");
+ tegra_gpio_enable(TEGRA_GPIO_PZ4);
+ gpio_request(TEGRA_GPIO_PZ4, SENSOR_MPU_NAME);
+ gpio_direction_input(TEGRA_GPIO_PZ4);
+ pr_info("*** MPU END *** ventana_mpuirq_init...\n");
+}
#endif
int __init ventana_sensors_init(void)
@@ -226,6 +237,9 @@ int __init ventana_sensors_init(void)
#ifdef CONFIG_SENSORS_AK8975
ventana_akm8975_init();
#endif
+#ifdef CONFIG_SENSORS_MPU3050
+ ventana_mpuirq_init();
+#endif
ventana_camera_init();
ventana_nct1008_init();