Support LIS302DL in st_accel
Subsystems (2)
v2 cover Support LIS302DL in st_accel
Hi,
The ST Microelectronics LIS302DL is currently only supported in the evdev framework driver in drivers/misc/lis3lv02d. This series enables support for it in the iio framework.
Regards,
Sicelo
Sicelo A. Mhlongo (3):
dt-bindings: iio: st,st-sensors add LIS302DL
iio: accel: Remove unused enum in st_accel
iio: accel: add support for LIS302DL variant
.../bindings/iio/st,st-sensors.yaml | 1 + drivers/iio/accel/st_accel.h | 26 +------------------ drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 ++++ 4 files changed, 8 insertions(+), 25 deletions(-)
Signature · 1 line
2.35.1
PATCH v2 1/3 dt-bindings: iio: st,st-sensors add LIS302DL
Update st,st-sensors bindings for STMicroelectronics LIS302DL variant
--- Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iio/st,st-sensors.yaml +1 -0
@@ -29,6 +29,7 @@ properties: - st,lis2dw12 - st,lis2hh12 - st,lis2dh12-accel + - st,lis302dl - st,lis331dl-accel - st,lis331dlh-accel - st,lis3de
Signature · 1 line
2.35.1
Re: [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL
Quoted 7 lines · Sicelo A. Mhlongo
Update st,st-sensors bindings for STMicroelectronics LIS302DL variant
Reviewed-by Linus Walleij <[email protected]>Signed-off-by Sicelo A. Mhlongo <[email protected]>--- Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 + 1 file changed, 1 insertion(+)
PATCH v2 2/3 iio: accel: Remove unused enum in st_accel
In reply to Sicelo A. MhlongoThe st_accel_type enum is not used anywhere else in the code, and can be removed
--- drivers/iio/accel/st_accel.h | 25 ------------------------- 1 file changed, 25 deletions(-)
drivers/iio/accel/st_accel.h +0 -25
@@ -14,31 +14,6 @@#include <linux/types.h> #include <linux/iio/common/st_sensors.h> -enum st_accel_type { -LSM303DLH , -LSM303DLHC , -LIS3DH , -LSM330D , -LSM330DL , -LSM330DLC , -LIS331DLH , -LSM303DL , -LSM303DLM , -LSM330 , -LSM303AGR , -LIS2DH12 , -LIS3L02DQ , -LNG2DM , -H3LIS331DL , -LIS331DL , -LIS3LV02DL , -LIS2DW12 , -LIS3DHH , -LIS2DE12 , -LIS2HH12 , -ST_ACCEL_MAX , -}; -#define H3LIS331DL_ACCEL_DEV_NAME "h3lis331dl_accel"#define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel"#define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel"
Signature · 1 line
2.35.1
Re: [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel
Quoted 5 lines · Sicelo A. Mhlongo
The
st_accel_typeenum is not used anywhere else in the code, and can be removedSuggested-by Jonathan Cameron <[email protected]>Signed-off-by Sicelo A. Mhlongo <[email protected]>
Yours,
Linus Walleij
PATCH v2 3/3 iio: accel: add support for LIS302DL variant
In reply to Sicelo A. MhlongoAdd support for STMicroelectronics LIS302DL accelerometer to the st_accel framework.
https://www.st.com/resource/en/datasheet/lis302dl.pdf
--- drivers/iio/accel/st_accel.h | 1 + drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 +++++ 3 files changed, 7 insertions(+)
drivers/iio/accel/st_accel.h +1 -0
@@ -36,6 +36,7 @@#define LIS3DE_ACCEL_DEV_NAME "lis3de"#define LIS2DE12_ACCEL_DEV_NAME "lis2de12"#define LIS2HH12_ACCEL_DEV_NAME "lis2hh12" +#define LIS302DL_ACCEL_DEV_NAME "lis302dl"#ifdef CONFIG_IIO_BUFFER int st_accel_allocate_ring (struct iio_dev *indio_dev);
drivers/iio/accel/st_accel_core.c +1 -0
@@ -444,6 +444,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, .sensors_supported = { [0] = LIS331DL_ACCEL_DEV_NAME, + [1] = LIS302DL_ACCEL_DEV_NAME, }, .ch = (struct iio_chan_spec *)st_accel_8bit_channels, .odr = {
drivers/iio/accel/st_accel_i2c.c +5 -0
@@ -107,6 +107,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis2hh12", .data = LIS2HH12_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis302dl", + .data = LIS302DL_ACCEL_DEV_NAME, + }, {}, };MODULE_DEVICE_TABLE (of, st_accel_of_match);
@@ -142,6 +146,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS3DE_ACCEL_DEV_NAME }, { LIS2DE12_ACCEL_DEV_NAME }, { LIS2HH12_ACCEL_DEV_NAME }, + { LIS302DL_ACCEL_DEV_NAME }, {}, };MODULE_DEVICE_TABLE (i2c, st_accel_id_table);
Signature · 1 line
2.35.1
Re: [PATCH v2 3/3] iio: accel: add support for LIS302DL variant
Quoted 6 lines · Sicelo A. Mhlongo
Add support for STMicroelectronics LIS302DL accelerometer to the
st_accelframework.https://www.st.com/resource/en/datasheet/lis302dl.pdf
Signed-off-by Sicelo A. Mhlongo <[email protected]>
As discussed on chat this sensor has the nice freefall-detection feature which we should implement as an event in IIO one of these days :)
Yours,
Linus Walleij
Re: [PATCH v2 3/3] iio: accel: add support for LIS302DL variant
In reply to Sicelo A. MhlongoQuoted 4 lines · Sicelo A. Mhlongo
Add support for STMicroelectronics LIS302DL accelerometer to the
st_accelframework.
Can this be converted to Datasheet: tag, please?
Quoted 1 line
Signed-off-by Sicelo A. Mhlongo <[email protected]>
...
Quoted 1 line
drivers/iio/accel/st_accel_i2c.c | 5 +++++
Doesn't SPI also need to be updated? I believe those sensors are capable of both interfaces, but correct me, if I'm wrong.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · On Wed, 2 Mar 2022 00:54:29 +0200 "Sicelo A. Mhlongo" <[email protected]>…
Hi,
The ST Microelectronics LIS302DL is currently only supported in the evdev framework driver in
drivers/misc/lis3lv02d. This series enables support for it in the iio framework.
Other the the issues Andy raised around the tag and also adding SPI support this looks good to me.
We are very late in this cycle, so it is now material for 5.19. Plenty of time to make those final little tidy ups and get this queued early in the next cycle.
Thanks,
Jonathan
Quoted 15 lines
Regards,
SiceloSicelo A. Mhlongo (3):
dt-bindings: iio: st,st-sensors add LIS302DL
iio: accel: Remove unused enum inst_accel
iio: accel: add support for LIS302DL variant.../bindings/iio/st,st-sensors.yaml | 1 + drivers/iio/accel/st_accel.h | 26 +------------------ drivers/iio/accel/st_accel_core.c | 1 + drivers/iio/accel/st_accel_i2c.c | 5 ++++ 4 files changed, 8 insertions(+), 25 deletions(-)
Quoted 7 lines · Jonathan Cameron
Other the the issues Andy raised around the tag and also adding SPI support this looks good to me.
We are very late in this cycle, so it is now material for 5.19. Plenty of time to make those final little tidy ups and get this queued early in the next cycle.
Thank you so much. I will prepare next version of patches soon.
Sincerely
Sicelo