Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Chris Morgan <macromorgan@hotmail.com>
Cc: Chris Morgan <macroalpha82@gmail.com>,
	linux-iio@vger.kernel.org, andy@kernel.org, nuno.sa@analog.com,
	dlechner@baylibre.com, jean-baptiste.maneyrol@tdk.com,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	heiko@sntech.de, conor+dt@kernel.org, krzk+dt@kernel.org,
	robh@kernel.org, andriy.shevchenko@intel.com
Subject: Re: [PATCH V17 3/9] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver
Date: Fri, 24 Jul 2026 00:16:47 +0100	[thread overview]
Message-ID: <20260724001647.42af95ff@jic23-huawei> (raw)
In-Reply-To: <DS4PR19MB9973350E9251D329E03A96066FA5C32@DS4PR19MB997335.namprd19.prod.outlook.com>

On Mon, 20 Jul 2026 12:15:06 -0500
Chris Morgan <macromorgan@hotmail.com> wrote:

> On Sun, Jul 19, 2026 at 12:05:30AM +0100, Jonathan Cameron wrote:
> > On Thu, 16 Jul 2026 13:26:30 -0500
> > Chris Morgan <macroalpha82@gmail.com> wrote:
> >   
> > > From: Chris Morgan <macromorgan@hotmail.com>
> > > 
> > > Add the core component of a new inv_icm42607 driver. This includes
> > > a few setup functions and the full register definition in the
> > > header file, as well as the bits necessary to compile and probe the
> > > device when used on an i2c bus.
> > > 
> > > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>  
> > 
> > Hi Chris,
> > 
> > Just one small thing below given you are probably going to do
> > a v18.  If it had just been this I might have tweaked it whilst
> > applying
> > 
> > Thanks,
> > 
> > Jonathan
> > 
> >   
> > > diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c b/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c
> > > new file mode 100644
> > > index 000000000000..8f74bf38aad1
> > > --- /dev/null
> > > +++ b/drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c  
> > 
> > ...
> >   
> > > +static int inv_icm42607_probe(struct i2c_client *client)
> > > +{
> > > +	struct device *dev = &client->dev;
> > > +	const struct inv_icm42607_hw *hw;
> > > +	struct regmap *regmap;
> > > +
> > > +	hw = i2c_get_match_data(client);
> > > +	if (!hw)
> > > +		return dev_err_probe(dev, -ENODEV, "Failed to get i2c data\n");
> > > +
> > > +	regmap = devm_regmap_init_i2c(client, &inv_icm42607_regmap_config);
> > > +	if (IS_ERR(regmap))
> > > +		return dev_err_probe(dev, PTR_ERR(regmap),
> > > +				     "Failed to register i2c regmap\n");
> > > +
> > > +	return inv_icm42607_core_probe(regmap, hw, inv_icm42607_i2c_bus_setup);
> > > +}
> > > +
> > > +static const struct i2c_device_id inv_icm42607_id[] = {
> > > +	{
> > > +		.name = "icm42607",
> > > +		.driver_data = (kernel_ulong_t)&inv_icm42607_hw_data,
> > > +	}, {
> > > +		.name = "icm42607p",
> > > +		.driver_data = (kernel_ulong_t)&inv_icm42607p_hw_data,
> > > +	},
> > > +	{ }
> > > +};
> > > +MODULE_DEVICE_TABLE(i2c, inv_icm42607_id);
> > > +
> > > +static const struct of_device_id inv_icm42607_of_matches[] = {
> > > +	{
> > > +		.compatible = "invensense,icm42607",  
> > 
> > I'd expect to see the data here as well.  Look at implementation of i2c_get_match_data()
> > and consider what would happen if there was a slightly mismatch between which devices
> > were listed in each table.  To avoid that fragility we normally just put
> > the data pointers in both places.  
> 
> I was advised in the notes for patch v16 that it could be removed. Should I go back and
> undo the remove?

Ah. I missed Uwe's comment. I've replied to that email. Let's give
it a day or two to see if Uwe comes back with an reason beyond it
working without it (which is true as long as the IDs always match!)

Jonathan

> 
> Thank you,
> Chris
> 
> >   
> > > +	}, {
> > > +		.compatible = "invensense,icm42607p",
> > > +	},
> > > +	{ }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, inv_icm42607_of_matches);  
> > 
> >   
> 


  reply	other threads:[~2026-07-23 23:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 18:26 [PATCH V17 0/9] Add Invensense ICM42607 Chris Morgan
2026-07-16 18:26 ` [PATCH V17 1/9] dt-bindings: iio: imu: icm42600: Add mount-matrix Chris Morgan
2026-07-16 18:26 ` [PATCH V17 2/9] dt-bindings: iio: imu: icm42600: Add icm42607 Chris Morgan
2026-07-17  6:21   ` Krzysztof Kozlowski
2026-07-16 18:26 ` [PATCH V17 3/9] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver Chris Morgan
2026-07-18 23:05   ` Jonathan Cameron
2026-07-20 17:15     ` Chris Morgan
2026-07-23 23:16       ` Jonathan Cameron [this message]
2026-07-16 18:26 ` [PATCH V17 4/9] iio: imu: inv_icm42607: Add SPI For icm42607 Chris Morgan
2026-07-17  9:03   ` Uwe Kleine-König
2026-07-16 18:26 ` [PATCH V17 5/9] iio: imu: inv_icm42607: Add PM support for icm42607 Chris Morgan
2026-07-16 18:26 ` [PATCH V17 6/9] iio: imu: inv_icm42607: Add Accelerometer " Chris Morgan
2026-07-16 18:26 ` [PATCH V17 7/9] iio: imu: inv_icm42607: Add Gyroscope to icm42607 Chris Morgan
2026-07-16 18:26 ` [PATCH V17 8/9] iio: imu: inv_icm42607: Add Temp Support in icm42607 Chris Morgan
2026-07-18 22:59   ` Jonathan Cameron
2026-07-16 18:26 ` [PATCH V17 9/9] arm64: dts: rockchip: Add icm42607p IMU for RG-DS Chris Morgan
2026-07-18 23:13 ` [PATCH V17 0/9] Add Invensense ICM42607 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=20260724001647.42af95ff@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=heiko@sntech.de \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=macroalpha82@gmail.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