* [PATCH v2 1/4] iio: imu: inv_icm42600: sort device id tables numerically
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
@ 2026-07-24 20:27 ` Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe Jorijn van der Graaf
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jorijn van der Graaf @ 2026-07-24 20:27 UTC (permalink / raw)
To: Jonathan Cameron, Jean-Baptiste Maneyrol
Cc: Jorijn van der Graaf, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chris Morgan, Luca Weiss, linux-iio, devicetree, linux-kernel
The I2C, SPI and OF device id tables list the parts in the chip enum's
declaration order, which is neither numeric nor alphabetical. Sort the
entries numerically by part number so new entries have an unambiguous
position.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Link: https://lore.kernel.org/all/20260724012505.02029e51@jic23-huawei/
Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
---
New in v2.
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 16 ++++++++--------
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
index 28552d2db91d..e44ed6dcde02 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
@@ -77,10 +77,10 @@ static const struct i2c_device_id inv_icm42600_id[] = {
{ .name = "icm42600", .driver_data = INV_CHIP_ICM42600 },
{ .name = "icm42602", .driver_data = INV_CHIP_ICM42602 },
{ .name = "icm42605", .driver_data = INV_CHIP_ICM42605 },
- { .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
{ .name = "icm42622", .driver_data = INV_CHIP_ICM42622 },
- { .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
{ .name = "icm42631", .driver_data = INV_CHIP_ICM42631 },
+ { .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
+ { .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
{ }
};
MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
@@ -95,18 +95,18 @@ static const struct of_device_id inv_icm42600_of_matches[] = {
}, {
.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,
+ }, {
+ .compatible = "invensense,icm42686",
+ .data = (void *)INV_CHIP_ICM42686,
+ }, {
+ .compatible = "invensense,icm42688",
+ .data = (void *)INV_CHIP_ICM42688,
},
{ }
};
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
index faf743bc6444..3e2f4eb42e97 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
@@ -74,10 +74,10 @@ static const struct spi_device_id inv_icm42600_id[] = {
{ .name = "icm42600", .driver_data = INV_CHIP_ICM42600 },
{ .name = "icm42602", .driver_data = INV_CHIP_ICM42602 },
{ .name = "icm42605", .driver_data = INV_CHIP_ICM42605 },
- { .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
{ .name = "icm42622", .driver_data = INV_CHIP_ICM42622 },
- { .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
{ .name = "icm42631", .driver_data = INV_CHIP_ICM42631 },
+ { .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
+ { .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
{ }
};
MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
@@ -92,18 +92,18 @@ static const struct of_device_id inv_icm42600_of_matches[] = {
}, {
.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,
+ }, {
+ .compatible = "invensense,icm42686",
+ .data = (void *)INV_CHIP_ICM42686,
+ }, {
+ .compatible = "invensense,icm42688",
+ .data = (void *)INV_CHIP_ICM42688,
},
{ }
};
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 1/4] iio: imu: inv_icm42600: sort device id tables numerically Jorijn van der Graaf
@ 2026-07-24 20:27 ` Jorijn van der Graaf
2026-07-24 20:44 ` sashiko-bot
2026-07-24 20:27 ` [PATCH v2 3/4] dt-bindings: iio: imu: icm42600: add icm42630 Jorijn van der Graaf
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Jorijn van der Graaf @ 2026-07-24 20:27 UTC (permalink / raw)
To: Jonathan Cameron, Jean-Baptiste Maneyrol
Cc: Jorijn van der Graaf, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chris Morgan, Luca Weiss, linux-iio, devicetree, linux-kernel,
Conor Dooley
A WHOAMI value differing from the one the compatible implies aborts
probe with -ENODEV, which prevents a register-compatible part described
with a fallback compatible from probing at all.
The devicetree compatible is authoritative for which part is fitted:
demote the mismatch to a warning and continue, as st_sensors does since
commit a3c2c5c937ed ("iio: st_sensors: relax WhoAmI check in
st_sensors_verify_id()"). This changes the probe outcome on mismatch
for all parts the driver supports.
Tested via a backport to a Fairphone 6 running a 7.1-based kernel: its
ICM-42630 (WHOAMI 0x0C), described with an icm42631 fallback compatible
and matched as icm42631, warns once and probes, and accelerometer,
gyroscope and temperature reads work.
Suggested-by: Conor Dooley <conor@kernel.org>
Link: https://lore.kernel.org/all/20260722-creature-volley-0f083b904c1d@spud/
Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
---
New in v2.
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
index dc97d8a274e3..f306e3ffca48 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
@@ -509,11 +509,9 @@ static int inv_icm42600_setup(struct inv_icm42600_state *st,
ret = regmap_read(st->map, INV_ICM42600_REG_WHOAMI, &val);
if (ret)
return ret;
- if (val != hw->whoami) {
- dev_err(dev, "invalid whoami %#02x expected %#02x (%s)\n",
- val, hw->whoami, hw->name);
- return -ENODEV;
- }
+ if (val != hw->whoami)
+ dev_warn(dev, "unexpected whoami %#02x, expected %#02x (%s)\n",
+ val, hw->whoami, hw->name);
st->name = hw->name;
/* reset to make sure previous state are not there */
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe
2026-07-24 20:27 ` [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe Jorijn van der Graaf
@ 2026-07-24 20:44 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-07-24 20:44 UTC (permalink / raw)
To: Jorijn van der Graaf; +Cc: devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [Medium] Demoting the WHOAMI check to a warning allows the driver to successfully probe on a disconnected or floating SPI bus, allocating resources for a phantom device.
Pre-existing issues:
- [High] The VDDIO regulator enable count is leaked on probe error paths because the devres cleanup function checks the wrong runtime PM state.
- [High] Devres teardown ordering is incorrect because IIO devices are registered before Runtime PM is initialized, creating a race condition on driver unbind.
--
--- Patch [2]: [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe ---
commit 8842cf41876131adceea9740e2e506d7567dcc89
Author: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe
This changes the inv_icm42600 driver to warn instead of failing the probe
when a WHOAMI mismatch occurs. This allows register-compatible parts
described with fallback compatibles to probe successfully. The driver now
relies on the devicetree compatible as the authoritative source for the
fitted part.
Link: https://lore.kernel.org/all/20260722-creature-volley-0f083b904c1d@spud/
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> index dc97d8a274e36..f306e3ffca486 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> @@ -509,11 +509,9 @@ static int inv_icm42600_setup(struct inv_icm42600_state *st,
> ret = regmap_read(st->map, INV_ICM42600_REG_WHOAMI, &val);
> if (ret)
> return ret;
> - if (val != hw->whoami) {
> - dev_err(dev, "invalid whoami %#02x expected %#02x (%s)\n",
> - val, hw->whoami, hw->name);
> - return -ENODEV;
> - }
> + if (val != hw->whoami)
> + dev_warn(dev, "unexpected whoami %#02x, expected %#02x (%s)\n",
> + val, hw->whoami, hw->name);
[Severity: Medium]
Will this allow a disconnected SPI bus to successfully probe a phantom device?
If the SPI bus is disconnected, a floating MISO often returns 0xFF for all
reads. With this check demoted to a warning, the driver proceeds to read
the reset status:
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:inv_icm42600_setup() {
...
ret = regmap_read(st->map, INV_ICM42600_REG_INT_STATUS, &val);
...
if (!(val & INV_ICM42600_INT_STATUS_RESET_DONE)) {
dev_err(dev, "reset error, reset done bit not set\n");
return -ENODEV;
}
...
Since 0xFF & INV_ICM42600_INT_STATUS_RESET_DONE evaluates to true, the reset
check passes and the driver allocates IIO devices, IRQs, and memory for a
non-existent device. Could extreme values like 0xFF or 0x00 still be treated
as errors to abort the probe?
[Severity: High]
This is a pre-existing issue, but does a probe failure leak the VDDIO
regulator enable count?
If the probe fails before devm_pm_runtime_set_active_enabled() is called
(for instance, during inv_icm42600_setup), devres executes the cleanup
function:
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:inv_icm42600_disable_vddio_reg() {
if (pm_runtime_status_suspended(dev))
return;
regulator_disable(st->vddio_supply);
}
Because the device's default PM status is RPM_SUSPENDED before runtime PM is
enabled, won't this incorrectly return early and leave the regulator
permanently enabled?
[Severity: High]
This isn't a bug introduced by this patch, but could there be a race condition
on driver unbind due to devres teardown ordering?
In inv_icm42600_core_probe(), IIO devices are registered before runtime PM is
initialized:
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:inv_icm42600_core_probe() {
...
st->indio_gyro = inv_icm42600_gyro_init(st);
...
ret = devm_pm_runtime_set_active_enabled(dev);
...
}
On teardown, runtime PM is disabled before the IIO devices are unregistered.
If the device was runtime suspended (VDDIO off) and userspace reads a sysfs
attribute during this window, we can hit this path:
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c:inv_icm42600_gyro_read_sensor() {
...
pm_runtime_get_sync(dev);
mutex_lock(&st->lock);
...
ret = inv_icm42600_set_gyro_conf(st, &conf, NULL);
...
}
Since runtime PM is disabled, pm_runtime_get_sync() fails, but its return
value is ignored. Doesn't this cause the driver to access the regmap while
VDDIO is powered off, potentially leading to bus timeouts or lockups?
> st->name = hw->name;
>
> /* reset to make sure previous state are not there */
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724202708.128267-1-jorijnvdgraaf@catcrafts.net?part=2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] dt-bindings: iio: imu: icm42600: add icm42630
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 1/4] iio: imu: inv_icm42600: sort device id tables numerically Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe Jorijn van der Graaf
@ 2026-07-24 20:27 ` Jorijn van der Graaf
2026-07-24 20:27 ` [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-27 1:50 ` [PATCH v2 0/4] " Jonathan Cameron
4 siblings, 0 replies; 7+ messages in thread
From: Jorijn van der Graaf @ 2026-07-24 20:27 UTC (permalink / raw)
To: Jonathan Cameron, Jean-Baptiste Maneyrol
Cc: Jorijn van der Graaf, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chris Morgan, Luca Weiss, linux-iio, devicetree, linux-kernel
The TDK InvenSense ICM-42630 is a 6-axis IMU of the ICM-42600 family,
found e.g. in the Fairphone 6. Document its compatible with the
ICM-42631 as fallback: TDK confirmed the part is similar to the
ICM-42631 and driven by the same driver without modification. The
dedicated compatible records the exact part so a difference can still
be handled if one surfaces (the part has no public datasheet).
Link: https://lore.kernel.org/all/BE1P281MB1426D6579C0E2709574549B6CEC22@BE1P281MB1426.DEUP281.PROD.OUTLOOK.COM/
Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
---
v2: restructure the compatible to document the icm42631 fallback and
rewrite the commit message accordingly; drop Jean-Baptiste's v1
Acked-by given the rework.
.../bindings/iio/imu/invensense,icm42600.yaml | 20 +++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml b/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml
index 119e28a833fd..39d8afd8d4a6 100644
--- a/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml
@@ -26,14 +26,18 @@ description: |
properties:
compatible:
- enum:
- - invensense,icm42600
- - invensense,icm42602
- - invensense,icm42605
- - invensense,icm42622
- - invensense,icm42631
- - invensense,icm42686
- - invensense,icm42688
+ oneOf:
+ - enum:
+ - invensense,icm42600
+ - invensense,icm42602
+ - invensense,icm42605
+ - invensense,icm42622
+ - invensense,icm42631
+ - invensense,icm42686
+ - invensense,icm42688
+ - items:
+ - const: invensense,icm42630
+ - const: invensense,icm42631
reg:
maxItems: 1
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
` (2 preceding siblings ...)
2026-07-24 20:27 ` [PATCH v2 3/4] dt-bindings: iio: imu: icm42600: add icm42630 Jorijn van der Graaf
@ 2026-07-24 20:27 ` Jorijn van der Graaf
2026-07-27 1:50 ` [PATCH v2 0/4] " Jonathan Cameron
4 siblings, 0 replies; 7+ messages in thread
From: Jorijn van der Graaf @ 2026-07-24 20:27 UTC (permalink / raw)
To: Jonathan Cameron, Jean-Baptiste Maneyrol
Cc: Jorijn van der Graaf, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chris Morgan, Luca Weiss, linux-iio, devicetree, linux-kernel
The TDK InvenSense ICM-42630 is a 6-axis IMU of the ICM-42600 family,
found e.g. in the Fairphone 6. It is register-compatible with its
siblings (the existing driver works on it unmodified) and reports
WHOAMI value 0x0C.
The part appears to be a mobile SKU and has no public datasheet: the
identity comes from the Fairphone 6 platform documentation and
schematics naming the part, and the WHOAMI value was read from the
hardware, whose bank 0 register defaults match the ICM-42600 family
layout.
Add the chip id, WHOAMI value and I2C/SPI match entries, using the
family default configuration like the ICM-42631. Devicetrees describe
the part with an icm42631 fallback; the dedicated entries bind the
exact part where the kernel knows it.
Tested on the Fairphone 6 via a backport of this change to the
device's 7.1-based kernel (only the id-table style and entry placement
adjusted to that base), on a bit-banged SPI bus with INT1 wired to the
SoC: probe, accelerometer, gyroscope and temperature raw reads, all
full-scale ranges, multiple sampling frequencies, and watermark-paced
FIFO reads through the INT1 interrupt.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Assisted-by: Claude:claude-fable-5
Signed-off-by: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
---
v2: place the match entries in numeric position (the only code
change); kept the Acked-by.
drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 ++
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 5 +++++
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 4 ++++
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 4 ++++
4 files changed, 15 insertions(+)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600.h b/drivers/iio/imu/inv_icm42600/inv_icm42600.h
index b55d993f0264..349de5458581 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600.h
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600.h
@@ -28,6 +28,7 @@ enum inv_icm42600_chip {
INV_CHIP_ICM42622,
INV_CHIP_ICM42688,
INV_CHIP_ICM42631,
+ INV_CHIP_ICM42630,
INV_CHIP_NB,
};
@@ -386,6 +387,7 @@ struct inv_icm42600_sensor_state {
#define INV_ICM42600_WHOAMI_ICM42622 0x46
#define INV_ICM42600_WHOAMI_ICM42688 0x47
#define INV_ICM42600_WHOAMI_ICM42631 0x5C
+#define INV_ICM42600_WHOAMI_ICM42630 0x0C
/* User bank 1 (MSB 0x10) */
#define INV_ICM42600_REG_SENSOR_CONFIG0 0x1003
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
index f306e3ffca48..da7bc0f1155c 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
@@ -177,6 +177,11 @@ static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] = {
.name = "icm42631",
.conf = &inv_icm42600_default_conf,
},
+ [INV_CHIP_ICM42630] = {
+ .whoami = INV_ICM42600_WHOAMI_ICM42630,
+ .name = "icm42630",
+ .conf = &inv_icm42600_default_conf,
+ },
};
const struct iio_mount_matrix *
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
index e44ed6dcde02..672b19d2e41c 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
@@ -78,6 +78,7 @@ static const struct i2c_device_id inv_icm42600_id[] = {
{ .name = "icm42602", .driver_data = INV_CHIP_ICM42602 },
{ .name = "icm42605", .driver_data = INV_CHIP_ICM42605 },
{ .name = "icm42622", .driver_data = INV_CHIP_ICM42622 },
+ { .name = "icm42630", .driver_data = INV_CHIP_ICM42630 },
{ .name = "icm42631", .driver_data = INV_CHIP_ICM42631 },
{ .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
{ .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
@@ -98,6 +99,9 @@ static const struct of_device_id inv_icm42600_of_matches[] = {
}, {
.compatible = "invensense,icm42622",
.data = (void *)INV_CHIP_ICM42622,
+ }, {
+ .compatible = "invensense,icm42630",
+ .data = (void *)INV_CHIP_ICM42630,
}, {
.compatible = "invensense,icm42631",
.data = (void *)INV_CHIP_ICM42631,
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
index 3e2f4eb42e97..3707460d77e1 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
@@ -75,6 +75,7 @@ static const struct spi_device_id inv_icm42600_id[] = {
{ .name = "icm42602", .driver_data = INV_CHIP_ICM42602 },
{ .name = "icm42605", .driver_data = INV_CHIP_ICM42605 },
{ .name = "icm42622", .driver_data = INV_CHIP_ICM42622 },
+ { .name = "icm42630", .driver_data = INV_CHIP_ICM42630 },
{ .name = "icm42631", .driver_data = INV_CHIP_ICM42631 },
{ .name = "icm42686", .driver_data = INV_CHIP_ICM42686 },
{ .name = "icm42688", .driver_data = INV_CHIP_ICM42688 },
@@ -95,6 +96,9 @@ static const struct of_device_id inv_icm42600_of_matches[] = {
}, {
.compatible = "invensense,icm42622",
.data = (void *)INV_CHIP_ICM42622,
+ }, {
+ .compatible = "invensense,icm42630",
+ .data = (void *)INV_CHIP_ICM42630,
}, {
.compatible = "invensense,icm42631",
.data = (void *)INV_CHIP_ICM42631,
--
2.55.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630
2026-07-24 20:27 [PATCH v2 0/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
` (3 preceding siblings ...)
2026-07-24 20:27 ` [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
@ 2026-07-27 1:50 ` Jonathan Cameron
4 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2026-07-27 1:50 UTC (permalink / raw)
To: Jorijn van der Graaf
Cc: Jean-Baptiste Maneyrol, David Lechner, Nuno Sá,
Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chris Morgan, Luca Weiss, linux-iio, devicetree, linux-kernel
On Fri, 24 Jul 2026 22:27:04 +0200
Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net> wrote:
> The TDK InvenSense ICM-42630 is a 6-axis IMU of the ICM-42600 family,
> used in the Fairphone 6. The existing inv_icm42600 driver drives it
> unmodified.
Looks good to me. Given Jean-Baptiste already gave a tag for the
main patch, I'm kust looking for a dt binding reviewer ack once
they get to reviewing this one.
Thanks,
Jonathan
>
> v2 restructures the series per the v1 review: the binding documents the
> new compatible with an invensense,icm42631 fallback, and the driver's
> WHOAMI hard check becomes a warning so that a fallback-matched part can
> probe at all (on older kernels via a backport of that one patch). The
> id tables are sorted numerically in a precursor patch and the new
> entries slot into numeric position.
>
> Both resulting paths were tested on the Fairphone 6 with the fallback
> pair in the devicetree, via backports to its 7.1-based kernel: matched
> as icm42631 through the fallback (patch 2 alone, dedicated entries
> removed), the part warns once, probes, and accelerometer, gyroscope
> and temperature reads work; with the dedicated entries present it
> binds as icm42630 without a warning. The fuller v1 test set (all
> full-scale ranges, several sampling frequencies, watermark-paced FIFO
> reads via INT1) ran with the dedicated compatible and is unchanged by
> this revision.
>
> Chris Morgan's icm42607 series [1] touches the same binding enum, so
> whichever lands second has a trivial merge conflict. Its conditional
> interrupts requirement covers the ICM-42630 automatically through the
> fallback compatible.
>
> Changes in v2:
> - new patch 1: sort the device id tables numerically (Jonathan)
> - new patch 2: warn on whoami mismatch instead of failing probe
> (Conor, Jonathan)
> - patch 3 (v1 patch 1): compatible now documented with the icm42631
> fallback (Jonathan); commit message rewritten; dropped Jean-Baptiste's
> Acked-by because of the rework
> - patch 4 (v1 patch 2): match entries placed in numeric position
> (Jonathan); kept Jean-Baptiste's Acked-by - the only code change is
> the entry placement; its commit message gains a sentence on the
> fallback and a more precise note on the tested backport
>
> [1] https://lore.kernel.org/all/20260722153942.144387-1-macroalpha82@gmail.com/
>
> v1: https://lore.kernel.org/all/20260720173411.82979-1-jorijnvdgraaf@catcrafts.net/
>
> Jorijn van der Graaf (4):
> iio: imu: inv_icm42600: sort device id tables numerically
> iio: imu: inv_icm42600: warn on whoami mismatch instead of failing
> probe
> dt-bindings: iio: imu: icm42600: add icm42630
> iio: imu: inv_icm42600: add support for icm42630
>
> .../bindings/iio/imu/invensense,icm42600.yaml | 20 +++++++++++--------
> drivers/iio/imu/inv_icm42600/inv_icm42600.h | 2 ++
> .../iio/imu/inv_icm42600/inv_icm42600_core.c | 13 +++++++-----
> .../iio/imu/inv_icm42600/inv_icm42600_i2c.c | 18 ++++++++++-------
> .../iio/imu/inv_icm42600/inv_icm42600_spi.c | 18 ++++++++++-------
> 5 files changed, 44 insertions(+), 27 deletions(-)
>
>
> base-commit: 036d96ceec6d966339aea34d034420991e24cfac
^ permalink raw reply [flat|nested] 7+ messages in thread