Re: [PATCH v3 6/8] iio: imu: inv_icm42607: Implement MREGx register access

From: Kanak Shilledar

Date: Wed Sep 16 2026 - 05:40:19 EST


Hi, Jonathan and Jean-Baptiste,

On Mon, 2026-09-07 at 11:52 +0000, Jean-Baptiste Maneyrol wrote:
> [Some people who received this message don't often get email from
> jean-baptiste.maneyrol@xxxxxxx. Learn why this is important at
> https://aka.ms/LearnAboutSenderIdentification ;]
>
> > The device supports indirect register access to different banks. A
> > specific routine needs to be followed when accessing the registers
> > in
> > another bank as documented in the datasheet (section 13). This is
> > required for accessing registers configured via the user and
> > implementing buffer support.
> >
> > Datasheet:
> > https://www.invensense.tdk.com/en-us/products/3-axis/icm-42370-p
> > Datasheet:
> > https://urldefense.com/v3/__https://www.lcsc.com/product-detail/C5129967.html__;!!FtrhtPsWDhZ6tw!CMTPpmwpQnn9q5feyPtbKfDlZZxlAh6FLT3KngBIAt4pGu5iF9cjUawWbxpNVF6__BzwZo0XM8x2ABrLJ4I1epLGPQXws4rTlA$[lcsc[.]com]
> > Assisted-by: LLM
> > Signed-off-by: Kanak Shilledar <kanak.shilledar@xxxxxxxx>
> > ---
> > LLM was used to improve the mreg_check function to include the case
> > where the sensor is in a POWER OFF or LOW POWER mode to utilize the
> > RC
> > oscillator for initiating the bank access.
> > ---
> > drivers/iio/imu/inv_icm42607/inv_icm42607.h      |  29 ++++++
> > drivers/iio/imu/inv_icm42607/inv_icm42607_core.c | 108
> > ++++++++++++++++++++++-
> > 2 files changed, 135 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/imu/inv_icm42607/inv_icm42607.h
> > b/drivers/iio/imu/inv_icm42607/inv_icm42607.h
> > index a183a8566617..a522850e0268 100644
> > --- a/drivers/iio/imu/inv_icm42607/inv_icm42607.h
> >
[...]
>
> Hello Kanak,
>
> for accessing MREG registers I strongly recommend to create a new
> regmap
> structure for handling this access. This way, you can use the created
> regmap
> to handle all registers access without having to check each time you
> access
> a register if it is a normal or an MREG register. Having dedicated
> function
> is very error prone.
>
> You can have a look inside inv_icm45600 driver that have the same
> kind of MREG
> registers and is using a regmap for abstracting the access.
>
> Thanks,
> JB

I will rewrite this bank access patch to match it similar to how it is
done in the inv_icm45600 driver.

Thanks and Regards,
Kanak Shilledar

Attachment: signature.asc
Description: This is a digitally signed message part