Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: st-accel: add support for lis2dh12

This commit add support for STMicroelectronics lis2dh12 accelerometer.
Datasheet for this device can be found here:

http://www.st.com/st-web-ui/static/active/en/resource/technical/
document/datasheet/DM00091513.pdf

Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Giuseppe Barba and committed by
Jonathan Cameron
34dc578d 72a868b3

+10 -1
+1
Documentation/devicetree/bindings/iio/st-sensors.txt
··· 36 36 - st,lsm303dlm-accel 37 37 - st,lsm330-accel 38 38 - st,lsm303agr-accel 39 + - st,lis2dh12-accel 39 40 40 41 Gyroscopes: 41 42 - st,l3g4200d-gyro
+1 -1
drivers/iio/accel/Kconfig
··· 64 64 help 65 65 Say yes here to build support for STMicroelectronics accelerometers: 66 66 LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, 67 - LIS331DLH, LSM303DL, LSM303DLM, LSM330. 67 + LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12. 68 68 69 69 This driver can also be built as a module. If so, these modules 70 70 will be created:
+1
drivers/iio/accel/st_accel.h
··· 27 27 #define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel" 28 28 #define LSM330_ACCEL_DEV_NAME "lsm330_accel" 29 29 #define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" 30 + #define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel" 30 31 31 32 /** 32 33 * struct st_sensors_platform_data - default accel platform data
+1
drivers/iio/accel/st_accel_core.c
··· 234 234 [3] = LSM330DL_ACCEL_DEV_NAME, 235 235 [4] = LSM330DLC_ACCEL_DEV_NAME, 236 236 [5] = LSM303AGR_ACCEL_DEV_NAME, 237 + [6] = LIS2DH12_ACCEL_DEV_NAME, 237 238 }, 238 239 .ch = (struct iio_chan_spec *)st_accel_12bit_channels, 239 240 .odr = {
+5
drivers/iio/accel/st_accel_i2c.c
··· 72 72 .compatible = "st,lsm303agr-accel", 73 73 .data = LSM303AGR_ACCEL_DEV_NAME, 74 74 }, 75 + { 76 + .compatible = "st,lis2dh12-accel", 77 + .data = LIS2DH12_ACCEL_DEV_NAME, 78 + }, 75 79 {}, 76 80 }; 77 81 MODULE_DEVICE_TABLE(of, st_accel_of_match); ··· 125 121 { LSM303DLM_ACCEL_DEV_NAME }, 126 122 { LSM330_ACCEL_DEV_NAME }, 127 123 { LSM303AGR_ACCEL_DEV_NAME }, 124 + { LIS2DH12_ACCEL_DEV_NAME }, 128 125 {}, 129 126 }; 130 127 MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
+1
drivers/iio/accel/st_accel_spi.c
··· 58 58 { LSM303DLM_ACCEL_DEV_NAME }, 59 59 { LSM330_ACCEL_DEV_NAME }, 60 60 { LSM303AGR_ACCEL_DEV_NAME }, 61 + { LIS2DH12_ACCEL_DEV_NAME }, 61 62 {}, 62 63 }; 63 64 MODULE_DEVICE_TABLE(spi, st_accel_id_table);