iio: st-accel: add support for lis2dh12
Subsystems (2)
PATCH v4 1/1 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
--- Documentation/devicetree/bindings/iio/st-sensors.txt | 1 + drivers/iio/accel/Kconfig | 2 +- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ drivers/iio/accel/st_accel_spi.c | 1 + 6 files changed, 10 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/iio/st-sensors.txt +1 -0
@@ -36,6 +36,7 @@ Accelerometers: - st,lsm303dlm-accel - st,lsm330-accel - st,lsm303agr-accel +- st,lis2dh12-accel Gyroscopes: - st,l3g4200d-gyro
drivers/iio/accel/Kconfig +1 -1
@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS help Say yes here to build support for STMicroelectronics accelerometers: 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 will be created:
drivers/iio/accel/st_accel.h +1 -0
@@ -27,6 +27,7 @@#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"#define LSM330_ACCEL_DEV_NAME "lsm330_accel"#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" +#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"/** * struct st_sensors_platform_data - default accel platform data
drivers/iio/accel/st_accel_core.c +1 -0
@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [3] = LSM330DL_ACCEL_DEV_NAME, [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, + [6 ] =LIS2DH12_ACCEL_DEV_NAME , }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {
drivers/iio/accel/st_accel_i2c.c +5 -0
@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lsm303agr-accel", .data = LSM303AGR_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis2dh12-accel", + .data = LIS2DH12_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);
@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);
drivers/iio/accel/st_accel_spi.c +1 -0
@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table);
Signature · 1 line
1.9.1
Good for me.
Quoted 101 lines · Giuseppe BARBA
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.pdfSigned-off-by Giuseppe Barba <[email protected]>--- Documentation/devicetree/bindings/iio/st-sensors.txt | 1 + drivers/iio/accel/Kconfig | 2 +- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ drivers/iio/accel/st_accel_spi.c | 1 + 6 files changed, 10 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/Documentation/devicetree/bindings/iio/st-sensors.txtindex d3ccdb1..d4b87cc 100644Documentation/devicetree/bindings/iio/st-sensors.txt +1
-0@@ -36,6 +36,7 @@ Accelerometers: - st,lsm303dlm-accel - st,lsm330-accel - st,lsm303agr-accel +- st,lis2dh12-accel Gyroscopes: - st,l3g4200d-gyrodrivers/iio/accel/Kconfig +1
-1@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS help Say yes here to build support for STMicroelectronics accelerometers: 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 will be created:drivers/iio/accel/st_accel.h +1
-0@@ -27,6 +27,7 @@#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"#define LSM330_ACCEL_DEV_NAME "lsm330_accel"#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" +#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"/** * struct st_sensors_platform_data - default accel platform data (quoted diff) +0
-0
b/drivers/iio/accel/st_accel_core.cindex dab8b76..9d973f1 100644drivers/iio/accel/st_accel_core.c +1
-0@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [3] = LSM330DL_ACCEL_DEV_NAME, [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, + [6] = LIS2DH12_ACCEL_DEV_NAME, }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {(quoted diff) +0
-0
b/drivers/iio/accel/st_accel_i2c.cindex 8b9cc84..294a32f 100644drivers/iio/accel/st_accel_i2c.c +5
-0@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lsm303agr-accel", .data = LSM303AGR_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis2dh12-accel", + .data = LIS2DH12_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, }; MODULE_DEVICE_TABLE(i2c, st_accel_id_table);(quoted diff) +0
-0
b/drivers/iio/accel/st_accel_spi.cindex 54b61a3..e82bedf 100644drivers/iio/accel/st_accel_spi.c +1
-0@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table);
Quoted 7 lines · Giuseppe Barba
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.pdfSigned-off-by Giuseppe Barba <[email protected]>
Quoted 96 lines
--- Documentation/devicetree/bindings/iio/st-sensors.txt | 1 + drivers/iio/accel/Kconfig | 2 +- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ drivers/iio/accel/st_accel_spi.c | 1 + 6 files changed, 10 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/iio/st-sensors.txt +1
-0@@ -36,6 +36,7 @@ Accelerometers: - st,lsm303dlm-accel - st,lsm330-accel - st,lsm303agr-accel +- st,lis2dh12-accel Gyroscopes: - st,l3g4200d-gyrodrivers/iio/accel/Kconfig +1
-1@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS help Say yes here to build support for STMicroelectronics accelerometers: 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 will be created:drivers/iio/accel/st_accel.h +1
-0@@ -27,6 +27,7 @@#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"#define LSM330_ACCEL_DEV_NAME "lsm330_accel"#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" +#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"/** * struct st_sensors_platform_data - default accel platform data drivers/iio/accel/st_accel_core.c +1
-0@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [3] = LSM330DL_ACCEL_DEV_NAME, [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, + [6 ] =LIS2DH12_ACCEL_DEV_NAME , }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {drivers/iio/accel/st_accel_i2c.c +5
-0@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lsm303agr-accel", .data = LSM303AGR_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis2dh12-accel", + .data = LIS2DH12_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);drivers/iio/accel/st_accel_spi.c +1
-1@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table); --1.9.1
Jonathan Cameron
maintainerQuoted 10 lines · Daniel Baluta
Quoted 7 lines · Giuseppe Barba
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.pdfSigned-off-by Giuseppe Barba <[email protected]>Acked-by Daniel Baluta <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play.
Quoted 102 lines
Quoted 95 lines
--- Documentation/devicetree/bindings/iio/st-sensors.txt | 1 + drivers/iio/accel/Kconfig | 2 +- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ drivers/iio/accel/st_accel_spi.c | 1 + 6 files changed, 10 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/iio/st-sensors.txt +1
-0@@ -36,6 +36,7 @@ Accelerometers: - st,lsm303dlm-accel - st,lsm330-accel - st,lsm303agr-accel +- st,lis2dh12-accel Gyroscopes: - st,l3g4200d-gyrodrivers/iio/accel/Kconfig +1
-1@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS help Say yes here to build support for STMicroelectronics accelerometers: 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 will be created:drivers/iio/accel/st_accel.h +1
-0@@ -27,6 +27,7 @@#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"#define LSM330_ACCEL_DEV_NAME "lsm330_accel"#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" +#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"/** * struct st_sensors_platform_data - default accel platform data drivers/iio/accel/st_accel_core.c +1
-0@@ -234,6 +234,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [3] = LSM330DL_ACCEL_DEV_NAME, [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, + [6 ] =LIS2DH12_ACCEL_DEV_NAME , }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {drivers/iio/accel/st_accel_i2c.c +5
-0@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lsm303agr-accel", .data = LSM303AGR_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis2dh12-accel", + .data = LIS2DH12_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);drivers/iio/accel/st_accel_spi.c +1
-1@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LSM303DLM_ACCEL_DEV_NAME }, { LSM330_ACCEL_DEV_NAME }, { LSM303AGR_ACCEL_DEV_NAME }, + { LIS2DH12_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table); --Quoted 2 lines
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html