All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] add support for ASM330LHB
@ 2023-03-06 11:07 Lorenzo Bianconi
  2023-03-06 11:08 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHB Lorenzo Bianconi
  2023-03-06 11:08 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb Lorenzo Bianconi
  0 siblings, 2 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-03-06 11:07 UTC (permalink / raw
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

Add support for ASM330LHB IMU automotive mems sensor
https://www.st.com/resource/en/datasheet/asm330lhb.pdf

Lorenzo Bianconi (2):
  iio: imu: st_lsm6dsx: add support to ASM330LHB
  dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb

 Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 3 +++
 drivers/iio/imu/st_lsm6dsx/Kconfig                        | 4 ++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h                   | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c            | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c              | 4 ++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c               | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c               | 5 +++++
 7 files changed, 22 insertions(+), 3 deletions(-)

-- 
2.39.2


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

* [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHB
  2023-03-06 11:07 [PATCH 0/2] add support for ASM330LHB Lorenzo Bianconi
@ 2023-03-06 11:08 ` Lorenzo Bianconi
  2023-03-06 11:08 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb Lorenzo Bianconi
  1 sibling, 0 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-03-06 11:08 UTC (permalink / raw
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

Add support to STM ASM330LHB (acc + gyro) automotive Mems sensor.
The ASM330LHB sensor can use ASM330LHH as fallback device since it
implements all the ASM330LHB features currently implemented in
st_lsm6dsx.

Datasheet: https://www.st.com/resource/en/datasheet/asm330lhb.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 4 ++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 4 ++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
 6 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index f6660847fb58..caa82ba6fce5 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -13,8 +13,8 @@ config IIO_ST_LSM6DSX
 	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm,
 	  ism330dlc, lsm6dso, lsm6dsox, asm330lhh, asm330lhhx, lsm6dsr,
 	  lsm6ds3tr-c, ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop, lsm6dstx,
-	  lsm6dsv, lsm6dsv16x, lsm6dso16is, ism330is, lsm6dst and the
-	  accelerometer/gyroscope of lsm9ds1.
+	  lsm6dsv, lsm6dsv16x, lsm6dso16is, ism330is, asm330lhb, lsm6dst
+	  and the accelerometer/gyroscope of lsm9ds1.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm6dsx.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 8e119d78730b..9dfe4917a386 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -37,6 +37,7 @@
 #define ST_LSM6DSV16X_DEV_NAME	"lsm6dsv16x"
 #define ST_LSM6DSO16IS_DEV_NAME	"lsm6dso16is"
 #define ST_ISM330IS_DEV_NAME	"ism330is"
+#define ST_ASM330LHB_DEV_NAME	"asm330lhb"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
@@ -61,6 +62,7 @@ enum st_lsm6dsx_hw_id {
 	ST_LSM6DSV16X_ID,
 	ST_LSM6DSO16IS_ID,
 	ST_ISM330IS_ID,
+	ST_ASM330LHB_ID,
 	ST_LSM6DSX_MAX_ID,
 };
 
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index f6c11d6fb0b0..066fe561c5e8 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -15,7 +15,7 @@
  * value of the decimation factor and ODR set for each FIFO data set.
  *
  * LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/LSM6DSRX/ISM330DHCX/
- * LSM6DST/LSM6DSOP/LSM6DSTX/LSM6DSV:
+ * LSM6DST/LSM6DSOP/LSM6DSTX/LSM6DSV/ASM330LHB:
  * The FIFO buffer can be configured to store data from gyroscope and
  * accelerometer. Each sample is queued with a tag (1B) indicating data
  * source (gyroscope, accelerometer, hw timer).
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 966df6ffe874..455e5edd3a80 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -1032,6 +1032,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 				.hw_id = ST_LSM6DSOP_ID,
 				.name = ST_LSM6DSOP_DEV_NAME,
 				.wai = 0x6c,
+			}, {
+				.hw_id = ST_ASM330LHB_ID,
+				.name = ST_ASM330LHB_DEV_NAME,
+				.wai = 0x6b,
 			},
 		},
 		.channels = {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index df5f60925260..ccdc4ceffd85 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -125,6 +125,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.compatible = "st,ism330is",
 		.data = (void *)ST_ISM330IS_ID,
 	},
+	{
+		.compatible = "st,asm330lhb",
+		.data = (void *)ST_ASM330LHB_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
@@ -152,6 +156,7 @@ static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DSV16X_DEV_NAME, ST_LSM6DSV16X_ID },
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
 	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_ID },
+	{ ST_ASM330LHB_DEV_NAME, ST_ASM330LHB_ID },
 	{},
 };
 MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
index 974584bda875..f56c170c41a9 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -125,6 +125,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.compatible = "st,ism330is",
 		.data = (void *)ST_ISM330IS_ID,
 	},
+	{
+		.compatible = "st,asm330lhb",
+		.data = (void *)ST_ASM330LHB_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
@@ -152,6 +156,7 @@ static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DSV16X_DEV_NAME, ST_LSM6DSV16X_ID },
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
 	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_ID },
+	{ ST_ASM330LHB_DEV_NAME, ST_ASM330LHB_ID },
 	{},
 };
 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);
-- 
2.39.2


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

* [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb
  2023-03-06 11:07 [PATCH 0/2] add support for ASM330LHB Lorenzo Bianconi
  2023-03-06 11:08 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHB Lorenzo Bianconi
@ 2023-03-06 11:08 ` Lorenzo Bianconi
  2023-03-07  9:10   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-03-06 11:08 UTC (permalink / raw
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

Add device bindings for asm330lhb IMU sensor.
Use asm330lhh as fallback device for asm330lhb since it implements all
the features currently supported by asm330lhb.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
index decf022335d8..b39f5217d8ff 100644
--- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -46,6 +46,9 @@ properties:
       - items:
           - const: st,ism330is
           - const: st,lsm6dso16is
+      - items:
+          - const: st,asm330lhb
+          - const: st,asm330lhh
 
   reg:
     maxItems: 1
-- 
2.39.2


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

* Re: [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb
  2023-03-06 11:08 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb Lorenzo Bianconi
@ 2023-03-07  9:10   ` Krzysztof Kozlowski
  2023-03-09  9:57     ` Lorenzo Bianconi
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-07  9:10 UTC (permalink / raw
  To: Lorenzo Bianconi, jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

On 06/03/2023 12:08, Lorenzo Bianconi wrote:
> Add device bindings for asm330lhb IMU sensor.
> Use asm330lhh as fallback device for asm330lhb since it implements all
> the features currently supported by asm330lhb.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> index decf022335d8..b39f5217d8ff 100644
> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> @@ -46,6 +46,9 @@ properties:
>        - items:
>            - const: st,ism330is
>            - const: st,lsm6dso16is
> +      - items:
> +          - const: st,asm330lhb
> +          - const: st,asm330lhh

You added it to the end of the list, but aren't there any ordering
already? If so, it should be put rather in correct place.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof


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

* Re: [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb
  2023-03-07  9:10   ` Krzysztof Kozlowski
@ 2023-03-09  9:57     ` Lorenzo Bianconi
  2023-03-12 15:57       ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-03-09  9:57 UTC (permalink / raw
  To: Krzysztof Kozlowski
  Cc: jic23, linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On Mar 07, Krzysztof Kozlowski wrote:
> On 06/03/2023 12:08, Lorenzo Bianconi wrote:
> > Add device bindings for asm330lhb IMU sensor.
> > Use asm330lhh as fallback device for asm330lhb since it implements all
> > the features currently supported by asm330lhb.
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > index decf022335d8..b39f5217d8ff 100644
> > --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > @@ -46,6 +46,9 @@ properties:
> >        - items:
> >            - const: st,ism330is
> >            - const: st,lsm6dso16is
> > +      - items:
> > +          - const: st,asm330lhb
> > +          - const: st,asm330lhh
> 
> You added it to the end of the list, but aren't there any ordering
> already? If so, it should be put rather in correct place.

Hi Krzysztof,

I do not think there is any ordering issue there.

Regards,
Lorenzo

> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> 
> Best regards,
> Krzysztof
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb
  2023-03-09  9:57     ` Lorenzo Bianconi
@ 2023-03-12 15:57       ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2023-03-12 15:57 UTC (permalink / raw
  To: Lorenzo Bianconi
  Cc: Krzysztof Kozlowski, linux-iio, lorenzo.bianconi, devicetree,
	robh+dt, krzysztof.kozlowski+dt

On Thu, 9 Mar 2023 10:57:00 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> On Mar 07, Krzysztof Kozlowski wrote:
> > On 06/03/2023 12:08, Lorenzo Bianconi wrote:  
> > > Add device bindings for asm330lhb IMU sensor.
> > > Use asm330lhh as fallback device for asm330lhb since it implements all
> > > the features currently supported by asm330lhb.
> > > 
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > ---
> > >  Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > > index decf022335d8..b39f5217d8ff 100644
> > > --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > > @@ -46,6 +46,9 @@ properties:
> > >        - items:
> > >            - const: st,ism330is
> > >            - const: st,lsm6dso16is
> > > +      - items:
> > > +          - const: st,asm330lhb
> > > +          - const: st,asm330lhh  
> > 
> > You added it to the end of the list, but aren't there any ordering
> > already? If so, it should be put rather in correct place.  
> 
> Hi Krzysztof,
> 
> I do not think there is any ordering issue there.
As of today, they aren't in any particular order that I can see.
However, it might be nice to go for some sort of order as a follow up patch
(very low priority though!).

The same applies in the driver, where some of the entries could be organized
by name or maybe wai value.  Perhaps it's just not worth bothering and this
series doesn't make things worse, so I've applied the series to the togreg
branch of iio.git and pushed out initially as testing to let 0-day
see what it can find.

Thanks,

Jonathan

> 
> Regards,
> Lorenzo
> 
> > 
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > 
> > 
> > Best regards,
> > Krzysztof
> >   


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

end of thread, other threads:[~2023-03-12 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-06 11:07 [PATCH 0/2] add support for ASM330LHB Lorenzo Bianconi
2023-03-06 11:08 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHB Lorenzo Bianconi
2023-03-06 11:08 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhb Lorenzo Bianconi
2023-03-07  9:10   ` Krzysztof Kozlowski
2023-03-09  9:57     ` Lorenzo Bianconi
2023-03-12 15:57       ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.