devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] add support for ISM330IS
@ 2022-11-24  8:49 Lorenzo Bianconi
  2022-11-24  8:49 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ISM330IS Lorenzo Bianconi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2022-11-24  8:49 UTC (permalink / raw)
  To: jic23
  Cc: mario.tesi, linux-iio, devicetree, lorenzo.bianconi, robh+dt,
	krzysztof.kozlowski+dt

Add support for ISM330IS IMU mems sensor
https://www.st.com/resource/en/datasheet/ism330is.pdf

Lorenzo Bianconi (2):
  iio: imu: st_lsm6dsx: add support to ISM330IS
  dt-bindings: iio: imu: st_lsm6dsx: add ism330is

 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_core.c              | 8 ++++++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c               | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c               | 5 +++++
 6 files changed, 23 insertions(+), 4 deletions(-)

-- 
2.38.1


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

* [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ISM330IS
  2022-11-24  8:49 [PATCH 0/2] add support for ISM330IS Lorenzo Bianconi
@ 2022-11-24  8:49 ` Lorenzo Bianconi
  2022-11-24  8:49 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is Lorenzo Bianconi
  2022-11-24 19:27 ` [PATCH 0/2] add support for ISM330IS Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2022-11-24  8:49 UTC (permalink / raw)
  To: jic23
  Cc: mario.tesi, linux-iio, devicetree, lorenzo.bianconi, robh+dt,
	krzysztof.kozlowski+dt

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

Datasheet: https://www.st.com/resource/en/datasheet/ism330is.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_core.c | 8 ++++++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c  | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c  | 5 +++++
 5 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index 0096035728cd..f6660847fb58 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, the accelerometer/gyroscope
-	  of lsm9ds1 and lsm6dst.
+	  lsm6dsv, lsm6dsv16x, lsm6dso16is, ism330is, 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 abf14a2ce0e9..5b6f195748fc 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -36,6 +36,7 @@
 #define ST_LSM6DSV_DEV_NAME	"lsm6dsv"
 #define ST_LSM6DSV16X_DEV_NAME	"lsm6dsv16x"
 #define ST_LSM6DSO16IS_DEV_NAME	"lsm6dso16is"
+#define ST_ISM330IS_DEV_NAME	"ism330is"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
@@ -59,6 +60,7 @@ enum st_lsm6dsx_hw_id {
 	ST_LSM6DSV_ID,
 	ST_LSM6DSV16X_ID,
 	ST_LSM6DSO16IS_ID,
+	ST_ISM330IS_ID,
 	ST_LSM6DSX_MAX_ID,
 };
 
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 57a79bf35bba..3f6060c64f32 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -27,7 +27,7 @@
  *   - FIFO size: 4KB
  *
  * - LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP/
- *   LSM6DSTX/LSM6DSO16IS:
+ *   LSM6DSTX/LSM6DSO16IS/ISM330IS:
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416,
  *     833
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
@@ -1393,7 +1393,11 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 				.hw_id = ST_LSM6DSO16IS_ID,
 				.name = ST_LSM6DSO16IS_DEV_NAME,
 				.wai = 0x22,
-			},
+			}, {
+				.hw_id = ST_ISM330IS_ID,
+				.name = ST_ISM330IS_DEV_NAME,
+				.wai = 0x22,
+			}
 		},
 		.channels = {
 			[ST_LSM6DSX_ID_ACC] = {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index c34ccc85e4c7..df5f60925260 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -121,6 +121,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.compatible = "st,lsm6dso16is",
 		.data = (void *)ST_LSM6DSO16IS_ID,
 	},
+	{
+		.compatible = "st,ism330is",
+		.data = (void *)ST_ISM330IS_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
@@ -147,6 +151,7 @@ static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DSV_DEV_NAME, ST_LSM6DSV_ID },
 	{ ST_LSM6DSV16X_DEV_NAME, ST_LSM6DSV16X_ID },
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
+	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_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 24d5e51a8662..974584bda875 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -121,6 +121,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.compatible = "st,lsm6dso16is",
 		.data = (void *)ST_LSM6DSO16IS_ID,
 	},
+	{
+		.compatible = "st,ism330is",
+		.data = (void *)ST_ISM330IS_ID,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
@@ -147,6 +151,7 @@ static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DSV_DEV_NAME, ST_LSM6DSV_ID },
 	{ ST_LSM6DSV16X_DEV_NAME, ST_LSM6DSV16X_ID },
 	{ ST_LSM6DSO16IS_DEV_NAME, ST_LSM6DSO16IS_ID },
+	{ ST_ISM330IS_DEV_NAME, ST_ISM330IS_ID },
 	{},
 };
 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);
-- 
2.38.1


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

* [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is
  2022-11-24  8:49 [PATCH 0/2] add support for ISM330IS Lorenzo Bianconi
  2022-11-24  8:49 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ISM330IS Lorenzo Bianconi
@ 2022-11-24  8:49 ` Lorenzo Bianconi
  2022-11-24 10:21   ` Krzysztof Kozlowski
  2022-11-24 19:27 ` [PATCH 0/2] add support for ISM330IS Jonathan Cameron
  2 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2022-11-24  8:49 UTC (permalink / raw)
  To: jic23
  Cc: mario.tesi, linux-iio, devicetree, lorenzo.bianconi, robh+dt,
	krzysztof.kozlowski+dt

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

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 07d5aee7e442..68b481c63318 100644
--- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -43,6 +43,9 @@ properties:
       - items:
           - const: st,lsm6dsv16x
           - const: st,lsm6dsv
+      - items:
+          - const: st,ism330is
+          - const: st,lsm6dso16is
 
   reg:
     maxItems: 1
-- 
2.38.1


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

* Re: [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is
  2022-11-24  8:49 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is Lorenzo Bianconi
@ 2022-11-24 10:21   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-24 10:21 UTC (permalink / raw)
  To: Lorenzo Bianconi, jic23
  Cc: mario.tesi, linux-iio, devicetree, lorenzo.bianconi, robh+dt,
	krzysztof.kozlowski+dt

On 24/11/2022 09:49, Lorenzo Bianconi wrote:
> Add device bindings for ism330is IMU sensor.
> Use lsm6dso16is as fallback device for ism330is since it implements all the
> features currently supported by ism330is.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

There were few changes to this binding (new compatibles) and the names
are similar, so I hope the end result is correct... Briefly it looks fine:

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

Best regards,
Krzysztof


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

* Re: [PATCH 0/2] add support for ISM330IS
  2022-11-24  8:49 [PATCH 0/2] add support for ISM330IS Lorenzo Bianconi
  2022-11-24  8:49 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ISM330IS Lorenzo Bianconi
  2022-11-24  8:49 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is Lorenzo Bianconi
@ 2022-11-24 19:27 ` Jonathan Cameron
  2 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2022-11-24 19:27 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: mario.tesi, linux-iio, devicetree, lorenzo.bianconi, robh+dt,
	krzysztof.kozlowski+dt

On Thu, 24 Nov 2022 09:49:26 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Add support for ISM330IS IMU mems sensor
> https://www.st.com/resource/en/datasheet/ism330is.pdf

Looks safe enough for a very late application in the cycle as it'll
get only a day or so in next before I send the final pull request.
Applied

> 
> Lorenzo Bianconi (2):
>   iio: imu: st_lsm6dsx: add support to ISM330IS
>   dt-bindings: iio: imu: st_lsm6dsx: add ism330is
> 
>  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_core.c              | 8 ++++++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c               | 5 +++++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c               | 5 +++++
>  6 files changed, 23 insertions(+), 4 deletions(-)
> 


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

end of thread, other threads:[~2022-11-24 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24  8:49 [PATCH 0/2] add support for ISM330IS Lorenzo Bianconi
2022-11-24  8:49 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ISM330IS Lorenzo Bianconi
2022-11-24  8:49 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add ism330is Lorenzo Bianconi
2022-11-24 10:21   ` Krzysztof Kozlowski
2022-11-24 19:27 ` [PATCH 0/2] add support for ISM330IS Jonathan Cameron

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