diff options
author | Erik Lilliebjerg <elilliebjerg@nvidia.com> | 2013-03-20 00:29:32 -0700 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2013-06-18 04:59:35 -0700 |
commit | 0e5cafdf02b08c945aa6aa389ff96290a848c4d3 (patch) | |
tree | a0098c523073d9478007daa50ec834553f2c74ce /arch/arm/mach-tegra | |
parent | 32652caca6183ec64e80a1de1d1e61d8a3940f81 (diff) |
arm: tegra: board support for sensors
Added support for BMP180 pressure sensor and auto-detection of AKM89XX compass.
Change-Id: I3e45250e7b4e2887d79bd62a402ddcdc0d057b92
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/211081
(cherry picked from commit 00811e96be2c6ac4139a6b24b39cf44ddcf20bda)
Reviewed-on: http://git-master/r/216710
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Xiaohui Tao <xtao@nvidia.com>
Tested-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/board-dalmore-power.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-dalmore-sensors.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-sensors.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-macallan-power.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-macallan-sensors.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-pluto-power.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-pluto-sensors.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-roth-power.c | 2 |
8 files changed, 113 insertions, 39 deletions
diff --git a/arch/arm/mach-tegra/board-dalmore-power.c b/arch/arm/mach-tegra/board-dalmore-power.c index 0a1f5eb3f81c..a4c4eb1f37c7 100644 --- a/arch/arm/mach-tegra/board-dalmore-power.c +++ b/arch/arm/mach-tegra/board-dalmore-power.c @@ -244,6 +244,8 @@ static struct regulator_consumer_supply max77663_sd2_supply[] = { REGULATOR_SUPPLY("vddio_bt_1v8", "bluedroid_pm.0"), REGULATOR_SUPPLY("vdd_dtv_1v8", NULL), REGULATOR_SUPPLY("vlogic", "0-0069"), + REGULATOR_SUPPLY("vid", "0-000d"), + REGULATOR_SUPPLY("vddio", "0-0078"), }; static struct regulator_consumer_supply max77663_sd3_supply[] = { @@ -270,6 +272,8 @@ static struct regulator_consumer_supply max77663_ldo2_supply[] = { REGULATOR_SUPPLY("vdd_als", NULL), REGULATOR_SUPPLY("vdd", "0-004c"), REGULATOR_SUPPLY("vdd", "0-0069"), + REGULATOR_SUPPLY("vdd", "0-000d"), + REGULATOR_SUPPLY("vdd", "0-0078"), }; static struct regulator_consumer_supply max77663_ldo3_supply[] = { diff --git a/arch/arm/mach-tegra/board-dalmore-sensors.c b/arch/arm/mach-tegra/board-dalmore-sensors.c index f95c37ab1c80..ecb219c12c77 100644 --- a/arch/arm/mach-tegra/board-dalmore-sensors.c +++ b/arch/arm/mach-tegra/board-dalmore-sensors.c @@ -480,21 +480,6 @@ static int dalmore_camera_init(void) return 0; } -/* MPU board file definition */ -static struct mpu_platform_data mpu9150_gyro_data = { - .int_config = 0x10, - .level_shifter = 0, - /* Located in board_[platformname].h */ - .orientation = MPU_GYRO_ORIENTATION, - .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS, - .sec_slave_id = COMPASS_ID_AK8975, - .secondary_i2c_addr = MPU_COMPASS_ADDR, - .secondary_read_reg = 0x06, - .secondary_orientation = MPU_COMPASS_ORIENTATION, - .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, - 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, -}; - #define TEGRA_CAMERA_GPIO(_gpio, _label, _value) \ { \ .gpio = _gpio, \ @@ -508,11 +493,45 @@ static struct i2c_board_info dalmore_i2c_board_info_cm3218[] = { }, }; +/* MPU board file definition */ +static struct mpu_platform_data mpu9150_gyro_data = { + .int_config = 0x10, + .level_shifter = 0, + /* Located in board_[platformname].h */ + .orientation = MPU_GYRO_ORIENTATION, + .sec_slave_type = SECONDARY_SLAVE_TYPE_NONE, + .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, + 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, +}; + +static struct mpu_platform_data mpu_compass_data = { + .orientation = MPU_COMPASS_ORIENTATION, + .config = NVI_CONFIG_BOOT_MPU, +}; + +static struct mpu_platform_data bmp180_pdata = { + .config = NVI_CONFIG_BOOT_MPU, +}; + static struct i2c_board_info __initdata inv_mpu9150_i2c2_board_info[] = { { I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR), .platform_data = &mpu9150_gyro_data, }, + { + /* The actual BMP180 address is 0x77 but because this conflicts + * with another device, this address is hacked so Linux will + * call the driver. The conflict is technically okay since the + * BMP180 is behind the MPU. Also, the BMP180 driver uses a + * hard-coded address of 0x77 since it can't be changed anyway. + */ + I2C_BOARD_INFO("bmp180", 0x78), + .platform_data = &bmp180_pdata, + }, + { + I2C_BOARD_INFO(MPU_COMPASS_NAME, MPU_COMPASS_ADDR), + .platform_data = &mpu_compass_data, + }, }; static void mpuirq_init(void) diff --git a/arch/arm/mach-tegra/board-enterprise-sensors.c b/arch/arm/mach-tegra/board-enterprise-sensors.c index 721554e5430d..919ced180a48 100644 --- a/arch/arm/mach-tegra/board-enterprise-sensors.c +++ b/arch/arm/mach-tegra/board-enterprise-sensors.c @@ -167,11 +167,7 @@ static struct mpu_platform_data mpu9150_gyro_data = { .int_config = 0x10, .level_shifter = 0, .orientation = MPU_GYRO_ORIENTATION, - .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS, - .sec_slave_id = COMPASS_ID_AK8975, - .secondary_i2c_addr = MPU_COMPASS_ADDR, - .secondary_read_reg = 0x06, - .secondary_orientation = MPU_COMPASS_ORIENTATION, + .sec_slave_type = SECONDARY_SLAVE_TYPE_NONE, .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, }; @@ -200,6 +196,10 @@ static struct i2c_board_info __initdata inv_mpu9150_i2c2_board_info[] = { I2C_BOARD_INFO(MPU_GYRO_NAME_TAI, MPU_GYRO_ADDR), .platform_data = &mpu9150_gyro_data, }, + { + I2C_BOARD_INFO(MPU_COMPASS_NAME, MPU_COMPASS_ADDR), + .platform_data = &mpu_compass_data, + }, }; static void mpuirq_init(void) diff --git a/arch/arm/mach-tegra/board-macallan-power.c b/arch/arm/mach-tegra/board-macallan-power.c index bf1b40ba6129..b4b3064ada19 100644 --- a/arch/arm/mach-tegra/board-macallan-power.c +++ b/arch/arm/mach-tegra/board-macallan-power.c @@ -115,6 +115,9 @@ static struct regulator_consumer_supply palmas_smps8_supply[] = { REGULATOR_SUPPLY("vddio_uart", NULL), REGULATOR_SUPPLY("pwrdet_uart", NULL), REGULATOR_SUPPLY("vddio_gmi", NULL), + REGULATOR_SUPPLY("vlogic", "0-0069"), + REGULATOR_SUPPLY("vid", "0-000d"), + REGULATOR_SUPPLY("vddio", "0-0078"), }; static struct regulator_consumer_supply palmas_smps9_supply[] = { @@ -161,6 +164,9 @@ static struct regulator_consumer_supply palmas_ldo5_supply[] = { }; static struct regulator_consumer_supply palmas_ldo6_supply[] = { + REGULATOR_SUPPLY("vdd", "0-0069"), + REGULATOR_SUPPLY("vdd", "0-000d"), + REGULATOR_SUPPLY("vdd", "0-0078"), }; static struct regulator_consumer_supply palmas_ldo7_supply[] = { diff --git a/arch/arm/mach-tegra/board-macallan-sensors.c b/arch/arm/mach-tegra/board-macallan-sensors.c index fba3795fd0df..7ab57009f62f 100644 --- a/arch/arm/mach-tegra/board-macallan-sensors.c +++ b/arch/arm/mach-tegra/board-macallan-sensors.c @@ -414,21 +414,6 @@ static int macallan_camera_init(void) return 0; } -/* MPU board file definition */ -static struct mpu_platform_data mpu6050_gyro_data = { - .int_config = 0x10, - .level_shifter = 0, - /* Located in board_[platformname].h */ - .orientation = MPU_GYRO_ORIENTATION, - .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS, - .sec_slave_id = COMPASS_ID_AK8975, - .secondary_i2c_addr = MPU_COMPASS_ADDR, - .secondary_read_reg = 0x06, - .secondary_orientation = MPU_COMPASS_ORIENTATION, - .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, - 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, -}; - #define TEGRA_CAMERA_GPIO(_gpio, _label, _value) \ { \ .gpio = _gpio, \ @@ -449,11 +434,45 @@ static struct i2c_board_info macallan_i2c0_board_info_cm3217[] = { }, }; +/* MPU board file definition */ +static struct mpu_platform_data mpu6050_gyro_data = { + .int_config = 0x10, + .level_shifter = 0, + /* Located in board_[platformname].h */ + .orientation = MPU_GYRO_ORIENTATION, + .sec_slave_type = SECONDARY_SLAVE_TYPE_NONE, + .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, + 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, +}; + +static struct mpu_platform_data mpu_compass_data = { + .orientation = MPU_COMPASS_ORIENTATION, + .config = NVI_CONFIG_BOOT_MPU, +}; + +static struct mpu_platform_data bmp180_pdata = { + .config = NVI_CONFIG_BOOT_MPU, +}; + static struct i2c_board_info __initdata inv_mpu6050_i2c2_board_info[] = { { I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR), .platform_data = &mpu6050_gyro_data, }, + { + /* The actual BMP180 address is 0x77 but because this conflicts + * with another device, this address is hacked so Linux will + * call the driver. The conflict is technically okay since the + * BMP180 is behind the MPU. Also, the BMP180 driver uses a + * hard-coded address of 0x77 since it can't be changed anyway. + */ + I2C_BOARD_INFO("bmp180", 0x78), + .platform_data = &bmp180_pdata, + }, + { + I2C_BOARD_INFO(MPU_COMPASS_NAME, MPU_COMPASS_ADDR), + .platform_data = &mpu_compass_data, + }, }; static void mpuirq_init(void) diff --git a/arch/arm/mach-tegra/board-pluto-power.c b/arch/arm/mach-tegra/board-pluto-power.c index b2f2a1409be5..3adf84f9891f 100644 --- a/arch/arm/mach-tegra/board-pluto-power.c +++ b/arch/arm/mach-tegra/board-pluto-power.c @@ -92,6 +92,8 @@ static struct regulator_consumer_supply palmas_smps8_supply[] = { REGULATOR_SUPPLY("vdd_gps", NULL), REGULATOR_SUPPLY("vdd_nfc", NULL), REGULATOR_SUPPLY("vlogic", "0-0069"), + REGULATOR_SUPPLY("vid", "0-000d"), + REGULATOR_SUPPLY("vddio", "0-0078"), REGULATOR_SUPPLY("vdd_dtv", NULL), REGULATOR_SUPPLY("vdd_bb", NULL), REGULATOR_SUPPLY("vcore1_lpddr", NULL), @@ -178,6 +180,8 @@ static struct regulator_consumer_supply palmas_ldo6_supply[] = { REGULATOR_SUPPLY("vdd", "0-004c"), REGULATOR_SUPPLY("avdd", "spi3.2"), REGULATOR_SUPPLY("vdd", "0-0069"), + REGULATOR_SUPPLY("vdd", "0-000d"), + REGULATOR_SUPPLY("vdd", "0-0078"), }; static struct regulator_consumer_supply palmas_ldo7_supply[] = { diff --git a/arch/arm/mach-tegra/board-pluto-sensors.c b/arch/arm/mach-tegra/board-pluto-sensors.c index 29060fdf5c72..a1356c68e6fe 100644 --- a/arch/arm/mach-tegra/board-pluto-sensors.c +++ b/arch/arm/mach-tegra/board-pluto-sensors.c @@ -851,19 +851,39 @@ static struct mpu_platform_data mpu_gyro_data = { .int_config = 0x00, .level_shifter = 0, .orientation = MPU_GYRO_ORIENTATION, - .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS, - .sec_slave_id = COMPASS_ID_AK8963, - .secondary_i2c_addr = MPU_COMPASS_ADDR, - .secondary_orientation = MPU_COMPASS_ORIENTATION, + .sec_slave_type = SECONDARY_SLAVE_TYPE_NONE, .key = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22, 0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89}, }; +static struct mpu_platform_data mpu_compass_data = { + .orientation = MPU_COMPASS_ORIENTATION, + .config = NVI_CONFIG_BOOT_MPU, +}; + +static struct mpu_platform_data bmp180_pdata = { + .config = NVI_CONFIG_BOOT_MPU, +}; + static struct i2c_board_info __initdata inv_mpu_i2c0_board_info[] = { { I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR), .platform_data = &mpu_gyro_data, }, + { + /* The actual BMP180 address is 0x77 but because this conflicts + * with another device, this address is hacked so Linux will + * call the driver. The conflict is technically okay since the + * BMP180 is behind the MPU. Also, the BMP180 driver uses a + * hard-coded address of 0x77 since it can't be changed anyway. + */ + I2C_BOARD_INFO("bmp180", 0x78), + .platform_data = &bmp180_pdata, + }, + { + I2C_BOARD_INFO(MPU_COMPASS_NAME, MPU_COMPASS_ADDR), + .platform_data = &mpu_compass_data, + }, }; static void mpuirq_init(void) diff --git a/arch/arm/mach-tegra/board-roth-power.c b/arch/arm/mach-tegra/board-roth-power.c index 95186fa69967..ea5249aee18e 100644 --- a/arch/arm/mach-tegra/board-roth-power.c +++ b/arch/arm/mach-tegra/board-roth-power.c @@ -229,6 +229,7 @@ static struct regulator_consumer_supply palmas_smps3_supply[] = { REGULATOR_SUPPLY("pwrdet_cam", NULL), REGULATOR_SUPPLY("dbvdd", NULL), REGULATOR_SUPPLY("vlogic", "0-0068"), + REGULATOR_SUPPLY("vid", "0-000c"), }; static struct regulator_consumer_supply palmas_smps45_supply[] = { @@ -291,6 +292,7 @@ static struct regulator_consumer_supply palmas_ldo6_supply[] = { REGULATOR_SUPPLY("vdd", "1-004c"), REGULATOR_SUPPLY("vdd", "1-004d"), REGULATOR_SUPPLY("vdd", "0-0068"), + REGULATOR_SUPPLY("vdd", "0-000c"), }; static struct regulator_consumer_supply palmas_ldo8_supply[] = { |