From ca615709ef2c2162920fdffbd5537ea0ed06264c Mon Sep 17 00:00:00 2001 From: Naga RADHESH Y Date: Tue, 14 Feb 2012 07:46:54 +0100 Subject: mach-ux500:Add platform data of sensors for R3UIB Add platform data for R3 UIB for sensors, change platform data for R2UIB for gyroscope ST-Ericsson ID: 374970 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id:I3a9d89841d5a746d444ec1c40491787ffef764b7 Signed-off-by: Naga Radhesh --- arch/arm/mach-ux500/board-mop500-cyttsp.c | 56 +++++++++++++++++++++++++++++ arch/arm/mach-ux500/board-mop500-u8500uib.c | 6 ++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500-cyttsp.c b/arch/arm/mach-ux500/board-mop500-cyttsp.c index 2aa27ea9b1f..c64f732d7c7 100755 --- a/arch/arm/mach-ux500/board-mop500-cyttsp.c +++ b/arch/arm/mach-ux500/board-mop500-cyttsp.c @@ -15,16 +15,60 @@ #include #include #include +#include +#include #include #include #include #include +#include #include "pins-db8500.h" #include "board-mop500.h" #include "devices-db8500.h" #define NUM_SSP_CLIENTS 10 +/* + * LSM303DLH accelerometer + magnetometer & L3G4200D Gyroscope sensors + */ +static struct lsm303dlh_platform_data __initdata lsm303dlh_pdata_u8500_r3 = { + .name_a = "lsm303dlh.0", + .name_m = "lsm303dlh.1", + .axis_map_x = 1, + .axis_map_y = 0, + .axis_map_z = 2, + .negative_x = 1, + .negative_y = 1, + .negative_z = 1, +}; + +static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata_u8500_r3 = { + .name_gyr = "l3g4200d", + .axis_map_x = 0, + .axis_map_y = 1, + .axis_map_z = 2, + .negative_x = 0, + .negative_y = 1, + .negative_z = 1, +}; +static struct i2c_board_info __initdata mop500_i2c2_devices_u8500_r3[] = { + { + /* LSM303DLH Accelerometer */ + I2C_BOARD_INFO("lsm303dlhc_a", 0x19), + .platform_data = &lsm303dlh_pdata_u8500_r3, + }, + { + /* LSM303DLH Magnetometer */ + I2C_BOARD_INFO("lsm303dlh_m", 0x1E), + .platform_data = &lsm303dlh_pdata_u8500_r3, + }, + { + /* L3G4200D Gyroscope */ + I2C_BOARD_INFO("l3g4200d", 0x68), + .platform_data = &l3g4200d_pdata_u8500_r3, + }, +}; + /* cyttsp_gpio_board_init : configures the touch panel. */ static int cyttsp_plat_init(int on) { @@ -219,8 +263,20 @@ void __init mop500_u8500uib_r3_init(void) mop500_cyttsp_init(); db8500_add_spi2(&mop500_spi2_data); nmk_config_pin((GPIO64_GPIO | PIN_INPUT_PULLUP), false); + if (machine_is_hrefv60()) { + lsm303dlh_pdata_u8500_r3.irq_a1 = HREFV60_ACCEL_INT1_GPIO; + lsm303dlh_pdata_u8500_r3.irq_a2 = HREFV60_ACCEL_INT2_GPIO; + lsm303dlh_pdata_u8500_r3.irq_m = HREFV60_MAGNET_DRDY_GPIO; + } else { + lsm303dlh_pdata_u8500_r3.irq_a1 = GPIO_ACCEL_INT1; + lsm303dlh_pdata_u8500_r3.irq_a2 = GPIO_ACCEL_INT2; + lsm303dlh_pdata_u8500_r3.irq_m = GPIO_MAGNET_DRDY; + } mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500, ARRAY_SIZE(mop500_i2c0_devices_u8500)); mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500, ARRAY_SIZE(mop500_i2c0_devices_u8500)); + + mop500_uib_i2c_add(2, mop500_i2c2_devices_u8500_r3, + ARRAY_SIZE(mop500_i2c2_devices_u8500_r3)); } diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c index 20763004c4a..8c3232e3e3f 100644 --- a/arch/arm/mach-ux500/board-mop500-u8500uib.c +++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c @@ -51,11 +51,11 @@ static struct lsm303dlh_platform_data __initdata lsm303dlh_pdata_u8500 = { #ifdef CONFIG_SENSORS_L3G4200D static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata_u8500 = { .name_gyr = "l3g4200d", - .axis_map_x = 1, - .axis_map_y = 0, + .axis_map_x = 0, + .axis_map_y = 1, .axis_map_z = 2, .negative_x = 0, - .negative_y = 0, + .negative_y = 1, .negative_z = 1, }; #endif -- cgit v1.2.3