devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] add support for ASM330LHHXG1
@ 2024-01-28 11:25 Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 1/3] iio: imu: st_lsm6dsx: improve kernel docs and comments Lorenzo Bianconi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-28 11:25 UTC (permalink / raw)
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

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

Changes since v1:
- add patch 1/3 to improve kernel docs and comments

Lorenzo Bianconi (3):
  iio: imu: st_lsm6dsx: improve kernel docs and comments
  iio: imu: st_lsm6dsx: add support to ASM330LHHXG1
  dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1

 .../bindings/iio/imu/st,lsm6dsx.yaml          |  3 ++
 drivers/iio/imu/st_lsm6dsx/Kconfig            | 31 ++++++++++++++---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h       |  2 ++
 .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c    | 28 ++++++++++++++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c  | 33 +++++++++++++++----
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c   |  5 +++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c   |  5 +++
 7 files changed, 93 insertions(+), 14 deletions(-)

-- 
2.43.0


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

* [PATCH v2 1/3] iio: imu: st_lsm6dsx: improve kernel docs and comments
  2024-01-28 11:25 [PATCH v2 0/3] add support for ASM330LHHXG1 Lorenzo Bianconi
@ 2024-01-28 11:25 ` Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 2/3] iio: imu: st_lsm6dsx: add support to ASM330LHHXG1 Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1 Lorenzo Bianconi
  2 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-28 11:25 UTC (permalink / raw)
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

Improve kernel docs and comments reporting supported sensors in a list in
order to make more easy to add new devices in the future.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig            | 30 +++++++++++++++----
 .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c    | 27 +++++++++++++++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c  | 28 +++++++++++++----
 3 files changed, 71 insertions(+), 14 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index 5865a295a4df..24914946f914 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -11,11 +11,31 @@ config IIO_ST_LSM6DSX
 	select IIO_ST_LSM6DSX_I3C if (I3C)
 	help
 	  Say yes here to build support for STMicroelectronics LSM6DSx imu
-	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm,
-	  ism330dlc, lsm6dso, lsm6dsox, asm330lhh, asm330lhhx, lsm6dsr,
-	  lsm6ds3tr-c, ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop, lsm6dstx,
-	  lsm6dsv, lsm6dsv16x, lsm6dso16is, ism330is, asm330lhb, lsm6dst
-	  and the accelerometer/gyroscope of lsm9ds1.
+	  sensor.
+	  Supported devices:
+	  - asm330lhb
+	  - asm330lhh
+	  - asm330lhhx
+	  - ism330dhcx
+	  - ism330dlc
+	  - ism330is
+	  - lsm6ds0
+	  - lsm6ds3
+	  - lsm6ds3h
+	  - lsm6ds3tr-c
+	  - lsm6dsl
+	  - lsm6dsm
+	  - lsm6dso
+	  - lsm6dso16is
+	  - lsm6dsop
+	  - lsm6dsox
+	  - lsm6dsr
+	  - lsm6dsrx
+	  - lsm6dst
+	  - lsm6dstx
+	  - lsm6dsv
+	  - lsm6dsv16x
+	  - 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_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 066fe561c5e8..154f92fa9a87 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -2,7 +2,7 @@
 /*
  * STMicroelectronics st_lsm6dsx FIFO buffer library driver
  *
- * LSM6DS3/LSM6DS3H/LSM6DSL/LSM6DSM/ISM330DLC/LSM6DS3TR-C:
+ * Pattern FIFO:
  * The FIFO buffer can be configured to store data from gyroscope and
  * accelerometer. Samples are queued without any tag according to a
  * specific pattern based on 'FIFO data sets' (6 bytes each):
@@ -14,12 +14,33 @@
  * (e.g. Gx, Gy, Gz, Ax, Ay, Az), then data are repeated depending on the
  * value of the decimation factor and ODR set for each FIFO data set.
  *
- * LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/LSM6DSRX/ISM330DHCX/
- * LSM6DST/LSM6DSOP/LSM6DSTX/LSM6DSV/ASM330LHB:
+ * Supported devices:
+ * - ISM330DLC
+ * - LSM6DS3
+ * - LSM6DS3H
+ * - LSM6DS3TR-C
+ * - LSM6DSL
+ * - LSM6DSM
+ *
+ * Tagged FIFO:
  * 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).
  *
+ * Supported devices:
+ * - ASM330LHB
+ * - ASM330LHH
+ * - ASM330LHHX
+ * - ISM330DHCX
+ * - LSM6DSO
+ * - LSM6DSOP
+ * - LSM6DSOX
+ * - LSM6DSR
+ * - LSM6DSRX
+ * - LSM6DST
+ * - LSM6DSTX
+ * - LSM6DSV
+ *
  * FIFO supported modes:
  *  - BYPASS: FIFO disabled
  *  - CONTINUOUS: FIFO enabled. When the buffer is full, the FIFO index
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index b6e6b1df8a61..01ef9d38aadd 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -14,34 +14,50 @@
  * by a different driver.
  *
  * Supported sensors:
- * - LSM6DS3:
+ *
+ * - LSM6DS3
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 8KB
  *
- * - LSM6DS3H/LSM6DSL/LSM6DSM/ISM330DLC/LSM6DS3TR-C:
+ * - ISM330DLC
+ * - LSM6DS3H
+ * - LSM6DS3TR-C
+ * - LSM6DSL
+ * - LSM6DSM
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 4KB
  *
- * - LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP/
- *   LSM6DSTX/LSM6DSO16IS/ISM330IS:
+ * - ASM330LHH
+ * - ASM330LHHX
+ * - ISM330DHCX
+ * - ISM330IS
+ * - LSM6DSO
+ * - LSM6DSO16IS
+ * - LSM6DSOP
+ * - LSM6DSOX
+ * - LSM6DSR
+ * - LSM6DST
+ * - LSM6DSTX
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416,
  *     833
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 3KB
  *
- * - LSM6DSV/LSM6DSV16X:
+ * - LSM6DSV
+ * - LSM6DSV16X
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 7.5, 15, 30, 60, 120, 240,
  *     480, 960
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-250/+-500/+-1000/+-2000
  *   - FIFO size: 3KB
  *
- * - LSM9DS1/LSM6DS0:
+ * - LSM6DS0
+ * - LSM9DS1
  *   - Accelerometer supported ODR [Hz]: 10, 50, 119, 238, 476, 952
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported ODR [Hz]: 15, 60, 119, 238, 476, 952
-- 
2.43.0


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

* [PATCH v2 2/3] iio: imu: st_lsm6dsx: add support to ASM330LHHXG1
  2024-01-28 11:25 [PATCH v2 0/3] add support for ASM330LHHXG1 Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 1/3] iio: imu: st_lsm6dsx: improve kernel docs and comments Lorenzo Bianconi
@ 2024-01-28 11:25 ` Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1 Lorenzo Bianconi
  2 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-28 11:25 UTC (permalink / raw)
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

Add support to STM ASM330LHHXG1 (accelerometer and gyroscope) Mems
sensor.
The ASM330LHHXG1 sensor can use ASM330LHHX as fallback device since it
implements all the ASM330LHHXG1 features currently implemented in
st_lsm6dsx.

Link: https://www.st.com/resource/en/datasheet/asm330lhhxg1.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 1 +
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 1 +
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 5 +++++
 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(+)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index 24914946f914..89d687ec3099 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -16,6 +16,7 @@ config IIO_ST_LSM6DSX
 	  - asm330lhb
 	  - asm330lhh
 	  - asm330lhhx
+	  - asm330lhhxg1
 	  - ism330dhcx
 	  - ism330dlc
 	  - ism330is
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index c19237717e81..a3b93566533b 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -38,6 +38,7 @@
 #define ST_LSM6DSO16IS_DEV_NAME	"lsm6dso16is"
 #define ST_ISM330IS_DEV_NAME	"ism330is"
 #define ST_ASM330LHB_DEV_NAME	"asm330lhb"
+#define ST_ASM330LHHXG1_DEV_NAME	"asm330lhhxg1"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID = 1,
@@ -63,6 +64,7 @@ enum st_lsm6dsx_hw_id {
 	ST_LSM6DSO16IS_ID,
 	ST_ISM330IS_ID,
 	ST_ASM330LHB_ID,
+	ST_ASM330LHHXG1_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 154f92fa9a87..0a7cd8c1aa33 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -31,6 +31,7 @@
  * - ASM330LHB
  * - ASM330LHH
  * - ASM330LHHX
+ * - ASM330LHHXG1
  * - ISM330DHCX
  * - LSM6DSO
  * - LSM6DSOP
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 01ef9d38aadd..0716986f9812 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -33,6 +33,7 @@
  *
  * - ASM330LHH
  * - ASM330LHHX
+ * - ASM330LHHXG1
  * - ISM330DHCX
  * - ISM330IS
  * - LSM6DSO
@@ -836,6 +837,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 				.hw_id = ST_ASM330LHHX_ID,
 				.name = ST_ASM330LHHX_DEV_NAME,
 				.wai = 0x6b,
+			}, {
+				.hw_id = ST_ASM330LHHXG1_ID,
+				.name = ST_ASM330LHHXG1_DEV_NAME,
+				.wai = 0x6b,
 			}, {
 				.hw_id = ST_LSM6DSTX_ID,
 				.name = ST_LSM6DSTX_DEV_NAME,
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index 911444ec57c0..cddf41cc0ca9 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -134,6 +134,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.compatible = "st,asm330lhb",
 		.data = (void *)ST_ASM330LHB_ID,
 	},
+	{
+		.compatible = "st,asm330lhhxg1",
+		.data = (void *)ST_ASM330LHHXG1_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
@@ -168,6 +172,7 @@ static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
 	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_ID },
 	{ ST_ASM330LHB_DEV_NAME, ST_ASM330LHB_ID },
+	{ ST_ASM330LHHXG1_DEV_NAME, ST_ASM330LHHXG1_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 f56c170c41a9..c122c8831365 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -129,6 +129,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.compatible = "st,asm330lhb",
 		.data = (void *)ST_ASM330LHB_ID,
 	},
+	{
+		.compatible = "st,asm330lhhxg1",
+		.data = (void *)ST_ASM330LHHXG1_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
@@ -157,6 +161,7 @@ static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
 	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_ID },
 	{ ST_ASM330LHB_DEV_NAME, ST_ASM330LHB_ID },
+	{ ST_ASM330LHHXG1_DEV_NAME, ST_ASM330LHHXG1_ID },
 	{},
 };
 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);
-- 
2.43.0


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

* [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-28 11:25 [PATCH v2 0/3] add support for ASM330LHHXG1 Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 1/3] iio: imu: st_lsm6dsx: improve kernel docs and comments Lorenzo Bianconi
  2024-01-28 11:25 ` [PATCH v2 2/3] iio: imu: st_lsm6dsx: add support to ASM330LHHXG1 Lorenzo Bianconi
@ 2024-01-28 11:25 ` Lorenzo Bianconi
  2024-01-28 13:45   ` Jonathan Cameron
  2024-01-29  8:12   ` Krzysztof Kozlowski
  2 siblings, 2 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-28 11:25 UTC (permalink / raw)
  To: jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

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

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 28b667a9cb76..7ba3de66a2e1 100644
--- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -49,6 +49,9 @@ properties:
       - items:
           - const: st,asm330lhb
           - const: st,asm330lhh
+      - items:
+          - const: st,asm330lhhxg1
+          - const: st,asm330lhhx
 
   reg:
     maxItems: 1
-- 
2.43.0


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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-28 11:25 ` [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1 Lorenzo Bianconi
@ 2024-01-28 13:45   ` Jonathan Cameron
  2024-01-28 13:57     ` Lorenzo Bianconi
  2024-01-29  8:12   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2024-01-28 13:45 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

On Sun, 28 Jan 2024 12:25:45 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Add device bindings for asm330lhhxg1 IMU sensor.
> Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> all the features currently supported by asm330lhhxg1.

If there are no other changes, I can amend this text whilst applying.
Something lie:

The asm330lhhx supports a subset of the features and functionality
provided by the asm330lhhxg1 via identical interfaces and so is a
suitable fallback compatible.

As normal for bindings we shouldn't talk about the driver though
what we really care about here is that the driver will never support
functionality for the fallback part that doesn't apply for the
more advanced part (because there isn't any!)

> 
> 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 28b667a9cb76..7ba3de66a2e1 100644
> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> @@ -49,6 +49,9 @@ properties:
>        - items:
>            - const: st,asm330lhb
>            - const: st,asm330lhh
> +      - items:
> +          - const: st,asm330lhhxg1
> +          - const: st,asm330lhhx
>  
>    reg:
>      maxItems: 1


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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-28 13:45   ` Jonathan Cameron
@ 2024-01-28 13:57     ` Lorenzo Bianconi
  0 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-28 13:57 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

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

> On Sun, 28 Jan 2024 12:25:45 +0100
> Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> 
> > Add device bindings for asm330lhhxg1 IMU sensor.
> > Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> > all the features currently supported by asm330lhhxg1.
> 
> If there are no other changes, I can amend this text whilst applying.
> Something lie:
> 
> The asm330lhhx supports a subset of the features and functionality
> provided by the asm330lhhxg1 via identical interfaces and so is a
> suitable fallback compatible.

I think it is fine, thx Jonathan.

Regards,
Lorenzo

> 
> As normal for bindings we shouldn't talk about the driver though
> what we really care about here is that the driver will never support
> functionality for the fallback part that doesn't apply for the
> more advanced part (because there isn't any!)
> 
> > 
> > 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 28b667a9cb76..7ba3de66a2e1 100644
> > --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > @@ -49,6 +49,9 @@ properties:
> >        - items:
> >            - const: st,asm330lhb
> >            - const: st,asm330lhh
> > +      - items:
> > +          - const: st,asm330lhhxg1
> > +          - const: st,asm330lhhx
> >  
> >    reg:
> >      maxItems: 1
> 

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

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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-28 11:25 ` [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1 Lorenzo Bianconi
  2024-01-28 13:45   ` Jonathan Cameron
@ 2024-01-29  8:12   ` Krzysztof Kozlowski
  2024-01-29 13:30     ` Lorenzo Bianconi
  1 sibling, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-29  8:12 UTC (permalink / raw)
  To: Lorenzo Bianconi, jic23
  Cc: linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

On 28/01/2024 12:25, Lorenzo Bianconi wrote:
> Add device bindings for asm330lhhxg1 IMU sensor.
> Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> all the features currently supported by asm330lhhxg1.
> 
> 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 28b667a9cb76..7ba3de66a2e1 100644
> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> @@ -49,6 +49,9 @@ properties:
>        - items:
>            - const: st,asm330lhb
>            - const: st,asm330lhh
> +      - items:
> +          - const: st,asm330lhhxg1
> +          - const: st,asm330lhhx

lhhx is compatible with st,lsm6dsr, so some explanation would be useful
why it is not included here.

Best regards,
Krzysztof


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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-29  8:12   ` Krzysztof Kozlowski
@ 2024-01-29 13:30     ` Lorenzo Bianconi
  2024-01-29 13:36       ` Krzysztof Kozlowski
  2024-01-31 17:32       ` Rob Herring
  0 siblings, 2 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-29 13:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: jic23, linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

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

> On 28/01/2024 12:25, Lorenzo Bianconi wrote:
> > Add device bindings for asm330lhhxg1 IMU sensor.
> > Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> > all the features currently supported by asm330lhhxg1.
> > 
> > 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 28b667a9cb76..7ba3de66a2e1 100644
> > --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > @@ -49,6 +49,9 @@ properties:
> >        - items:
> >            - const: st,asm330lhb
> >            - const: st,asm330lhh
> > +      - items:
> > +          - const: st,asm330lhhxg1
> > +          - const: st,asm330lhhx
> 
> lhhx is compatible with st,lsm6dsr, so some explanation would be useful
> why it is not included here.
> 
> Best regards,
> Krzysztof
> 

Do you mean something like:

diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
index 7ba3de66a2e1..92feba6e2427 100644
--- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -35,6 +35,7 @@ properties:
           - st,lsm6dsv
           - st,lsm6dso16is
       - items:
+          - const: st,asm330lhhxg1
           - const: st,asm330lhhx
           - const: st,lsm6dsr
       - items:

Regards,
Lorenzo

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

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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-29 13:30     ` Lorenzo Bianconi
@ 2024-01-29 13:36       ` Krzysztof Kozlowski
  2024-01-29 13:39         ` Lorenzo Bianconi
  2024-01-31 17:32       ` Rob Herring
  1 sibling, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-29 13:36 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: jic23, linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

On 29/01/2024 14:30, Lorenzo Bianconi wrote:
>> On 28/01/2024 12:25, Lorenzo Bianconi wrote:
>>> Add device bindings for asm330lhhxg1 IMU sensor.
>>> Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
>>> all the features currently supported by asm330lhhxg1.
>>>
>>> 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 28b667a9cb76..7ba3de66a2e1 100644
>>> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
>>> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
>>> @@ -49,6 +49,9 @@ properties:
>>>        - items:
>>>            - const: st,asm330lhb
>>>            - const: st,asm330lhh
>>> +      - items:
>>> +          - const: st,asm330lhhxg1
>>> +          - const: st,asm330lhhx
>>
>> lhhx is compatible with st,lsm6dsr, so some explanation would be useful
>> why it is not included here.
>>
>> Best regards,
>> Krzysztof
>>
> 
> Do you mean something like:
> 

I meant either explanation in commit msg or adding lsm6dsr fallback.

Best regards,
Krzysztof


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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-29 13:36       ` Krzysztof Kozlowski
@ 2024-01-29 13:39         ` Lorenzo Bianconi
  0 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Bianconi @ 2024-01-29 13:39 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: jic23, linux-iio, lorenzo.bianconi, devicetree, robh+dt,
	krzysztof.kozlowski+dt

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

> On 29/01/2024 14:30, Lorenzo Bianconi wrote:
> >> On 28/01/2024 12:25, Lorenzo Bianconi wrote:
> >>> Add device bindings for asm330lhhxg1 IMU sensor.
> >>> Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> >>> all the features currently supported by asm330lhhxg1.
> >>>
> >>> 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 28b667a9cb76..7ba3de66a2e1 100644
> >>> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> >>> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> >>> @@ -49,6 +49,9 @@ properties:
> >>>        - items:
> >>>            - const: st,asm330lhb
> >>>            - const: st,asm330lhh
> >>> +      - items:
> >>> +          - const: st,asm330lhhxg1
> >>> +          - const: st,asm330lhhx
> >>
> >> lhhx is compatible with st,lsm6dsr, so some explanation would be useful
> >> why it is not included here.
> >>
> >> Best regards,
> >> Krzysztof
> >>
> > 
> > Do you mean something like:
> > 
> 
> I meant either explanation in commit msg or adding lsm6dsr fallback.
> 
> Best regards,
> Krzysztof
> 

I think we can use lsm6dsr as fallback instead of asm330lhhx (for st_lsm6dsx
there is no difference), I have just used asm330lhhx since both asm330lhhx and
asm330lhhxg1 are automotive sensors.

Regards,
Lorenzo

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

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

* Re: [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1
  2024-01-29 13:30     ` Lorenzo Bianconi
  2024-01-29 13:36       ` Krzysztof Kozlowski
@ 2024-01-31 17:32       ` Rob Herring
  1 sibling, 0 replies; 11+ messages in thread
From: Rob Herring @ 2024-01-31 17:32 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Krzysztof Kozlowski, jic23, linux-iio, lorenzo.bianconi,
	devicetree, krzysztof.kozlowski+dt

On Mon, Jan 29, 2024 at 02:30:27PM +0100, Lorenzo Bianconi wrote:
> > On 28/01/2024 12:25, Lorenzo Bianconi wrote:
> > > Add device bindings for asm330lhhxg1 IMU sensor.
> > > Use asm330lhhx as fallback device for asm330lhhxg1 since it implements
> > > all the features currently supported by asm330lhhxg1.
> > > 
> > > 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 28b667a9cb76..7ba3de66a2e1 100644
> > > --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> > > @@ -49,6 +49,9 @@ properties:
> > >        - items:
> > >            - const: st,asm330lhb
> > >            - const: st,asm330lhh
> > > +      - items:
> > > +          - const: st,asm330lhhxg1
> > > +          - const: st,asm330lhhx
> > 
> > lhhx is compatible with st,lsm6dsr, so some explanation would be useful
> > why it is not included here.
> > 
> > Best regards,
> > Krzysztof
> > 
> 
> Do you mean something like:
> 
> diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> index 7ba3de66a2e1..92feba6e2427 100644
> --- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
> @@ -35,6 +35,7 @@ properties:
>            - st,lsm6dsv
>            - st,lsm6dso16is
>        - items:
> +          - const: st,asm330lhhxg1
>            - const: st,asm330lhhx
>            - const: st,lsm6dsr

No, that's not right because you just changed the existing user.

You need to explain why "st,lsm6dsr" is not needed as a fallback or you 
need your original change with "st,lsm6dsr" added on the end. (And group 
it next to the original entry, not at the end.)

The question to ask is whether software that only understands what 
"st,lsm6dsr" is will work with this newer device.

Rob

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

end of thread, other threads:[~2024-01-31 17:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-28 11:25 [PATCH v2 0/3] add support for ASM330LHHXG1 Lorenzo Bianconi
2024-01-28 11:25 ` [PATCH v2 1/3] iio: imu: st_lsm6dsx: improve kernel docs and comments Lorenzo Bianconi
2024-01-28 11:25 ` [PATCH v2 2/3] iio: imu: st_lsm6dsx: add support to ASM330LHHXG1 Lorenzo Bianconi
2024-01-28 11:25 ` [PATCH v2 3/3] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhxg1 Lorenzo Bianconi
2024-01-28 13:45   ` Jonathan Cameron
2024-01-28 13:57     ` Lorenzo Bianconi
2024-01-29  8:12   ` Krzysztof Kozlowski
2024-01-29 13:30     ` Lorenzo Bianconi
2024-01-29 13:36       ` Krzysztof Kozlowski
2024-01-29 13:39         ` Lorenzo Bianconi
2024-01-31 17:32       ` Rob Herring

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