All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D
@ 2022-03-23 12:15 michael.srba
  2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: michael.srba @ 2022-03-23 12:15 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring
  Cc: Jean-Baptiste Maneyrol, Krzysztof Kozlowski, linux-iio,
	devicetree, Michael Srba

From: Michael Srba <Michael.Srba@seznam.cz>

This series copies the invensense icm20608 support in the inv_mpu6050
driver for icm20608d, which is for all intents and purposes identical,
except for the inclusion of a DMP (Digital Motion Processor), which
is deemed significant enough to change the WHOAMI value, thereby making
the driver fail if the invensense,icm20608 compatible is specified.

Since the driver doesn't currently acknowledge that there is such thing
as a DMP core, all that is needed is to copy the icm20608 support and
change the WHOAMI value.

changelog:
 -v2: require specifying "invensense,icm20608" as a fallback compatible
      in the binding, as suggested
 -v3: fix indentation issue with the binding

Michael Srba (2):
  dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
  iio: imu: inv_mpu6050: Add support for ICM-20608-D

 .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
 drivers/iio/imu/inv_mpu6050/Kconfig           |  4 +--
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  9 +++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c     |  6 ++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  2 ++
 drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c     |  5 +++
 6 files changed, 43 insertions(+), 17 deletions(-)

-- 
2.35.1


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

* [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
  2022-03-23 12:15 [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
@ 2022-03-23 12:15 ` michael.srba
  2022-03-23 14:26   ` Krzysztof Kozlowski
  2022-03-23 16:00   ` Rob Herring
  2022-03-23 12:15 ` [PATCH v3 2/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
  2022-03-27 15:05 ` [PATCH v2 0/2] " Jonathan Cameron
  2 siblings, 2 replies; 7+ messages in thread
From: michael.srba @ 2022-03-23 12:15 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring
  Cc: Jean-Baptiste Maneyrol, Krzysztof Kozlowski, linux-iio,
	devicetree, Michael Srba

From: Michael Srba <Michael.Srba@seznam.cz>

ICM-20608-D differs from the other ICM-20608 variants by having
a DMP (Digital Motion Processor) core tacked on.
Despite having a different WHOAMI register, this variant is
completely interchangeable with the other ICM-20608 variants
by simply pretending the DMP core doesn't exist.

Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
---
changelog:
 - v2: require specifying "invensense,icm20608" as a fallback
       compatible
 - v3: fix indentation
---
 .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
index d69595a524c1..3ebc6526d82d 100644
--- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
@@ -14,21 +14,25 @@ description: |
 
 properties:
   compatible:
-    enum:
-      - invensense,iam20680
-      - invensense,icm20608
-      - invensense,icm20609
-      - invensense,icm20689
-      - invensense,icm20602
-      - invensense,icm20690
-      - invensense,mpu6000
-      - invensense,mpu6050
-      - invensense,mpu6500
-      - invensense,mpu6515
-      - invensense,mpu6880
-      - invensense,mpu9150
-      - invensense,mpu9250
-      - invensense,mpu9255
+    oneOf:
+      - enum:
+          - invensense,iam20680
+          - invensense,icm20608
+          - invensense,icm20609
+          - invensense,icm20689
+          - invensense,icm20602
+          - invensense,icm20690
+          - invensense,mpu6000
+          - invensense,mpu6050
+          - invensense,mpu6500
+          - invensense,mpu6515
+          - invensense,mpu6880
+          - invensense,mpu9150
+          - invensense,mpu9250
+          - invensense,mpu9255
+      - items:
+          - const: invensense,icm20608d
+          - const: invensense,icm20608
 
   reg:
     maxItems: 1
-- 
2.35.1


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

* [PATCH v3 2/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D
  2022-03-23 12:15 [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
  2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
@ 2022-03-23 12:15 ` michael.srba
  2022-03-27 15:05 ` [PATCH v2 0/2] " Jonathan Cameron
  2 siblings, 0 replies; 7+ messages in thread
From: michael.srba @ 2022-03-23 12:15 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring
  Cc: Jean-Baptiste Maneyrol, Krzysztof Kozlowski, linux-iio,
	devicetree, Michael Srba, Jean-Baptiste Maneyrol

From: Michael Srba <Michael.Srba@seznam.cz>

The difference between the ICM-20608-D and the other ICM-20608
variants is the addition of a DMP (Digital Motion Processor) core.
This difference is deemed substantial enough to change the WHOAMI
register value.
Since this driver doesn't currently acknowledge the exisence of
something like a DMP core, simply copy ICM-20608 except for the
aforementioned WHOAMI register.

Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
---
changes:
 - v2: none
 - v3: none
---
 drivers/iio/imu/inv_mpu6050/Kconfig        | 4 ++--
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 +++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c  | 6 ++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h  | 2 ++
 drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c  | 5 +++++
 5 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig
index 9c625517173a..3636b1bc90f1 100644
--- a/drivers/iio/imu/inv_mpu6050/Kconfig
+++ b/drivers/iio/imu/inv_mpu6050/Kconfig
@@ -16,7 +16,7 @@ config INV_MPU6050_I2C
 	select REGMAP_I2C
 	help
 	  This driver supports the Invensense MPU6050/9150,
-	  MPU6500/6515/6880/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690
+	  MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20602/ICM20690
 	  and IAM20680 motion tracking devices over I2C.
 	  This driver can be built as a module. The module will be called
 	  inv-mpu6050-i2c.
@@ -28,7 +28,7 @@ config INV_MPU6050_SPI
 	select REGMAP_SPI
 	help
 	  This driver supports the Invensense MPU6000,
-	  MPU6500/6515/6880/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690
+	  MPU6500/6515/6880/9250/9255, ICM20608(D)/20609/20689, ICM20602/ICM20690
 	  and IAM20680 motion tracking devices over SPI.
 	  This driver can be built as a module. The module will be called
 	  inv-mpu6050-spi.
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 597768c29a72..86fbbe904050 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -217,6 +217,15 @@ static const struct inv_mpu6050_hw hw_info[] = {
 		.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
 		.startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
 	},
+	{
+		.whoami = INV_ICM20608D_WHOAMI_VALUE,
+		.name = "ICM20608D",
+		.reg = &reg_set_6500,
+		.config = &chip_config_6500,
+		.fifo_size = 512,
+		.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
+		.startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+	},
 	{
 		.whoami = INV_ICM20609_WHOAMI_VALUE,
 		.name = "ICM20609",
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index fe03707ec2d3..ed52b27409ac 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -29,6 +29,7 @@ static bool inv_mpu_i2c_aux_bus(struct device *dev)
 
 	switch (st->chip_type) {
 	case INV_ICM20608:
+	case INV_ICM20608D:
 	case INV_ICM20609:
 	case INV_ICM20689:
 	case INV_ICM20602:
@@ -182,6 +183,7 @@ static const struct i2c_device_id inv_mpu_id[] = {
 	{"mpu9250", INV_MPU9250},
 	{"mpu9255", INV_MPU9255},
 	{"icm20608", INV_ICM20608},
+	{"icm20608d", INV_ICM20608D},
 	{"icm20609", INV_ICM20609},
 	{"icm20689", INV_ICM20689},
 	{"icm20602", INV_ICM20602},
@@ -225,6 +227,10 @@ static const struct of_device_id inv_of_match[] = {
 		.compatible = "invensense,icm20608",
 		.data = (void *)INV_ICM20608
 	},
+	{
+		.compatible = "invensense,icm20608d",
+		.data = (void *)INV_ICM20608D
+	},
 	{
 		.compatible = "invensense,icm20609",
 		.data = (void *)INV_ICM20609
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
index c6aa36ee966a..8e14f20b1314 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
@@ -76,6 +76,7 @@ enum inv_devices {
 	INV_MPU9250,
 	INV_MPU9255,
 	INV_ICM20608,
+	INV_ICM20608D,
 	INV_ICM20609,
 	INV_ICM20689,
 	INV_ICM20602,
@@ -394,6 +395,7 @@ struct inv_mpu6050_state {
 #define INV_MPU9255_WHOAMI_VALUE		0x73
 #define INV_MPU6515_WHOAMI_VALUE		0x74
 #define INV_ICM20608_WHOAMI_VALUE		0xAF
+#define INV_ICM20608D_WHOAMI_VALUE		0xAE
 #define INV_ICM20609_WHOAMI_VALUE		0xA6
 #define INV_ICM20689_WHOAMI_VALUE		0x98
 #define INV_ICM20602_WHOAMI_VALUE		0x12
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
index 6800356b25fb..ce8ab6db2bf2 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
@@ -74,6 +74,7 @@ static const struct spi_device_id inv_mpu_id[] = {
 	{"mpu9250", INV_MPU9250},
 	{"mpu9255", INV_MPU9255},
 	{"icm20608", INV_ICM20608},
+	{"icm20608d", INV_ICM20608D},
 	{"icm20609", INV_ICM20609},
 	{"icm20689", INV_ICM20689},
 	{"icm20602", INV_ICM20602},
@@ -113,6 +114,10 @@ static const struct of_device_id inv_of_match[] = {
 		.compatible = "invensense,icm20608",
 		.data = (void *)INV_ICM20608
 	},
+	{
+		.compatible = "invensense,icm20608d",
+		.data = (void *)INV_ICM20608D
+	},
 	{
 		.compatible = "invensense,icm20609",
 		.data = (void *)INV_ICM20609
-- 
2.35.1


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

* Re: [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
  2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
@ 2022-03-23 14:26   ` Krzysztof Kozlowski
  2022-03-23 16:00   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-23 14:26 UTC (permalink / raw)
  To: michael.srba, Jonathan Cameron, Lars-Peter Clausen, Rob Herring
  Cc: Jean-Baptiste Maneyrol, linux-iio, devicetree

On 23/03/2022 13:15, michael.srba@seznam.cz wrote:
> From: Michael Srba <Michael.Srba@seznam.cz>
> 
> ICM-20608-D differs from the other ICM-20608 variants by having
> a DMP (Digital Motion Processor) core tacked on.
> Despite having a different WHOAMI register, this variant is
> completely interchangeable with the other ICM-20608 variants
> by simply pretending the DMP core doesn't exist.
> 
> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
> ---
> changelog:
>  - v2: require specifying "invensense,icm20608" as a fallback
>        compatible
>  - v3: fix indentation
> ---
>  .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
>  1 file changed, 19 insertions(+), 15 deletions(-)
> 


Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>


Best regards,
Krzysztof

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

* Re: [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
  2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
  2022-03-23 14:26   ` Krzysztof Kozlowski
@ 2022-03-23 16:00   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2022-03-23 16:00 UTC (permalink / raw)
  To: michael.srba
  Cc: devicetree, Jean-Baptiste Maneyrol, Michael Srba,
	Jonathan Cameron, Krzysztof Kozlowski, Rob Herring,
	Lars-Peter Clausen, linux-iio

On Wed, 23 Mar 2022 13:15:49 +0100, michael.srba@seznam.cz wrote:
> From: Michael Srba <Michael.Srba@seznam.cz>
> 
> ICM-20608-D differs from the other ICM-20608 variants by having
> a DMP (Digital Motion Processor) core tacked on.
> Despite having a different WHOAMI register, this variant is
> completely interchangeable with the other ICM-20608 variants
> by simply pretending the DMP core doesn't exist.
> 
> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
> ---
> changelog:
>  - v2: require specifying "invensense,icm20608" as a fallback
>        compatible
>  - v3: fix indentation
> ---
>  .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
>  1 file changed, 19 insertions(+), 15 deletions(-)
> 

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

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

* Re: [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D
  2022-03-23 12:15 [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
  2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
  2022-03-23 12:15 ` [PATCH v3 2/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
@ 2022-03-27 15:05 ` Jonathan Cameron
  2 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2022-03-27 15:05 UTC (permalink / raw)
  To: michael.srba
  Cc: Lars-Peter Clausen, Rob Herring, Jean-Baptiste Maneyrol,
	Krzysztof Kozlowski, linux-iio, devicetree

On Wed, 23 Mar 2022 13:15:48 +0100
michael.srba@seznam.cz wrote:

> From: Michael Srba <Michael.Srba@seznam.cz>
> 
> This series copies the invensense icm20608 support in the inv_mpu6050
> driver for icm20608d, which is for all intents and purposes identical,
> except for the inclusion of a DMP (Digital Motion Processor), which
> is deemed significant enough to change the WHOAMI value, thereby making
> the driver fail if the invensense,icm20608 compatible is specified.
> 
> Since the driver doesn't currently acknowledge that there is such thing
> as a DMP core, all that is needed is to copy the icm20608 support and
> change the WHOAMI value.

Series applied to my local togreg branch, but I'll be rebasing that after
rc1 so for now only pushed out as testing to let 0-day see if it can
find anything we missed.

Thanks,

Jonathan

> 
> changelog:
>  -v2: require specifying "invensense,icm20608" as a fallback compatible
>       in the binding, as suggested
>  -v3: fix indentation issue with the binding
> 
> Michael Srba (2):
>   dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
>   iio: imu: inv_mpu6050: Add support for ICM-20608-D
> 
>  .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
>  drivers/iio/imu/inv_mpu6050/Kconfig           |  4 +--
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  9 +++++
>  drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c     |  6 ++++
>  drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  2 ++
>  drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c     |  5 +++
>  6 files changed, 43 insertions(+), 17 deletions(-)
> 


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

* [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D
@ 2022-03-11 16:15 michael.srba
  0 siblings, 0 replies; 7+ messages in thread
From: michael.srba @ 2022-03-11 16:15 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Rob Herring
  Cc: Jean-Baptiste Maneyrol, Krzysztof Kozlowski, linux-iio,
	devicetree, Michael Srba

From: Michael Srba <Michael.Srba@seznam.cz>

This series copies the invensense icm20608 support in the inv_mpu6050
driver for icm20608d, which is for all intents and purposes identical,
except for the inclusion of a DMP (Digital Motion Processor), which
is deemed significant enough to change the WHOAMI value, thereby making
the driver fail if the invensense,icm20608 compatible is specified.

Since the driver doesn't currently acknowledge that there is such thing
as a DMP core, all that is needed is to copy the icm20608 support and
change the WHOAMI value.

changelog:
 -v2: require specifying "invensense,icm20608" as a fallback compatible
      in the binding, as suggested

Michael Srba (2):
  dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d
  iio: imu: inv_mpu6050: Add support for ICM-20608-D

 .../bindings/iio/imu/invensense,mpu6050.yaml  | 34 +++++++++++--------
 drivers/iio/imu/inv_mpu6050/Kconfig           |  4 +--
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  9 +++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c     |  6 ++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  2 ++
 drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c     |  5 +++
 6 files changed, 43 insertions(+), 17 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-03-27 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 12:15 [PATCH v2 0/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
2022-03-23 12:15 ` [PATCH v3 1/2] dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d michael.srba
2022-03-23 14:26   ` Krzysztof Kozlowski
2022-03-23 16:00   ` Rob Herring
2022-03-23 12:15 ` [PATCH v3 2/2] iio: imu: inv_mpu6050: Add support for ICM-20608-D michael.srba
2022-03-27 15:05 ` [PATCH v2 0/2] " Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2022-03-11 16:15 michael.srba

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.