From: Kanak Shilledar <kanak.shilledar@axis.com>
To: "Henrik Grimler" <henrik.grimler@axis.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"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>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Joshua Crofts" <joshua.crofts1@gmail.com>,
"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
"Chris Morgan" <macromorgan@hotmail.com>
Cc: Kanak Shilledar <kanak.shilledar@axis.com>, <kernel@axis.com>,
<linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v3 0/8] Add support for InvenSense ICM-42370-P accelerometer
Date: Tue, 1 Sep 2026 16:35:53 +0200 [thread overview]
Message-ID: <20260901-b4-inv_icm42370p-v3-0-77cc31642115@axis.com> (raw)
InvenSense ICM42370P is a high performance MEMS MotionTracking 3-axis
accelerometer. It supports I2C, I3C and SPI protocols. It has a 2.25kB
FIFO and two programmable interrupts with support for ultra-low-power
wake-on-motion support. It has a built-in temperature sensor. This
patch series adds basic support for the sensor with functionality of
performing raw reads and writes via the I2C interface.
This device contains 4 register banks for configuring the device called
MREG0, MREG1, MREG2 and MREG3. Unlike other devices from the same
vendor, this contains a very different way of accessing the register
banks apart from the default user bank 0 (MREG0). The register bank access
procedure is mentioned in the datasheet Section 13. This is very
similar to the existing InvenSense, ICM-42607-P driver. Thus, it
improves the existing driver support and adds the ICM-42370-P device to
it.
While adding the support for new device, I tried to perform some fixes
to the existing driver which were pointed out in the v2 of this patch
series.
The buffer support will be added in another patch series.
Note: The datasheet for InvenSense, ICM-42607-P could not be found on the
official https://www.invensense.tdk.com/en-us website. Thus, I am
using the datasheet available at https://www.lcsc.com.
Question to the reviewers:
* There is no entry for drivers/iio/imu/inv_icm42607 in the MAINTAINERS
file, should a new MAINTAINERS entry be created for the inv_icm42607
driver with the original author as the maintainer? Currently
`get_maintainers.pl` is able to add the original author to the
recipients list, but `b4 prep --auto-to-cc` is not able to add.
* As per the comments in v2 from @Jonathan regarding splitting the
driver into multiple files, should we still have the driver as
multiple files or should it be merged into a single file?
* As per the comments in v2 regarding the formatting of
headerfile with the positioning of macros, enums and function
prototypes, as well as indentation of in the register values, also the
all the enum values are numbered which seems unnecessary, should these
be implemented here as well?
Datasheet: https://www.invensense.tdk.com/en-us/products/3-axis/icm-42370-p
Datasheet: https://www.lcsc.com/product-detail/C5129967.html
Signed-off-by: Kanak Shilledar <kanak.shilledar@axis.com>
---
Changes in v3:
- Updated the cover letter to match the implementation.
- Add SPI properties to dt-bindings and fix typo (leave out I3C for now).
- Move the implementation to inv_icm42607 driver as both are similar
devices.
- Fix formatting of the drivers based on the comments received in v2.
- Switch endianness of the driver.
- Update mreg checking to perform bank access even if the device is in
OFF or LOW POWER state.
- Implement mreg read writes and calibbias support for inv_icm42607
driver.
- Drop buffer and interrupt handling implementation for next patch series.
- Link to v2: https://patch.msgid.link/20260813-b4-inv_icm42370p-v2-0-11aedfdf76d3@axis.com
Changes in v2:
* Changes across all files
- Update MAINTAINERS with company mailing list
- Sort/Cleanup of includes
- Use `guard(mutex)` and newer `pm_runtime` APIs
- Fix code formatting and add empty lines
- Be consistent in inv_icm42370_data variable name
- Fix MODULE_DESCRIPTION
- Drop secondary state struct and merge it's properties in
`inv_icm42370_data` struct
- Update mreg_read/write function calls
- Change the compatible and filename to `icm42370p`
* Changes to dt-binding
- Add dependencies property
- Made vdd and vddio supply as required
- Add description to drive-open-drain property
- Add mount-matrix property
- Add interrupt-names property
* Changes to `inv_icm42370.h` and `inv_icm42370_buffer.h`:
- Resturcture the file according to @Marcelo's advice
- Move struct __aligned properties to the end
* Changes to `inv_icm42370_core.c`:
- Fix _accel_scale[] values
- Add IIO_TIMESTAMP to channel spec
- Update mreg_read/write to fix bank access
- Replace usleep_range() with fsleep()
- Use constants from linux/units.h
- Call `_update_fifo_period()` after updating the ODR values
- Fix mathematical error in offset calculation
- Implement handling of mount matrix
- Implement handling of named interrupts
- Use devm_regulator_get_enable for the vdd/vddio regulators
- Use better error handling
- Move iio device registration after performing IRQ init
* Changes to `inv_icm42370_i2c.c`
- Change compatible string as per the binding
- Use named identifiers
- Add `id_table` to the i2c_driver struct
* Changes to `inv_icm42370_buffer.c`
- Update FIFO enable/disable logic
- Update FIFO buffer to match the specification and handle increased
size dynamically.
- Link to v1: https://patch.msgid.link/20260806-b4-inv_icm42370p-v1-0-670837f5842f@axis.com
To: Kanak Shilledar <kanak.shilledar@axis.com>
To: Henrik Grimler <henrik.grimler@axis.com>
To: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
To: Nuno Sá <nuno.sa@analog.com>
To: Andy Shevchenko <andy@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: Chris Morgan <macromorgan@hotmail.com>
Cc: kernel@axis.com
Cc: linux-iio@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Kanak Shilledar (8):
dt-bindings: Add InvenSense ICM-42370-p accelerometer
iio: imu: inv_icm42607: Update IIO channel macros
iio: imu: inv_icm42607: Update _odr_to_period_us formatting
iio: imu: inv_icm42607: Switch to little endian
iio: imu: inv_icm42607: Add support for ICM-42370-P
iio: imu: inv_icm42607: Implement MREGx register access
iio: imu: inv_icm42607: Add accelerometer calibbias support
iio: imu: inv_icm42607: Add gyroscope calibbias support
.../bindings/iio/accel/invensense,icm42370p.yaml | 87 +++++++
MAINTAINERS | 7 +
drivers/iio/imu/inv_icm42607/inv_icm42607.h | 51 +++-
drivers/iio/imu/inv_icm42607/inv_icm42607_accel.c | 263 +++++++++++++++++++--
drivers/iio/imu/inv_icm42607/inv_icm42607_core.c | 203 +++++++++++++---
drivers/iio/imu/inv_icm42607/inv_icm42607_gyro.c | 258 ++++++++++++++++++--
drivers/iio/imu/inv_icm42607/inv_icm42607_i2c.c | 8 +
drivers/iio/imu/inv_icm42607/inv_icm42607_temp.c | 2 +-
drivers/iio/imu/inv_icm42607/inv_icm42607_temp.h | 2 +-
9 files changed, 801 insertions(+), 80 deletions(-)
---
base-commit: 26bdafb3bdf58436579a1f6f0ef1ddb9011015ea
change-id: 20260629-b4-inv_icm42370p-ccd671066bcf
Best regards,
--
Kanak Shilledar <kanak.shilledar@axis.com>
next reply other threads:[~2026-09-01 14:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 14:35 Kanak Shilledar [this message]
2026-09-01 14:35 ` [PATCH v3 1/8] dt-bindings: Add InvenSense ICM-42370-p accelerometer Kanak Shilledar
2026-09-01 14:42 ` sashiko-bot
2026-09-01 14:35 ` [PATCH v3 2/8] iio: imu: inv_icm42607: Update IIO channel macros Kanak Shilledar
2026-09-01 14:35 ` [PATCH v3 3/8] iio: imu: inv_icm42607: Update _odr_to_period_us formatting Kanak Shilledar
2026-09-01 14:35 ` [PATCH v3 4/8] iio: imu: inv_icm42607: Switch to little endian Kanak Shilledar
2026-09-01 14:35 ` [PATCH v3 5/8] iio: imu: inv_icm42607: Add support for ICM-42370-P Kanak Shilledar
2026-09-01 14:35 ` [PATCH v3 6/8] iio: imu: inv_icm42607: Implement MREGx register access Kanak Shilledar
2026-09-01 14:47 ` sashiko-bot
2026-09-01 14:36 ` [PATCH v3 7/8] iio: imu: inv_icm42607: Add accelerometer calibbias support Kanak Shilledar
2026-09-01 14:49 ` sashiko-bot
2026-09-01 14:36 ` [PATCH v3 8/8] iio: imu: inv_icm42607: Add gyroscope " Kanak Shilledar
2026-09-02 5:30 ` [PATCH v3 0/8] Add support for InvenSense ICM-42370-P accelerometer Andy Shevchenko
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=20260901-b4-inv_icm42370p-v3-0-77cc31642115@axis.com \
--to=kanak.shilledar@axis.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=henrik.grimler@axis.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=joshua.crofts1@gmail.com \
--cc=kernel@axis.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macromorgan@hotmail.com \
--cc=marcelo.schmitt1@gmail.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