Skip to contentSkip to conversation

Add support of IAM-20680 HP & HT

PATCH In review [email protected] 3 participants 5 messages Sep 19, 2024 – Sep 20, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add support of IAM-20680 HP & HT

From: Jean-Baptiste Maneyrol <[email protected]>

Add support of IAM-20680 HP & HT variants. These chips have better hardware specs and a bigger FIFO while retaining full compatibility with IAM-20680.

Jean-Baptiste Maneyrol (2):
dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050
iio: imu: inv_mpu6050: add support for IAM-20680HT/HP

 .../bindings/iio/imu/invensense,mpu6050.yaml  |  5 +++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    | 20 +++++++++++++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c     | 10 ++++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h     |  4 ++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c     | 10 ++++++++++
 5 files changed, 49 insertions(+)

--
2.34.1

#1 lore raw

PATCH 1/2 dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050

From: Jean-Baptiste Maneyrol <[email protected]>

IAM-20680HT & HP are 2 variants of IAM-20680 fully compatible. They just have better specs, temperature range and a bigger FIFO.

---
 .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml      | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml +5 -0
index 587ff2bced2d..a8d30ef015fa 100644
@@ -36,6 +36,11 @@ properties:
       - items:
           - const: invensense,icm20608d
           - const: invensense,icm20608
+      - items:
+          - enum:
+              - invensense,iam20680hp
+              - invensense,iam20680ht
+          - const: invensense,iam20680
 
   reg:
     maxItems: 1

--
2.34.1

#2 lore raw

Re: [PATCH 1/2] dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050

Quoted 1 line · On 19/09/2024 16:27, [email protected] wrote:

From: Jean-Baptiste Maneyrol <[email protected]>

Sender does not match SoB... Maybe you need to use use b4 relay.

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.

Please kindly resend and include all necessary To/Cc entries. </form letter>

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050

Hello,

sorry, my mistake.

I'm resending it to the right lists and persons.

Sorry for the inconvenient.

Thanks,
JB

________________________________________
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, September 20, 2024 13:19
To: INV Git Commit <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; Jean-Baptiste Maneyrol <[email protected]> Subject: Re: [PATCH 1/2] dt-bindings: iio: imu: mpu6050: Add iam20680ht/hp bindings to mpu6050

This Message Is From an External Sender
This message came from outside your organization.

Quoted 1 line · On 19/09/2024 16:27, [email protected] wrote:

From: Jean-Baptiste Maneyrol <[email protected]>

Sender does not match SoB... Maybe you need to use use b4 relay.

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.

Please kindly resend and include all necessary To/Cc entries. </form letter>

Best regards,
Krzysztof

#4 lore raw

PATCH 2/2 iio: imu: inv_mpu6050: add support for IAM-20680HT/HP

In reply to [email protected]

From: Jean-Baptiste Maneyrol <[email protected]>

IAM-20680HT & HP are 2 variants of IAM-20680 with better specs, wider temperature range, and a bigger FIFO (4k).

Fully compatible with IAM-20680, FIFO is 512 bytes by default and with correct register setting we expand it to full 4k.

---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 20 ++++++++++++++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c  | 10 ++++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h  |  4 ++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c  | 10 ++++++++++
 4 files changed, 44 insertions(+)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +20 -0
index 14d95f34e981..6b0adb7f9ae3 100644
@@ -286,6 +286,24 @@ 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_IAM20680HP_WHOAMI_VALUE,
+		.name = "IAM20680HP",
+		.reg = &reg_set_6500,
+		.config = &chip_config_6500,
+		.fifo_size = 4 * 1024,
+		.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
+		.startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+	},
+	{
+		.whoami = INV_IAM20680HT_WHOAMI_VALUE,
+		.name = "IAM20680HT",
+		.reg = &reg_set_6500,
+		.config = &chip_config_6500,
+		.fifo_size = 4 * 1024,
+		.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
+		.startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+	},
 };
 
 static int inv_mpu6050_pwr_mgmt_1_write(struct inv_mpu6050_state *st, bool sleep,
@@ -510,6 +528,8 @@ static int inv_mpu6050_set_accel_lpf_regs(struct inv_mpu6050_state *st,
 		return 0;
 	case INV_ICM20689:
 	case INV_ICM20690:
+	case INV_IAM20680HT:
+	case INV_IAM20680HP:
 		/* set FIFO size to maximum value */
 		val |= INV_ICM20689_BITS_FIFO_SIZE_MAX;
 		break;
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +10 -0
index 0e03137fb3d4..7a5926ba6b97 100644
@@ -188,6 +188,8 @@ static const struct i2c_device_id inv_mpu_id[] = {
 	{"icm20602", INV_ICM20602},
 	{"icm20690", INV_ICM20690},
 	{"iam20680", INV_IAM20680},
+	{"iam20680hp", INV_IAM20680HP},
+	{"iam20680ht", INV_IAM20680HT},
 	{}
 };
 
@@ -254,6 +256,14 @@ static const struct of_device_id inv_of_match[] = {
 		.compatible = "invensense,iam20680",
 		.data = (void *)INV_IAM20680
 	},
+	{
+		.compatible = "invensense,iam20680hp",
+		.data = (void *)INV_IAM20680HP
+	},
+	{
+		.compatible = "invensense,iam20680ht",
+		.data = (void *)INV_IAM20680HT
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, inv_of_match);
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +4 -0
index e1c0c5146876..a6862cf42639 100644
@@ -85,6 +85,8 @@ enum inv_devices {
 	INV_ICM20602,
 	INV_ICM20690,
 	INV_IAM20680,
+	INV_IAM20680HP,
+	INV_IAM20680HT,
 	INV_NUM_PARTS
 };
 
@@ -424,6 +426,8 @@ struct inv_mpu6050_state {
 #define INV_ICM20602_WHOAMI_VALUE		0x12
 #define INV_ICM20690_WHOAMI_VALUE		0x20
 #define INV_IAM20680_WHOAMI_VALUE		0xA9
+#define INV_IAM20680HP_WHOAMI_VALUE		0xF8
+#define INV_IAM20680HT_WHOAMI_VALUE		0xFA
 
 /* scan element definition for generic MPU6xxx devices */
 enum inv_mpu6050_scan {
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +10 -0
index 05451ca1580b..e6a291fcda95 100644
@@ -80,6 +80,8 @@ static const struct spi_device_id inv_mpu_id[] = {
 	{"icm20602", INV_ICM20602},
 	{"icm20690", INV_ICM20690},
 	{"iam20680", INV_IAM20680},
+	{"iam20680hp", INV_IAM20680HP},
+	{"iam20680ht", INV_IAM20680HT},
 	{}
 };
 
@@ -142,6 +144,14 @@ static const struct of_device_id inv_of_match[] = {
 		.compatible = "invensense,iam20680",
 		.data = (void *)INV_IAM20680
 	},
+	{
+		.compatible = "invensense,iam20680hp",
+		.data = (void *)INV_IAM20680HP
+	},
+	{
+		.compatible = "invensense,iam20680ht",
+		.data = (void *)INV_IAM20680HT
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, inv_of_match);

--
2.34.1