diff --git a/arch/arm/mach-msm/board-8930.c b/arch/arm/mach-msm/board-8930.c index ed0cc82f0c4..fb203070b77 100644 --- a/arch/arm/mach-msm/board-8930.c +++ b/arch/arm/mach-msm/board-8930.c @@ -47,6 +47,10 @@ #include #include +#ifdef CONFIG_STM_LIS3DH +#include +#endif + #include #include #include @@ -2452,6 +2456,31 @@ static struct i2c_board_info isl_charger_i2c_info[] __initdata = { }; #endif /* CONFIG_ISL9519_CHARGER */ +#ifdef CONFIG_STM_LIS3DH +static struct lis3dh_acc_platform_data lis3dh_accel = { + .poll_interval = 200, + .min_interval = 10, + .g_range = LIS3DH_ACC_G_2G, + .axis_map_x = 1, + .axis_map_y = 0, + .axis_map_z = 2, + .negate_x = 0, + .negate_y = 0, + .negate_z = 1, + .init = NULL, + .exit = NULL, + .gpio_int1 = -EINVAL, + .gpio_int2 = -EINVAL, +}; + +static struct i2c_board_info __initdata lis3dh_i2c_boardinfo[] = { + { + I2C_BOARD_INFO(LIS3DH_ACC_DEV_NAME, 0x18), + .platform_data = &lis3dh_accel, + }, +}; +#endif /* CONFIG_STM_LIS3DH */ + static struct i2c_registry msm8960_i2c_devices[] __initdata = { #ifdef CONFIG_ISL9519_CHARGER { @@ -2487,6 +2516,14 @@ static struct i2c_registry msm8960_i2c_devices[] __initdata = { sii_device_info, ARRAY_SIZE(sii_device_info), }, +#ifdef CONFIG_STM_LIS3DH + { + I2C_FFA | I2C_FLUID, + MSM_8930_GSBI12_QUP_I2C_BUS_ID, + lis3dh_i2c_boardinfo, + ARRAY_SIZE(lis3dh_i2c_boardinfo), + }, +#endif }; #endif /* CONFIG_I2C */ diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 8fb19dc014f..1464dabed5a 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -647,4 +647,11 @@ config BOSCH_BMA150 If you say yes here you get support for Bosch Sensortec's acceleration sensors SMB380/BMA150. +config STM_LIS3DH + tristate "STM LIS3DH acceleration sensor support" + depends on I2C=y + help + If you say yes here you get support for STMicroelectronics's + acceleration sensors LIS3DH. + endif diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index eecee4eabf5..96c9288db53 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile @@ -60,3 +60,4 @@ obj-$(CONFIG_INPUT_YEALINK) += yealink.o obj-$(CONFIG_PMIC8058_OTHC) += pmic8058-othc.o obj-$(CONFIG_INPUT_PMIC8058_VIBRA_MEMLESS) += pmic8058-vib-memless.o obj-$(CONFIG_BOSCH_BMA150) += bma150.o +obj-$(CONFIG_STM_LIS3DH) += lis3dh_acc.o