From nobody Sat Jul 25 02:13:06 2026 Received: from MTA-13-4.privateemail.com (mta-13-4.privateemail.com [198.54.127.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 321673B1034; Fri, 24 Jul 2026 20:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.54.127.109 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924870; cv=none; b=ZEUhpMuq2A8n8vB117WG78/hXQETDgOcWYtkXkP9JIViBnmLt+BZ9FFtKkAt+YKDOaEUPZUYvnEam8Bg5sXGt5+5F2r/uJ8rRqflLV7nuO9X9rW/OF9YbuNRkQhCMGNCypAawaXKpkZqQQ2QV74dLNwSCJK9iqooOJG/LOXCSUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924870; c=relaxed/simple; bh=Bi4UgXLAWph1pN1LwHcRU3JFtD4L9BrGep74QN9CJVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rn8FQUEsXYIzRCrC+Pc164EUYvpGGbltnTdo/H5xPlZSnjVcGi3OfxhJYcaDHKa4403UCb/jempjTB3peFaR06RShbYkwpZEx67lRua8wX88696HrT+BUPya3xFBumKSJqNToBgd2AjvVUmbhettd+cvl2p0RIBbBTVNehDqpJE= 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=198.54.127.109 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 (K8S-PROD-WORKER-08 [87.215.145.39]) by mta-13.privateemail.com (Postfix) with ESMTPA id 4h6KKw4Tkvz3hhTN; Fri, 24 Jul 2026 16:27:31 -0400 (EDT) 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 v2 1/4] iio: imu: inv_icm42600: sort device id tables numerically Date: Fri, 24 Jul 2026 22:27:05 +0200 Message-ID: <20260724202708.128267-2-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260724202708.128267-1-jorijnvdgraaf@catcrafts.net> References: <20260724202708.128267-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 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 --- 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[] =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 Sat Jul 25 02:13:06 2026 Received: from MTA-13-4.privateemail.com (mta-13-4.privateemail.com [198.54.127.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E2CD3AFCE1; Fri, 24 Jul 2026 20:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.54.127.109 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924888; cv=none; b=eAdPARlX67i4bGJMVhxUbKE/Mc8D0T3+3xWHqHbtObdiHlKSnH7xhjpRJ57lOaJ/8yFN+1ieT6Y0HGJJantTp3oU2YpLOa8UHbL0+AZnZ2YtFgu1Z+ORoH5ibYSsuIHX00F5EbEO+dmqWtHvXJJDOrIXB1Bm+640OstMcHNJKpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924888; c=relaxed/simple; bh=AK2yOPCXCzkTWRJ+7PX/06kW9b8hIuQOGbVbAZd0JEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jcfqDfQRSxIFrY+Jl2QTtlVaM0LCfOhDtGjAtMaN009IdWokFpgWYnHF7x5KQR9YQc3tDkGZDmHa5jiKgSZ1lhMg0tRejn1K4R3IsSNf8K2itrQInuctOoEs0DadvUmEcWRjwdNScT/+SWz5eTY2eY/giA/DUxyvBtfvOi2dXJQ= 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=198.54.127.109 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 (K8S-PROD-WORKER-08 [87.215.145.39]) by mta-13.privateemail.com (Postfix) with ESMTPA id 4h6KLF4pY4z3hhTR; Fri, 24 Jul 2026 16:27:48 -0400 (EDT) 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 v2 2/4] iio: imu: inv_icm42600: warn on whoami mismatch instead of failing probe Date: Fri, 24 Jul 2026 22:27:06 +0200 Message-ID: <20260724202708.128267-3-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260724202708.128267-1-jorijnvdgraaf@catcrafts.net> References: <20260724202708.128267-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 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: 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 Link: https://lore.kernel.org/all/20260722-creature-volley-0f083b904c1d@spu= d/ Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf --- 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_stat= e *st, ret =3D regmap_read(st->map, INV_ICM42600_REG_WHOAMI, &val); 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; - } + if (val !=3D hw->whoami) + dev_warn(dev, "unexpected whoami %#02x, expected %#02x (%s)\n", + val, hw->whoami, hw->name); st->name =3D hw->name; =20 /* reset to make sure previous state are not there */ --=20 2.55.0 From nobody Sat Jul 25 02:13:06 2026 Received: from MTA-13-4.privateemail.com (mta-13-4.privateemail.com [198.54.127.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60E723AFCE1; Fri, 24 Jul 2026 20:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.54.127.109 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924905; cv=none; b=S9Jafc9g9Yf4fUE5+8YsVvKwu1ziv9o6kvhWTLMozXVfiSOfIjZL2k5/Z+4kyPonmMibypuDWVJFLK6gXmIPX1KqNa+XsMvv/B/MiNziCcP+SJ1FTXnJ5NS6h69Y6WppDuAyfaQttedtHsFWzxpbPv8/9oXf0WFGlHdHaNu/JDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924905; c=relaxed/simple; bh=XyrXRsyc30ir3fHv2V7fCrfaKeiF+YOfW7mtmSAJ2ao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nQc2bhYcI0pboPblxRNsushi59DDX6Ik+6mO9zJ2ddSnxGHfJ39UGdV4szci4KKGoRKmKT2LQJOU//8G15jwDHc5UlAb0HYZ2rRqECjp3p4Xnb1mJzDYEH68G2Fmpx2+tZ7O37nEP4ecJplwFayE5+RPKP3g+X2VK/Muf1AaQKs= 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=198.54.127.109 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 (K8S-PROD-WORKER-08 [87.215.145.39]) by mta-13.privateemail.com (Postfix) with ESMTPA id 4h6KLb6TPQz3hhTw; Fri, 24 Jul 2026 16:28:06 -0400 (EDT) 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 v2 3/4] dt-bindings: iio: imu: icm42600: add icm42630 Date: Fri, 24 Jul 2026 22:27:07 +0200 Message-ID: <20260724202708.128267-4-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260724202708.128267-1-jorijnvdgraaf@catcrafts.net> References: <20260724202708.128267-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 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/ Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf Acked-by given the rework. --- 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: | =20 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 =20 reg: maxItems: 1 --=20 2.55.0 From nobody Sat Jul 25 02:13:06 2026 Received: from MTA-13-4.privateemail.com (mta-13-4.privateemail.com [198.54.127.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49DA53B14CD; Fri, 24 Jul 2026 20:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.54.127.109 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924922; cv=none; b=ueQF90cdoSsnSB82TOd2i1pabbraKvovfJWr6OypLAg7OSKjT54lFKrYb2jRg9mSJwkwcHdMSBsHmyczOWqYl26SGy/kIjfcfoLfonh6nL7uZ7+LTy1nfllE/yIBnRbdAToBs03NNKfmTXtfoVYCEcLjn0Uk+9MVT6NsD00JZxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784924922; c=relaxed/simple; bh=v0etaXw1S/chPUzBhWK6v2uYzeoygcIlmvq3BkEUI4Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j9Cmzjows+brSHqn/GvTqktkxoNFpD7k4WOzKnDzO1zlTsSbdPoK9Iv8uleo4CanngpZhU1ZZJ2jUZ+vRK3uXki6mvub86AQA2iTttlX/4pV3Px0iYmC/OxEpH3QA9X4XaAWLWowK24zKOmPIxdsNMYLKTSajEXUeSKVpu0S9y0= 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=198.54.127.109 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 (K8S-PROD-WORKER-08 [87.215.145.39]) by mta-13.privateemail.com (Postfix) with ESMTPA id 4h6KLw6r1pz3hhTR; Fri, 24 Jul 2026 16:28:23 -0400 (EDT) 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 v2 4/4] iio: imu: inv_icm42600: add support for icm42630 Date: Fri, 24 Jul 2026 22:27:08 +0200 Message-ID: <20260724202708.128267-5-jorijnvdgraaf@catcrafts.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260724202708.128267-1-jorijnvdgraaf@catcrafts.net> References: <20260724202708.128267-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 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. 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 Assisted-by: Claude:claude-fable-5 Signed-off-by: Jorijn van der Graaf --- 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, }; =20 @@ -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 =20 /* 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[IN= V_CHIP_NB] =3D { .name =3D "icm42631", .conf =3D &inv_icm42600_default_conf, }, + [INV_CHIP_ICM42630] =3D { + .whoami =3D INV_ICM42600_WHOAMI_ICM42630, + .name =3D "icm42630", + .conf =3D &inv_icm42600_default_conf, + }, }; =20 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[] =3D { { .name =3D "icm42602", .driver_data =3D INV_CHIP_ICM42602 }, { .name =3D "icm42605", .driver_data =3D INV_CHIP_ICM42605 }, { .name =3D "icm42622", .driver_data =3D INV_CHIP_ICM42622 }, + { .name =3D "icm42630", .driver_data =3D INV_CHIP_ICM42630 }, { .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 }, @@ -98,6 +99,9 @@ static const struct of_device_id inv_icm42600_of_matches[= ] =3D { }, { .compatible =3D "invensense,icm42622", .data =3D (void *)INV_CHIP_ICM42622, + }, { + .compatible =3D "invensense,icm42630", + .data =3D (void *)INV_CHIP_ICM42630, }, { .compatible =3D "invensense,icm42631", .data =3D (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[] =3D { { .name =3D "icm42602", .driver_data =3D INV_CHIP_ICM42602 }, { .name =3D "icm42605", .driver_data =3D INV_CHIP_ICM42605 }, { .name =3D "icm42622", .driver_data =3D INV_CHIP_ICM42622 }, + { .name =3D "icm42630", .driver_data =3D INV_CHIP_ICM42630 }, { .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 }, @@ -95,6 +96,9 @@ static const struct of_device_id inv_icm42600_of_matches[= ] =3D { }, { .compatible =3D "invensense,icm42622", .data =3D (void *)INV_CHIP_ICM42622, + }, { + .compatible =3D "invensense,icm42630", + .data =3D (void *)INV_CHIP_ICM42630, }, { .compatible =3D "invensense,icm42631", .data =3D (void *)INV_CHIP_ICM42631, --=20 2.55.0