Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: "Jorijn van der Graaf" <jorijnvdgraaf@catcrafts.net>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	"Luca Weiss" <luca.weiss@fairphone.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630
Date: Tue, 28 Jul 2026 22:25:58 +0100	[thread overview]
Message-ID: <20260728222558.56062c45@jic23-huawei> (raw)
In-Reply-To: <20260728-hardwood-support-f18e98366142@spud>

On Tue, 28 Jul 2026 17:53:37 +0100
Conor Dooley <conor@kernel.org> wrote:

> On Fri, Jul 24, 2026 at 10:27:08PM +0200, Jorijn van der Graaf wrote:
> > 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>  
> 
> This patch is not needed because you can make use of the fallback and
> should be dropped.

This is related to whether we print or not.
 
+ the name is userspace ABI so whilst it will work with the fallback naming
that can cause confusion.  I don't mind just using the fallback in this
particular case given as far as we know this really is effectively identical
to the other part rather than a superset case where later driver changes
will add more features and changing the ABI by 'correcting' the name.

Jonathan

> 
> Thanks,
> Conor.
> 
> > ---
> > 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
> >   


  reply	other threads:[~2026-07-28 21:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:44   ` sashiko-bot
2026-07-28 16:51   ` Conor Dooley
2026-07-28 21:20     ` Jonathan Cameron
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 ` [PATCH v2 4/4] iio: imu: inv_icm42600: add support for icm42630 Jorijn van der Graaf
2026-07-28 16:53   ` Conor Dooley
2026-07-28 21:25     ` Jonathan Cameron [this message]
2026-07-27  1:50 ` [PATCH v2 0/4] " Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260728222558.56062c45@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jorijnvdgraaf@catcrafts.net \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=macromorgan@hotmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox