From nobody Tue Sep 29 07:43:57 2026 Received: from out-2uec-a123.jellyfish.systems (out-2uec-a123.jellyfish.systems [63.250.43.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B785B337BA4 for ; Mon, 10 Aug 2026 19:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.250.43.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389456; cv=none; b=qO6hUkynglv8nmsHq/bWU0F32b5SkKFg9e8YrawbcKDxTMFPbCJT7W183WObEzRaoCeWiHQltygG3V7WaH6Z4qa5N4J8uw4JTIthBk6HcyF7b+tk5u4+0ALPY0BQ3T3E14qY0iqpZhecdFb8p79u7Mt0ezcNNVY/ucX9q9vJcNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389456; c=relaxed/simple; bh=c01oYPIoUPImO0NUGI8m3yJYizVhRUr/sKwDQIzfHYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RTvHz5eAB+mqBP6Mb1n0JVKM/PxbMPwbnS8dhrLF1EF/RERtYLBWR1KxBhdni7GarG8Gi4oBYsLDZ9au3LsrzgbQjjJRdqyY12vG8uFpdxtTAKMQVTQS1HSZkxzhe4ecX6EMCsKRAhYNMzKM1VYjRoMw1iCXA2a07mylj/8moIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net; spf=pass smtp.mailfrom=catcrafts.net; arc=none smtp.client-ip=63.250.43.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=catcrafts.net Received: from mail.privateemail.com (unknown [87.215.145.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4hJks20yqQz2x99; Mon, 10 Aug 2026 19:12:05 +0000 (UTC) From: Jorijn van der Graaf To: Jonathan Cameron , Jean-Baptiste Maneyrol Cc: Jorijn van der Graaf , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chris Morgan , Luca Weiss , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] iio: imu: inv_icm42600: sort device id tables numerically Date: Mon, 10 Aug 2026 21:11:55 +0200 Message-ID: <20260810191157.125550-2-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> References: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Envelope-From: jorijnvdgraaf@catcrafts.net Content-Type: text/plain; charset="utf-8" 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 Link: https://lore.kernel.org/all/20260724012505.02029e51@jic23-huawei/ Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf --- No changes in v4. 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[] =3D= { { .name =3D "icm42600", .driver_data =3D INV_CHIP_ICM42600 }, { .name =3D "icm42602", .driver_data =3D INV_CHIP_ICM42602 }, { .name =3D "icm42605", .driver_data =3D INV_CHIP_ICM42605 }, - { .name =3D "icm42686", .driver_data =3D INV_CHIP_ICM42686 }, { .name =3D "icm42622", .driver_data =3D INV_CHIP_ICM42622 }, - { .name =3D "icm42688", .driver_data =3D INV_CHIP_ICM42688 }, { .name =3D "icm42631", .driver_data =3D INV_CHIP_ICM42631 }, + { .name =3D "icm42686", .driver_data =3D INV_CHIP_ICM42686 }, + { .name =3D "icm42688", .driver_data =3D INV_CHIP_ICM42688 }, { } }; MODULE_DEVICE_TABLE(i2c, inv_icm42600_id); @@ -95,18 +95,18 @@ static const struct of_device_id inv_icm42600_of_matche= s[] =3D { }, { .compatible =3D "invensense,icm42605", .data =3D (void *)INV_CHIP_ICM42605, - }, { - .compatible =3D "invensense,icm42686", - .data =3D (void *)INV_CHIP_ICM42686, }, { .compatible =3D "invensense,icm42622", .data =3D (void *)INV_CHIP_ICM42622, - }, { - .compatible =3D "invensense,icm42688", - .data =3D (void *)INV_CHIP_ICM42688, }, { .compatible =3D "invensense,icm42631", .data =3D (void *)INV_CHIP_ICM42631, + }, { + .compatible =3D "invensense,icm42686", + .data =3D (void *)INV_CHIP_ICM42686, + }, { + .compatible =3D "invensense,icm42688", + .data =3D (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[] =3D= { { .name =3D "icm42600", .driver_data =3D INV_CHIP_ICM42600 }, { .name =3D "icm42602", .driver_data =3D INV_CHIP_ICM42602 }, { .name =3D "icm42605", .driver_data =3D INV_CHIP_ICM42605 }, - { .name =3D "icm42686", .driver_data =3D INV_CHIP_ICM42686 }, { .name =3D "icm42622", .driver_data =3D INV_CHIP_ICM42622 }, - { .name =3D "icm42688", .driver_data =3D INV_CHIP_ICM42688 }, { .name =3D "icm42631", .driver_data =3D INV_CHIP_ICM42631 }, + { .name =3D "icm42686", .driver_data =3D INV_CHIP_ICM42686 }, + { .name =3D "icm42688", .driver_data =3D INV_CHIP_ICM42688 }, { } }; MODULE_DEVICE_TABLE(spi, inv_icm42600_id); @@ -92,18 +92,18 @@ static const struct of_device_id inv_icm42600_of_matche= s[] =3D { }, { .compatible =3D "invensense,icm42605", .data =3D (void *)INV_CHIP_ICM42605, - }, { - .compatible =3D "invensense,icm42686", - .data =3D (void *)INV_CHIP_ICM42686, }, { .compatible =3D "invensense,icm42622", .data =3D (void *)INV_CHIP_ICM42622, - }, { - .compatible =3D "invensense,icm42688", - .data =3D (void *)INV_CHIP_ICM42688, }, { .compatible =3D "invensense,icm42631", .data =3D (void *)INV_CHIP_ICM42631, + }, { + .compatible =3D "invensense,icm42686", + .data =3D (void *)INV_CHIP_ICM42686, + }, { + .compatible =3D "invensense,icm42688", + .data =3D (void *)INV_CHIP_ICM42688, }, { } }; --=20 2.55.0 From nobody Tue Sep 29 07:43:57 2026 Received: from out-93wp-a30.jellyfish.systems (out-93wp-a30.jellyfish.systems [104.207.68.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E1AF345ED3 for ; Mon, 10 Aug 2026 19:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=104.207.68.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389160; cv=none; b=TxD7ZaNvVnSXj8h0HhwzL2Xb070CJHHMM84/cp4Gj2Zl4WXTyU67+2ctHeQT0EpQQsbKlJegS3nGpRdCGXjFKMDWGhtk0bUbCUfLQaIg+kD/0ScwW/IxgF7r4lJfXc2zAJKFbWdPUlRzVtIkzTCC1vzGrQqxOxX8uNoYX04+e3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389160; c=relaxed/simple; bh=aqYf1sM77HVeW0pess7TRxJwHjdxa/ksSEzUXUewxIo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D3ZvMvhMQjPefFPZFtO2UWZ8+cReAGwUUyuFKpZRLot8plcGCycO9rRhRfuMwMzimo2FVZBN8ttfauN6oM0CYuGePM2CGrtXL6sC4HX5rZ60+G7fo2zXnhReaKmobzCsBq5mdhz6e7dUo7Zh2YAQxj2wJK/3V2zLQxUVKb/J3t0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net; spf=pass smtp.mailfrom=catcrafts.net; arc=none smtp.client-ip=104.207.68.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=catcrafts.net Received: from mail.privateemail.com (unknown [87.215.145.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4hJks56X8xz2x9C; Mon, 10 Aug 2026 19:12:09 +0000 (UTC) From: Jorijn van der Graaf To: Jonathan Cameron , Jean-Baptiste Maneyrol Cc: Jorijn van der Graaf , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chris Morgan , Luca Weiss , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley Subject: [PATCH v4 2/3] iio: imu: inv_icm42600: log whoami mismatch instead of failing probe Date: Mon, 10 Aug 2026 21:11:56 +0200 Message-ID: <20260810191157.125550-3-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> References: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Envelope-From: jorijnvdgraaf@catcrafts.net Content-Type: text/plain; charset="utf-8" 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: log the mismatch at info level and continue. The message keeps a breadcrumb for anyone seeing an unexpected part change on their device versus the devicetree; tmp117 takes the same trade at the same level for its fallback matches. A whoami of 0x00 or 0xff still fails probe: SPI has no transfer-level ack, so those values mean nothing answered; this is the same no-response guard inv_icm45600 carries. Otherwise the probe outcome on mismatch changes 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, probes with the one informational line, and accelerometer, gyroscope and temperature reads work. Suggested-by: Conor Dooley Suggested-by: Jonathan Cameron Link: https://lore.kernel.org/all/20260722-creature-volley-0f083b904c1d@spu= d/ Link: https://lore.kernel.org/all/20260728222015.6a62b287@jic23-huawei/ Link: https://lore.kernel.org/all/20260801032310.18f5f16d@jic23-huawei/ Link: https://lore.kernel.org/all/20260804-scarily-hacker-651df3eafea9@spud/ Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf --- v4: keep the whoami read and log the mismatch at info level, following the wording Jonathan proposed (Jonathan, Conor), instead of deleting the check and the whoami definitions; add inv_icm45600's no-response guard - whoami 0x00/0xff still fails probe; both prints use %#04x so the two ids render at equal width; retested on the device. v3 dropped the check and the whoami definitions entirely. New in v2, as a demotion of the error to a warning. drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 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..8ceaf825f124 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -510,9 +511,18 @@ static int inv_icm42600_setup(struct inv_icm42600_stat= e *st, if (ret) return ret; if (val !=3D hw->whoami) { - dev_err(dev, "invalid whoami %#02x expected %#02x (%s)\n", - val, hw->whoami, hw->name); - return -ENODEV; + /* + * SPI interface has no ack mechanism. + * 0xFF or 0x00 whoami means no response from the device. + */ + if (val =3D=3D U8_MAX || val =3D=3D 0) + return dev_err_probe(dev, -ENODEV, + "invalid whoami %#04x expected %#04x (%s)\n", + val, hw->whoami, hw->name); + + dev_info(dev, + "device id %#04x is not the %#04x associated with the FW-specified dev= ice (%s), probably using a valid fallback compatible\n", + val, hw->whoami, hw->name); } st->name =3D hw->name; =20 --=20 2.55.0 From nobody Tue Sep 29 07:43:57 2026 Received: from out-93wp-a36.jellyfish.systems (out-93wp-a36.jellyfish.systems [104.207.68.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C34341A4F7 for ; Mon, 10 Aug 2026 19:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=104.207.68.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389161; cv=none; b=hdy3fUO4qhtfN74NrOt5lgpdnny8aX0YVznAYswlH98pcrt6HghGcEhIppWvLhiZ4D5eJ245/ao9xrAuGtORs2VXg5OSdzgiXbA6MlmsHYfNm7o/eR4/XOqHKiGTlYsLz+8Ex5kBvvxtAF/2LapLNvovmZVzSjmD0CMQ6Q9WhVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786389161; c=relaxed/simple; bh=zGVGWPhm7eTna0cRt/8tYYWJ96lc20ZgiIkDlXf56mg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VQPSabDs5m/4x6M9M66Ac3LOD/B/MneMq2Bs93G6AxKl5ogypg0EwXkBqsagag0vt1XcuNu6k8+asiY59MBqQjwxWqLgtRyHu++IEIxGRgNnz2fhN1DD6CIu9At07jTIURUqLZhKLboWmSEn8mwHZYEEpOWm+m7Gz0RzRqTI3/o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net; spf=pass smtp.mailfrom=catcrafts.net; arc=none smtp.client-ip=104.207.68.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=catcrafts.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=catcrafts.net Received: from mail.privateemail.com (unknown [87.215.145.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4hJks96PLJz2x99; Mon, 10 Aug 2026 19:12:13 +0000 (UTC) From: Jorijn van der Graaf To: Jonathan Cameron , Jean-Baptiste Maneyrol Cc: Jorijn van der Graaf , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chris Morgan , Luca Weiss , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley Subject: [PATCH v4 3/3] dt-bindings: iio: imu: icm42600: add icm42630 Date: Mon, 10 Aug 2026 21:11:57 +0200 Message-ID: <20260810191157.125550-4-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> References: <20260810191157.125550-1-jorijnvdgraaf@catcrafts.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Envelope-From: jorijnvdgraaf@catcrafts.net Content-Type: text/plain; charset="utf-8" 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@BE= 1P281MB1426.DEUP281.PROD.OUTLOOK.COM/ Acked-by: Conor Dooley Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf Acked-by lapsed with the rework. --- v4: rebased over the icm42607 and mount-matrix changes to this file (no content change); added Conor's Acked-by. No changes in v3. v2: restructured to the icm42631 fallback form; Jean-Baptiste's v1 Acked-by lapsed with the rework. .../bindings/iio/imu/invensense,icm42600.yaml | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.= yaml b/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml index 81b6e85decd5..9e22b603d47f 100644 --- a/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml +++ b/Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml @@ -26,16 +26,20 @@ description: | =20 properties: compatible: - enum: - - invensense,icm42600 - - invensense,icm42602 - - invensense,icm42605 - - invensense,icm42607 - - invensense,icm42607p - - invensense,icm42622 - - invensense,icm42631 - - invensense,icm42686 - - invensense,icm42688 + oneOf: + - enum: + - invensense,icm42600 + - invensense,icm42602 + - invensense,icm42605 + - invensense,icm42607 + - invensense,icm42607p + - invensense,icm42622 + - invensense,icm42631 + - invensense,icm42686 + - invensense,icm42688 + - items: + - const: invensense,icm42630 + - const: invensense,icm42631 =20 reg: maxItems: 1 --=20 2.55.0