Skip to contentSkip to conversation

iio/inv_icm42600: add inv_icm42600 id_table

PATCH In review Jason Liu 3 participants 13 messages Aug 25, 2024 – Sep 9, 2024 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Jason Liu

author
#0 lore raw

PATCH 1/1 iio/inv_icm42600: add inv_icm42600 id_table

Add the id_table of inv_icm42600, so the device can probe correctly.

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +15 -0
index ebb31b385881..8cc550b8cfc3 100644
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
index eae5ff7a3cc1..5fe078ddc8a1 100644
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
Signature · 1 line
2.25.1
#1 lore raw

Hello,

I was believing that id tables weren't required anymore when using of tables.

Jonathan,
can you help on this subject?

If we have to add id tables, then we need to add all supported chips (missing here icm42686 and icm42688).

Thanks,
JB

________________________________________
From: Jason Liu <[email protected]>
Sent: Sunday, August 25, 2024 08:39
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jason Liu <[email protected]> Subject: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Add the id_table of inv_icm42600, so the device can probe correctly.

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +15 -0
index ebb31b385881..8cc550b8cfc3 100644
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
index eae5ff7a3cc1..5fe078ddc8a1 100644
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
Signature · 1 line
2.25.1
maintainer
#2 lore raw
Quoted 8 lines · On Mon, 26 Aug 2024 08:22:11 +0000 Jean-Baptiste Maneyrol…

Hello,

I was believing that id tables weren't required anymore when using of tables.

Jonathan,
can you help on this subject?

If we have to add id tables, then we need to add all supported chips (missing here icm42686 and icm42688).

There were some oddities around autoloading for some busses a while back but I can't find the reference.

+CC Mark + Wolfram for input.
Do we currently need i2c_device_id and spi_device_id tables for autoprobing on DT only platforms?

A few minor comments inline.

Quoted 27 lines

Thanks,
JB

________________________________________
From: Jason Liu <[email protected]>
Sent: Sunday, August 25, 2024 08:39
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jason Liu <[email protected]> Subject: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Add the id_table of inv_icm42600, so the device can probe correctly.

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +0 -0
index ebb31b385881..8cc550b8cfc3 100644

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c static int inv_icm42600_probe(struct i2c_client *client) · line 79

Quoted 9 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +6 -0
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},

Spaces after { and before }

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c static int inv_icm42600_probe(struct i2c_client *client) · line 84

Quoted 5 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +5 -0
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}

{ }

I'm trying to standardize this in IIO.

Quoted 47 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +4 -0
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
index eae5ff7a3cc1..5fe078ddc8a1 100644
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{"icm42600", INV_CHIP_ICM42600},
+	{"icm42602", INV_CHIP_ICM42602},
+	{"icm42605", INV_CHIP_ICM42605},
+	{"icm42622", INV_CHIP_ICM42622},
+	{"icm42631", INV_CHIP_ICM42631},
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);

A message that is not in the archive (sent off-list or not yet received): CAJci1vCztZAnmHrVn=4b9hnRmMCQE=6R7uQnznPQ0FSpFHQK5w@mail.gmail.com

maintainer
#4 lore raw
Quoted 11 lines · On Sun, 1 Sep 2024 13:04:59 +0800 jason liu <[email protected]> wrote:

Hi, I would like to know your current opinion on this patch.

Let me explain the reason for proposing this patch.

First, through __spi_register_driver, we know that when registering an SPI driver, if an id_table is present, it matches the id_table; otherwise, it matches the SPI device's driver_name.
Then, in inv_icm_42600spi.c, driver name is "inv-icm42600-spi", but the compatible is compatible = "invensense,icm42600".

so I think, it's necessary to add an id_table in the inv_icm42600 driver.

The quest Jean-Baptiste was raising was whether it would match on the of_match_id table instead if it was present. __spi_register_driver does that so I think perhaps what you are actually referring to is the comment in there.

/*
* For Really Good Reasons we use spi: modaliases not of:
* modaliases for DT so module autoloading won't work if we
* don't have a spi_device_id as well as a compatible string. */

The actually matching is done in spi_match_device.

Anyhow, the comment suggests strongly that we do still need the spi_device_id table. I'm not 100% sure on the i2c equivalent, but I'm fine with adding both. Please fix up the formatting as requested below and send a v2.

Quoted 131 lines
Quoted 127 lines · Jonathan Cameron <[email protected]> 于2024年8月26日周一 18:27写道:
Quoted 3 lines · On Mon, 26 Aug 2024 08:22:11 +0000 Jean-Baptiste Maneyrol…

Hello,

I was believing that id tables weren't required anymore when using of

tables.

Quoted 5 lines

Jonathan,
can you help on this subject?

If we have to add id tables, then we need to add all supported chips

(missing here icm42686 and icm42688).

There were some oddities around autoloading for some busses a while back but I can't find the reference.

+CC Mark + Wolfram for input.
Do we currently need i2c_device_id and spi_device_id tables for autoprobing on DT only platforms?

A few minor comments inline.

Quoted 9 lines

Thanks,
JB

________________________________________
From: Jason Liu <[email protected]>
Sent: Sunday, August 25, 2024 08:39
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <

[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jason Liu < [email protected]>

Quoted 7 lines

Subject: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Add the id_table of inv_icm42600, so the device can probe correctly.

Review

Quoted 7 lines
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
(quoted diff) +0 -0

b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c static int inv_icm42600_probe(struct i2c_client

Quoted 4 lines

index ebb31b385881..8cc550b8cfc3 100644

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +0 -0
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client  

*client)

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c static int inv_icm42600_probe(struct i2c_client *client) · line 79

Quoted 9 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +6 -0
                                     inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+     {"icm42600", INV_CHIP_ICM42600},  

Spaces after { and before }

drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c static int inv_icm42600_probe(struct i2c_client *client) · line 84

Quoted 5 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +5 -0
+     {"icm42602", INV_CHIP_ICM42602},
+     {"icm42605", INV_CHIP_ICM42605},
+     {"icm42622", INV_CHIP_ICM42622},
+     {"icm42631", INV_CHIP_ICM42631},
+     {}  

{ }

I'm trying to standardize this in IIO.

Review

Quoted 15 lines
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +4 -0
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
      {
              .compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
              .of_match_table = inv_icm42600_of_matches,
              .pm = pm_ptr(&inv_icm42600_pm_ops),
      },
+     .id_table = inv_icm42600_id,
      .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
(quoted diff) +0 -0

b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c

Quoted 32 lines

index eae5ff7a3cc1..5fe078ddc8a1 100644

drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                     inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+     {"icm42600", INV_CHIP_ICM42600},
+     {"icm42602", INV_CHIP_ICM42602},
+     {"icm42605", INV_CHIP_ICM42605},
+     {"icm42622", INV_CHIP_ICM42622},
+     {"icm42631", INV_CHIP_ICM42631},
+     {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
      {
              .compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
              .of_match_table = inv_icm42600_of_matches,
              .pm = pm_ptr(&inv_icm42600_pm_ops),
      },
+     .id_table = inv_icm42600_id,
      .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);  
author
#5 lore raw

PATCH 1/1 iio/inv_icm42600: add inv_icm42600 id_table

Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +15 -0
index ebb31b385881..4e00eb130e9f 100644
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
index eae5ff7a3cc1..9efbe9b7674d 100644
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
Signature · 1 line
2.25.1
#6 lore raw

Hello,

this patch is missing chips supported by this driver: icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688).

Please add them and in the same order than of_device_id:

        {
                .compatible = "invensense,icm42600",
                .data = (void *)INV_CHIP_ICM42600,
        }, {
                .compatible = "invensense,icm42602",
                .data = (void *)INV_CHIP_ICM42602,
        }, {
                .compatible = "invensense,icm42605",
                .data = (void *)INV_CHIP_ICM42605,
        }, {
                .compatible = "invensense,icm42686",
                .data = (void *)INV_CHIP_ICM42686,
        }, {
                .compatible = "invensense,icm42622",
                .data = (void *)INV_CHIP_ICM42622,
        }, {
                .compatible = "invensense,icm42688",
                .data = (void *)INV_CHIP_ICM42688,
        }, {
                .compatible = "invensense,icm42631",
                .data = (void *)INV_CHIP_ICM42631,
        },

Thanks.

Best regards,
JB

________________________________________
From: Jason Liu <[email protected]>
Sent: Monday, September 2, 2024 05:11
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Jason Liu <[email protected]> Subject: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +15 -0
index ebb31b385881..4e00eb130e9f 100644
@@ -71,6 +71,20 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +118,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +15 -0
index eae5ff7a3cc1..9efbe9b7674d 100644
@@ -67,6 +67,20 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +114,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
Signature · 1 line
2.25.1
author
#7 lore raw

PATCH 1/1 iio/inv_icm42600: add inv_icm42600 id_table

Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
 				       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42686", INV_CHIP_ICM42686 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42688", INV_CHIP_ICM42688 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -0
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
 				       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+	{ "icm42600", INV_CHIP_ICM42600 },
+	{ "icm42602", INV_CHIP_ICM42602 },
+	{ "icm42605", INV_CHIP_ICM42605 },
+	{ "icm42686", INV_CHIP_ICM42686 },
+	{ "icm42622", INV_CHIP_ICM42622 },
+	{ "icm42688", INV_CHIP_ICM42688 },
+	{ "icm42631", INV_CHIP_ICM42631 },
+	{}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
 	{
 		.compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
 	},
+	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
Signature · 1 line
2.25.1

A message that is not in the archive (sent off-list or not yet received): CAJci1vC9pvdqEpA8sk+uB5jJGn_DKUruXFfY6tbG9mO07YxgHQ@mail.gmail.com

maintainer Acked-by
#9 lore raw

Hello,

looks good for me now, thanks for the patch.

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]> Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++ drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++

 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +0 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)

                                       inv_icm42600_i2c_bus_setup); }

+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = { +       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = { {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = { .of_match_table = inv_icm42600_of_matches, .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);

drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +0 -0
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)

                                       inv_icm42600_spi_bus_setup); }

+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = { +       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = { {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = { .of_match_table = inv_icm42600_of_matches, .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
--
2.25.1

maintainer Applied
#10 lore raw
Quoted 6 lines · On Thu, 5 Sep 2024 09:25:33 +0000 Jean-Baptiste Maneyrol…

Hello,

looks good for me now, thanks for the patch.

Hi Jason,

I've picked this up, but the patch submission has a number of issues you should be sure to fix in future patches.

1) Patch version is not in the patch title. I initially picked up a different version that was in a later thread in my email.
2) Patch title has wrong style - look at other patches for this driver and similar. Should start with iio: imu: inv...
3) Never send a new patch in reply to a previous one. Whilst that is accepted practice in some opensource communities it scales very badly and mostly reduces the chance anyone will read your patches as they will be off the top of the screen of their most recent emails.
I have never come across a kernel maintainer asking for this style and many including myself actively ask people to not do this.
Each version should be a new email thread.

Anyhow, stuff to watch out for next time.

Applied, but given timing I'm not sure if this will be in my final pull request for this kernel cycle or not.

Jonathan

Quoted 102 lines

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]> Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++ drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++

 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                        inv_icm42600_i2c_bus_setup);
  }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
  static const struct of_device_id inv_icm42600_of_matches[] = {
         {
                 .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                 .of_match_table = inv_icm42600_of_matches,
                 .pm = pm_ptr(&inv_icm42600_pm_ops),
         },
+       .id_table = inv_icm42600_id,
         .probe = inv_icm42600_probe,
  };
  module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -1
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                        inv_icm42600_spi_bus_setup);
  }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
  static const struct of_device_id inv_icm42600_of_matches[] = {
         {
                 .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                 .of_match_table = inv_icm42600_of_matches,
                 .pm = pm_ptr(&inv_icm42600_pm_ops),
         },
+       .id_table = inv_icm42600_id,
         .probe = inv_icm42600_probe,
  };
  module_spi_driver(inv_icm42600_driver);
--

2.25.1

A message that is not in the archive (sent off-list or not yet received): SI6PR01MB63197238674C8895885420D8F59E2@SI6PR01MB6319.apcprd01.prod.exchangelabs.com

maintainer
#12 lore raw
Quoted 4 lines · On Fri, 6 Sep 2024 05:02:59 +0000 jason liu <[email protected]> wrote:

Hello,

I'm glad this patch could help. And I would like to know, how will the patch to be handled moving forward?

It is queued up on the IIO tree. Given timing it's queued for 6.13. Note that for now that is only pushed out as testing because I will be rebasing the IIO togreg branch on 6.12-rc1.
One that is done it will appear in linux-next.

It should go upstream and appear in char-misc/char-misc-next in about 6 weeks. After that Greg KH will send a pull request during the 6.13 merge window in about 12 weeks time and it will then hopefully get merged into Linus' tree before 6.13-rc1

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Thanks,

Jonathan

Quoted 117 lines

Thanks.

________________________________
From: Jean-Baptiste Maneyrol <[email protected]>
Sent: Thursday, September 5, 2024 5:25 PM
To: jason liu <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Hello,

looks good for me now, thanks for the patch.

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -1
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
--

2.25.1

author
#13 lore raw

Hi Jonathan,

Quoted 5 lines

Hi Jason,

I've picked this up, but the patch submission has a number of issues you should be sure to fix in future patches.

I am sorry for the issues, and I will keep your suggestions in mind.
So, do I still need to submit a new patch to fix these issues?
My understanding is that since you've picked it up, there's no need for me to resubmit. Is it right?

Quoted 3 lines

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Sorry, I didn’t quite understand what you meant.
Why did you say 'it was never there'? Do you mean that this issue doesn't exist?

Thanks,

Jason

________________________________________
From: Jonathan Cameron <[email protected]>
Sent: Sunday, September 8, 2024 6:51 PM
To: jason liu
Cc: Jean-Baptiste Maneyrol; [email protected]; [email protected]; [email protected]
Subject: Re: 回复: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Quoted 4 lines · On Fri, 6 Sep 2024 05:02:59 +0000 jason liu <[email protected]> wrote:

Hello,

I'm glad this patch could help. And I would like to know, how will the patch to be handled moving forward?

It is queued up on the IIO tree. Given timing it's queued for 6.13. Note that for now that is only pushed out as testing because I will be rebasing the IIO togreg branch on 6.12-rc1.
One that is done it will appear in linux-next.

It should go upstream and appear in char-misc/char-misc-next in about 6 weeks. After that Greg KH will send a pull request during the 6.13 merge window in about 12 weeks time and it will then hopefully get merged into Linus' tree before 6.13-rc1

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Thanks,

Jonathan

Quoted 117 lines

Thanks.

________________________________
From: Jean-Baptiste Maneyrol <[email protected]>
Sent: Thursday, September 5, 2024 5:25 PM
To: jason liu <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Hello,

looks good for me now, thanks for the patch.

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -1
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
--

2.25.1

maintainer
#14 lore raw
Quoted 9 lines · On Mon, 9 Sep 2024 06:43:47 +0000 jason liu <[email protected]> wrote:

Hi Jonathan,

Quoted 5 lines

Hi Jason,

I've picked this up, but the patch submission has a number of issues you should be sure to fix in future patches.

I am sorry for the issues, and I will keep your suggestions in mind. So, do I still need to submit a new patch to fix these issues?

No need,.

Quoted 2 lines

My understanding is that since you've picked it up, there's no need for me to resubmit. Is it right?

Yes that's right.

Quoted 6 lines
Quoted 4 lines

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Sorry, I didn’t quite understand what you meant.
Why did you say 'it was never there'? Do you mean that this issue doesn't exist?

The autoprobing never worked, hence this is an improvement not a regression. As such I've not rushed it in as a fix, but instead it can take a slower path upstream.

Jonathan

Quoted 154 lines

Thanks,

Jason

________________________________________
From: Jonathan Cameron <[email protected]>
Sent: Sunday, September 8, 2024 6:51 PM
To: jason liu
Cc: Jean-Baptiste Maneyrol; [email protected]; [email protected]; [email protected]
Subject: Re: 回复: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Quoted 4 lines · On Fri, 6 Sep 2024 05:02:59 +0000 jason liu <[email protected]> wrote:

Hello,

I'm glad this patch could help. And I would like to know, how will the patch to be handled moving forward?

It is queued up on the IIO tree. Given timing it's queued for 6.13. Note that for now that is only pushed out as testing because I will be rebasing the IIO togreg branch on 6.12-rc1.
One that is done it will appear in linux-next.

It should go upstream and appear in char-misc/char-misc-next in about 6 weeks. After that Greg KH will send a pull request during the 6.13 merge window in about 12 weeks time and it will then hopefully get merged into Linus' tree before 6.13-rc1

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Thanks,

Jonathan

Quoted 117 lines

Thanks.

________________________________
From: Jean-Baptiste Maneyrol <[email protected]>
Sent: Thursday, September 5, 2024 5:25 PM
To: jason liu <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Hello,

looks good for me now, thanks for the patch.

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -1
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
--

2.25.1

author
#15 lore raw
Quoted 3 lines

The autoprobing never worked, hence this is an improvement not a regression. As such I've not rushed it in as a fix, but instead it can take a slower path upstream.

Alright, I understand. Thank you for your explanation.

I will definitely do better the next time I submit a patch. Thank you for your correction.

Thanks,
Jason

________________________________________
From: Jonathan Cameron <[email protected]>
Sent: Monday, September 9, 2024 3:35 PM
To: jason liu
Cc: Jean-Baptiste Maneyrol; [email protected]; [email protected]; [email protected]
Subject: Re: 回复: 回复: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Quoted 9 lines · On Mon, 9 Sep 2024 06:43:47 +0000 jason liu <[email protected]> wrote:

Hi Jonathan,

Quoted 5 lines

Hi Jason,

I've picked this up, but the patch submission has a number of issues you should be sure to fix in future patches.

I am sorry for the issues, and I will keep your suggestions in mind. So, do I still need to submit a new patch to fix these issues?

No need,.

Quoted 2 lines

My understanding is that since you've picked it up, there's no need for me to resubmit. Is it right?

Yes that's right.

Quoted 6 lines
Quoted 4 lines

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Sorry, I didn’t quite understand what you meant.
Why did you say 'it was never there'? Do you mean that this issue doesn't exist?

The autoprobing never worked, hence this is an improvement not a regression. As such I've not rushed it in as a fix, but instead it can take a slower path upstream.

Jonathan

Quoted 154 lines

Thanks,

Jason

________________________________________
From: Jonathan Cameron <[email protected]>
Sent: Sunday, September 8, 2024 6:51 PM
To: jason liu
Cc: Jean-Baptiste Maneyrol; [email protected]; [email protected]; [email protected]
Subject: Re: 回复: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Quoted 4 lines · On Fri, 6 Sep 2024 05:02:59 +0000 jason liu <[email protected]> wrote:

Hello,

I'm glad this patch could help. And I would like to know, how will the patch to be handled moving forward?

It is queued up on the IIO tree. Given timing it's queued for 6.13. Note that for now that is only pushed out as testing because I will be rebasing the IIO togreg branch on 6.12-rc1.
One that is done it will appear in linux-next.

It should go upstream and appear in char-misc/char-misc-next in about 6 weeks. After that Greg KH will send a pull request during the 6.13 merge window in about 12 weeks time and it will then hopefully get merged into Linus' tree before 6.13-rc1

I haven't treated this as a fix because it was never there, but it may make sense to request a backport to stable after it is upstream.

Thanks,

Jonathan

Quoted 117 lines

Thanks.

________________________________
From: Jean-Baptiste Maneyrol <[email protected]>
Sent: Thursday, September 5, 2024 5:25 PM
To: jason liu <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

Hello,

looks good for me now, thanks for the patch.

Thanks,
JB

________________________________________
From: jason liu <[email protected]>
Sent: Wednesday, September 4, 2024 11:00
To: Jean-Baptiste Maneyrol <[email protected]>
Cc: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] iio/inv_icm42600: add inv_icm42600 id_table

This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.

Hello, does patch v3 meet the requirements?

BR.

Jason Liu <[email protected]> 于2024年9月2日周一 19:31写道: Add the id_table of inv_icm42600, so the device can probe correctly.

---
V1->V2: fix up the formatting as requested
---
V2->V3: add icm42686 (INV_ICM_42686) and icm42688 (INV_ICM_42688)

---
 drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 17 +++++++++++++++++
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +17 -0
index ebb31b385881..9e65fef04c39 100644
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +17 -1
index eae5ff7a3cc1..75441b2be174 100644
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       {}
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);
--

2.25.1