From 6bae870b98f717966bf4d7f90f33286e4c7b7793 Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Wed, 15 Feb 2012 16:01:20 +0100 Subject: mach-ux500: sensors: move U8500 UIBs sensors management into board-mop500-sensors.c Signed-off-by: Philippe Langlais --- arch/arm/mach-ux500/board-mop500-sensors.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-sensors.c b/arch/arm/mach-ux500/board-mop500-sensors.c index 006d6e408a2..492d2a08aa5 100644 --- a/arch/arm/mach-ux500/board-mop500-sensors.c +++ b/arch/arm/mach-ux500/board-mop500-sensors.c @@ -15,7 +15,7 @@ #include "board-mop500.h" /* - * LSM303DLH accelerometer + magnetometer sensors + * LSM303DLH accelerometer + magnetometer & L3G4200D Gyroscope sensors */ static struct lsm303dlh_platform_data __initdata lsm303dlh_pdata = { .name_a = "lsm303dlh.0", @@ -28,7 +28,7 @@ static struct lsm303dlh_platform_data __initdata lsm303dlh_pdata = { .negative_z = 0, }; -static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata_u8500 = { +static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata = { .name_gyr = "l3g4200d", .axis_map_x = 1, .axis_map_y = 0, @@ -38,6 +38,10 @@ static struct l3g4200d_gyr_platform_data __initdata l3g4200d_pdata_u8500 = { .negative_z = 1, }; +/* + * Platform data for pressure sensor, + * poll interval and min interval in millseconds. + */ static struct lps001wp_prs_platform_data __initdata lps001wp_pdata = { .poll_interval = 1000, .min_interval = 10, @@ -52,7 +56,7 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = { { /* L3G4200D Gyroscope */ I2C_BOARD_INFO("l3g4200d", 0x68), - .platform_data = &l3g4200d_pdata_u8500, + .platform_data = &l3g4200d_pdata, }, { /* LSP001WM Barometer */ @@ -177,7 +181,8 @@ static int __init mop500_sensors_init(void) { int ret; - if (!machine_is_snowball() && !uib_is_stuib() && !uib_is_u8500uibr3()) + if (!machine_is_snowball() && !uib_is_stuib() && + !uib_is_u8500uib() && !uib_is_u8500uibr3()) return 0; if (machine_is_hrefv60()) { @@ -194,6 +199,21 @@ static int __init mop500_sensors_init(void) lsm303dlh_pdata.irq_m = GPIO_MAGNET_DRDY; } + /* Special sensors data for 8500 UIBs */ + if (uib_is_u8500uib() || uib_is_u8500uibr3()) { + lsm303dlh_pdata.axis_map_x = 1; + lsm303dlh_pdata.axis_map_y = 0; + lsm303dlh_pdata.negative_x = 0; + lsm303dlh_pdata.negative_y = 0; + lsm303dlh_pdata.negative_z = 1; + + l3g4200d_pdata.axis_map_x = 0; + l3g4200d_pdata.axis_map_y = 1; + l3g4200d_pdata.negative_x = 1; + l3g4200d_pdata.negative_y = 0; + l3g4200d_pdata.negative_z = 1; + } + ret = mop500_get_acc_id(); if (ret < 0) printk(KERN_ERR " Failed to get Accelerometer chip ID\n"); -- cgit v1.2.3