Commit 34dc578d authored by Giuseppe Barba's avatar Giuseppe Barba Committed by Jonathan Cameron

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: default avatarGiuseppe Barba <giuseppe.barba@st.com>
Acked-by: default avatarDenis Ciocca <denis.ciocca@st.com>
Acked-by: default avatarDaniel Baluta <daniel.baluta@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 72a868b3
...@@ -36,6 +36,7 @@ Accelerometers: ...@@ -36,6 +36,7 @@ Accelerometers:
- st,lsm303dlm-accel - st,lsm303dlm-accel
- st,lsm330-accel - st,lsm330-accel
- st,lsm303agr-accel - st,lsm303agr-accel
- st,lis2dh12-accel
Gyroscopes: Gyroscopes:
- st,l3g4200d-gyro - st,l3g4200d-gyro
......
...@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS ...@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS
help help
Say yes here to build support for STMicroelectronics accelerometers: Say yes here to build support for STMicroelectronics accelerometers:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330. LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12.
This driver can also be built as a module. If so, these modules This driver can also be built as a module. If so, these modules
will be created: will be created:
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel" #define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"
#define LSM330_ACCEL_DEV_NAME "lsm330_accel" #define LSM330_ACCEL_DEV_NAME "lsm330_accel"
#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" #define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel"
#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"
/** /**
* struct st_sensors_platform_data - default accel platform data * struct st_sensors_platform_data - default accel platform data
......
...@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { ...@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
[3] = LSM330DL_ACCEL_DEV_NAME, [3] = LSM330DL_ACCEL_DEV_NAME,
[4] = LSM330DLC_ACCEL_DEV_NAME, [4] = LSM330DLC_ACCEL_DEV_NAME,
[5] = LSM303AGR_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME,
[6] = LIS2DH12_ACCEL_DEV_NAME,
}, },
.ch = (struct iio_chan_spec *)st_accel_12bit_channels, .ch = (struct iio_chan_spec *)st_accel_12bit_channels,
.odr = { .odr = {
......
...@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = { ...@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = {
.compatible = "st,lsm303agr-accel", .compatible = "st,lsm303agr-accel",
.data = LSM303AGR_ACCEL_DEV_NAME, .data = LSM303AGR_ACCEL_DEV_NAME,
}, },
{
.compatible = "st,lis2dh12-accel",
.data = LIS2DH12_ACCEL_DEV_NAME,
},
{}, {},
}; };
MODULE_DEVICE_TABLE(of, st_accel_of_match); MODULE_DEVICE_TABLE(of, st_accel_of_match);
...@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = { ...@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
{ LSM303DLM_ACCEL_DEV_NAME }, { LSM303DLM_ACCEL_DEV_NAME },
{ LSM330_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME },
{ LSM303AGR_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME },
{ LIS2DH12_ACCEL_DEV_NAME },
{}, {},
}; };
MODULE_DEVICE_TABLE(i2c, st_accel_id_table); MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
......
...@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = { ...@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = {
{ LSM303DLM_ACCEL_DEV_NAME }, { LSM303DLM_ACCEL_DEV_NAME },
{ LSM330_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME },
{ LSM303AGR_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME },
{ LIS2DH12_ACCEL_DEV_NAME },
{}, {},
}; };
MODULE_DEVICE_TABLE(spi, st_accel_id_table); MODULE_DEVICE_TABLE(spi, st_accel_id_table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment