iio: st-accel: add support for lis3de
Subsystems (2)
PATCH 1/1 iio: st-accel: add support for lis3de
From: Heiko Stuebner <[email protected]>
This commit add support for STMicroelectronics lis3de accelerometer. Datasheet for this device can be found here:
https://www.st.com/resource/en/datasheet/lis3de.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 | 5 +++++ include/linux/iio/common/st_sensors.h | 2 +- 7 files changed, 15 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/iio/st-sensors.txt +1 -0
@@ -48,6 +48,7 @@ Accelerometers: - st,lis3l02dq - st,lis2dw12 - st,lis3dhh +- st,lis3de Gyroscopes: - st,l3g4200d-gyro
drivers/iio/accel/Kconfig +1 -1
@@ -223,7 +223,7 @@ config IIO_ST_ACCEL_3AXIS Say yes here to build support for STMicroelectronics accelerometers: LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL, - LNG2DM + LNG2DM, LIS3DE This driver can also be built as a module. If so, these modules will be created:
drivers/iio/accel/st_accel.h +1 -0
@@ -56,6 +56,7 @@ enum st_accel_type {#define LNG2DM_ACCEL_DEV_NAME "lng2dm"#define LIS2DW12_ACCEL_DEV_NAME "lis2dw12"#define LIS3DHH_ACCEL_DEV_NAME "lis3dhh" +#define LIS3DE_ACCEL_DEV_NAME "lis3de"/** * struct st_sensors_platform_data - default accel platform data
drivers/iio/accel/st_accel_core.c +1 -0
@@ -103,6 +103,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, [6] = LIS2DH12_ACCEL_DEV_NAME, + [7 ] =LIS3DE_ACCEL_DEV_NAME , }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {
drivers/iio/accel/st_accel_i2c.c +5 -0
@@ -98,6 +98,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis2dw12", .data = LIS2DW12_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis3de", + .data = LIS3DE_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);
@@ -135,6 +139,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS331DL_ACCEL_DEV_NAME }, { LIS3LV02DL_ACCEL_DEV_NAME }, { LIS2DW12_ACCEL_DEV_NAME }, + { LIS3DE_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);
drivers/iio/accel/st_accel_spi.c +5 -0
@@ -90,6 +90,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis3dhh", .data = LIS3DHH_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis3de", + .data = LIS3DE_ACCEL_DEV_NAME, + }, {} };MODULE_DEVICE_TABLE (of, st_accel_of_match);
@@ -143,6 +147,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LIS3LV02DL_ACCEL_DEV_NAME }, { LIS2DW12_ACCEL_DEV_NAME }, { LIS3DHH_ACCEL_DEV_NAME }, + { LIS3DE_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table);
include/linux/iio/common/st_sensors.h +1 -1
@@ -40,7 +40,7 @@#define ST_SENSORS_DEFAULT_STAT_ADDR 0x27#define ST_SENSORS_MAX_NAME 17 -#define ST_SENSORS_MAX_4WAI 7 +#define ST_SENSORS_MAX_4WAI 8#define ST_SENSORS_LSM_CHANNELS (device_type, mask, index, mod, \ ch2, s, endian, rbits, sbits, addr) \
Signature · 1 line
2.18.0
Jonathan Cameron
maintainerQuoted 8 lines · On Wed, 7 Nov 2018 16:45:21 +0100 Heiko Stuebner <[email protected]> wrote:
From: Heiko Stuebner <[email protected]>
This commit add support for STMicroelectronics lis3de accelerometer. Datasheet for this device can be found here:
https://www.st.com/resource/en/datasheet/lis3de.pdf
Signed-off-by Heiko Stuebner <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 118 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 | 5 +++++ include/linux/iio/common/st_sensors.h | 2 +- 7 files changed, 15 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/iio/st-sensors.txt +1
-0@@ -48,6 +48,7 @@ Accelerometers: - st,lis3l02dq - st,lis2dw12 - st,lis3dhh +- st,lis3de Gyroscopes: - st,l3g4200d-gyrodrivers/iio/accel/Kconfig +1
-1@@ -223,7 +223,7 @@ config IIO_ST_ACCEL_3AXIS Say yes here to build support for STMicroelectronics accelerometers: LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL, - LNG2DM + LNG2DM, LIS3DE This driver can also be built as a module. If so, these modules will be created:drivers/iio/accel/st_accel.h +1
-0@@ -56,6 +56,7 @@ enum st_accel_type {#define LNG2DM_ACCEL_DEV_NAME "lng2dm"#define LIS2DW12_ACCEL_DEV_NAME "lis2dw12"#define LIS3DHH_ACCEL_DEV_NAME "lis3dhh" +#define LIS3DE_ACCEL_DEV_NAME "lis3de"/** * struct st_sensors_platform_data - default accel platform data drivers/iio/accel/st_accel_core.c +1
-0@@ -103,6 +103,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { [4] = LSM330DLC_ACCEL_DEV_NAME, [5] = LSM303AGR_ACCEL_DEV_NAME, [6] = LIS2DH12_ACCEL_DEV_NAME, + [7 ] =LIS3DE_ACCEL_DEV_NAME , }, .ch = (struct iio_chan_spec *)st_accel_12bit_channels, .odr = {drivers/iio/accel/st_accel_i2c.c +5
-0@@ -98,6 +98,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis2dw12", .data = LIS2DW12_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis3de", + .data = LIS3DE_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);@@ -135,6 +139,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS331DL_ACCEL_DEV_NAME }, { LIS3LV02DL_ACCEL_DEV_NAME }, { LIS2DW12_ACCEL_DEV_NAME }, + { LIS3DE_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);drivers/iio/accel/st_accel_spi.c +5
-0@@ -90,6 +90,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis3dhh", .data = LIS3DHH_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis3de", + .data = LIS3DE_ACCEL_DEV_NAME, + }, {} };MODULE_DEVICE_TABLE (of, st_accel_of_match);@@ -143,6 +147,7 @@ static const struct spi_device_id st_accel_id_table[] = { { LIS3LV02DL_ACCEL_DEV_NAME }, { LIS2DW12_ACCEL_DEV_NAME }, { LIS3DHH_ACCEL_DEV_NAME }, + { LIS3DE_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (spi, st_accel_id_table);include/linux/iio/common/st_sensors.h +1
-1@@ -40,7 +40,7 @@#define ST_SENSORS_DEFAULT_STAT_ADDR 0x27#define ST_SENSORS_MAX_NAME 17 -#define ST_SENSORS_MAX_4WAI 7 +#define ST_SENSORS_MAX_4WAI 8#define ST_SENSORS_LSM_CHANNELS (device_type, mask, index, mod, \ ch2, s, endian, rbits, sbits, addr) \
Quoted 10 lines · Heiko Stuebner
From: Heiko Stuebner <[email protected]>
This commit add support for STMicroelectronics lis3de accelerometer. Datasheet for this device can be found here:
https://www.st.com/resource/en/datasheet/lis3de.pdf
Signed-off-by Heiko Stuebner <[email protected]>--- Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
Quoted 7 lines
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 | 5 +++++ include/linux/iio/common/st_sensors.h | 2 +- 7 files changed, 15 insertions(+), 2 deletions(-)