devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Support LIS302DL in st_accel
@ 2022-03-01 22:54 Sicelo A. Mhlongo
  2022-03-01 22:54 ` [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL Sicelo A. Mhlongo
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Sicelo A. Mhlongo @ 2022-03-01 22:54 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio
  Cc: devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko,
	Sicelo A. Mhlongo

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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL
  2022-03-01 22:54 [PATCH v2 0/3] Support LIS302DL in st_accel Sicelo A. Mhlongo
@ 2022-03-01 22:54 ` Sicelo A. Mhlongo
  2022-03-02 18:04   ` Rob Herring
  2022-03-01 22:54 ` [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel Sicelo A. Mhlongo
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Sicelo A. Mhlongo @ 2022-03-01 22:54 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio
  Cc: devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko,
	Sicelo A. Mhlongo

Update st,st-sensors bindings for STMicroelectronics LIS302DL variant

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
index 71de5631ebae..321fd16b6ea7 100644
--- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
+++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
@@ -29,6 +29,7 @@ properties:
           - st,lis2dw12
           - st,lis2hh12
           - st,lis2dh12-accel
+          - st,lis302dl
           - st,lis331dl-accel
           - st,lis331dlh-accel
           - st,lis3de
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel
  2022-03-01 22:54 [PATCH v2 0/3] Support LIS302DL in st_accel Sicelo A. Mhlongo
  2022-03-01 22:54 ` [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL Sicelo A. Mhlongo
@ 2022-03-01 22:54 ` Sicelo A. Mhlongo
  2022-03-01 23:49   ` Linus Walleij
  2022-03-01 22:54 ` [PATCH v2 3/3] iio: accel: add support for LIS302DL variant Sicelo A. Mhlongo
  2022-03-05 15:59 ` [PATCH v2 0/3] Support LIS302DL in st_accel Jonathan Cameron
  3 siblings, 1 reply; 10+ messages in thread
From: Sicelo A. Mhlongo @ 2022-03-01 22:54 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio
  Cc: devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko,
	Sicelo A. Mhlongo, Jonathan Cameron

The st_accel_type enum is not used anywhere else in the code, and can be
removed

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 drivers/iio/accel/st_accel.h | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h
index 8750dea56fcb..969cc7faca07 100644
--- a/drivers/iio/accel/st_accel.h
+++ b/drivers/iio/accel/st_accel.h
@@ -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"
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/3] iio: accel: add support for LIS302DL variant
  2022-03-01 22:54 [PATCH v2 0/3] Support LIS302DL in st_accel Sicelo A. Mhlongo
  2022-03-01 22:54 ` [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL Sicelo A. Mhlongo
  2022-03-01 22:54 ` [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel Sicelo A. Mhlongo
@ 2022-03-01 22:54 ` Sicelo A. Mhlongo
  2022-03-01 23:50   ` Linus Walleij
  2022-03-02 13:59   ` Andy Shevchenko
  2022-03-05 15:59 ` [PATCH v2 0/3] Support LIS302DL in st_accel Jonathan Cameron
  3 siblings, 2 replies; 10+ messages in thread
From: Sicelo A. Mhlongo @ 2022-03-01 22:54 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio
  Cc: devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko,
	Sicelo A. Mhlongo

Add support for STMicroelectronics LIS302DL accelerometer to the st_accel
framework.

https://www.st.com/resource/en/datasheet/lis302dl.pdf

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 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(+)

diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h
index 969cc7faca07..0e79dc100ce5 100644
--- a/drivers/iio/accel/st_accel.h
+++ b/drivers/iio/accel/st_accel.h
@@ -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);
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index 31ea19d0ba71..2a353c51c84a 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -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 = {
diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
index c0ce78eebad9..086e8af89e18 100644
--- a/drivers/iio/accel/st_accel_i2c.c
+++ b/drivers/iio/accel/st_accel_i2c.c
@@ -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);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel
  2022-03-01 22:54 ` [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel Sicelo A. Mhlongo
@ 2022-03-01 23:49   ` Linus Walleij
  0 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2022-03-01 23:49 UTC (permalink / raw)
  To: Sicelo A. Mhlongo
  Cc: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio,
	devicetree, Lars-Peter Clausen, Andy Shevchenko, Jonathan Cameron

On Tue, Mar 1, 2022 at 11:55 PM Sicelo A. Mhlongo <absicsz@gmail.com> wrote:

> The st_accel_type enum is not used anywhere else in the code, and can be
> removed
>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] iio: accel: add support for LIS302DL variant
  2022-03-01 22:54 ` [PATCH v2 3/3] iio: accel: add support for LIS302DL variant Sicelo A. Mhlongo
@ 2022-03-01 23:50   ` Linus Walleij
  2022-03-02 13:59   ` Andy Shevchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2022-03-01 23:50 UTC (permalink / raw)
  To: Sicelo A. Mhlongo
  Cc: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio,
	devicetree, Lars-Peter Clausen, Andy Shevchenko

On Tue, Mar 1, 2022 at 11:56 PM Sicelo A. Mhlongo <absicsz@gmail.com> wrote:

> Add support for STMicroelectronics LIS302DL accelerometer to the st_accel
> framework.
>
> https://www.st.com/resource/en/datasheet/lis302dl.pdf
>
> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/3] iio: accel: add support for LIS302DL variant
  2022-03-01 22:54 ` [PATCH v2 3/3] iio: accel: add support for LIS302DL variant Sicelo A. Mhlongo
  2022-03-01 23:50   ` Linus Walleij
@ 2022-03-02 13:59   ` Andy Shevchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2022-03-02 13:59 UTC (permalink / raw)
  To: Sicelo A. Mhlongo
  Cc: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio,
	devicetree, Linus Walleij, Lars-Peter Clausen

On Wed, Mar 02, 2022 at 12:54:32AM +0200, Sicelo A. Mhlongo wrote:
> Add support for STMicroelectronics LIS302DL accelerometer to the st_accel
> framework.

> https://www.st.com/resource/en/datasheet/lis302dl.pdf

Can this be converted to Datasheet: tag, please?

> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>

...

>  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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL
  2022-03-01 22:54 ` [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL Sicelo A. Mhlongo
@ 2022-03-02 18:04   ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2022-03-02 18:04 UTC (permalink / raw)
  To: Sicelo A. Mhlongo
  Cc: Jonathan Cameron, Denis Ciocca, linux-iio, devicetree,
	Linus Walleij, Lars-Peter Clausen, Andy Shevchenko

On Wed, Mar 02, 2022 at 12:54:30AM +0200, Sicelo A. Mhlongo wrote:
> Update st,st-sensors bindings for STMicroelectronics LIS302DL variant
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
> ---
>  Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] Support LIS302DL in st_accel
  2022-03-01 22:54 [PATCH v2 0/3] Support LIS302DL in st_accel Sicelo A. Mhlongo
                   ` (2 preceding siblings ...)
  2022-03-01 22:54 ` [PATCH v2 3/3] iio: accel: add support for LIS302DL variant Sicelo A. Mhlongo
@ 2022-03-05 15:59 ` Jonathan Cameron
  2022-03-07  8:55   ` Sicelo
  3 siblings, 1 reply; 10+ messages in thread
From: Jonathan Cameron @ 2022-03-05 15:59 UTC (permalink / raw)
  To: Sicelo A. Mhlongo
  Cc: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio,
	devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko

On Wed,  2 Mar 2022 00:54:29 +0200
"Sicelo A. Mhlongo" <absicsz@gmail.com> wrote:

> 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

> 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(-)
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/3] Support LIS302DL in st_accel
  2022-03-05 15:59 ` [PATCH v2 0/3] Support LIS302DL in st_accel Jonathan Cameron
@ 2022-03-07  8:55   ` Sicelo
  0 siblings, 0 replies; 10+ messages in thread
From: Sicelo @ 2022-03-07  8:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jonathan Cameron, Rob Herring, Denis Ciocca, linux-iio,
	devicetree, Linus Walleij, Lars-Peter Clausen, Andy Shevchenko

On Sat, Mar 05, 2022 at 03:59:55PM +0000, Jonathan Cameron wrote:
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-07  8:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-01 22:54 [PATCH v2 0/3] Support LIS302DL in st_accel Sicelo A. Mhlongo
2022-03-01 22:54 ` [PATCH v2 1/3] dt-bindings: iio: st,st-sensors add LIS302DL Sicelo A. Mhlongo
2022-03-02 18:04   ` Rob Herring
2022-03-01 22:54 ` [PATCH v2 2/3] iio: accel: Remove unused enum in st_accel Sicelo A. Mhlongo
2022-03-01 23:49   ` Linus Walleij
2022-03-01 22:54 ` [PATCH v2 3/3] iio: accel: add support for LIS302DL variant Sicelo A. Mhlongo
2022-03-01 23:50   ` Linus Walleij
2022-03-02 13:59   ` Andy Shevchenko
2022-03-05 15:59 ` [PATCH v2 0/3] Support LIS302DL in st_accel Jonathan Cameron
2022-03-07  8:55   ` Sicelo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).