mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe LeVeque <joe.l@reflexrobotics.com>
To: jean-baptiste.maneyrol@tdk.com, jic23@kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joe LeVeque <joe.l@reflexrobotics.com>
Subject: [PATCH 0/2] iio: imu: inv_icm42600: keep the temperature sensor always on
Date: Thu, 19 Nov 2026 18:08:48 -0800	[thread overview]
Message-ID: <20261120020850.24318-1-joe.l@reflexrobotics.com> (raw)

On an ICM-42688-P, the gyro shows a large, stable offset at rest (about
8 to 23 dps) whenever the driver has the temperature sensor disabled
(PWR_MGMT0.TEMP_DIS): without it, gyro data is not temperature
compensated internally. As discussed with Jean-Baptiste and Jonathan,
this series keeps the temperature sensor always on and removes the
driver's temperature enable/disable handling; temperature reporting in
the FIFO stays switchable.

The chip only measures temperature while the accel or gyro is on; with
both off, its data register keeps the last measurement. Patch 1 makes a
temperature read return -EBUSY in that case instead of stale data, so
that patch 2 can remove the enable/disable handling without changing
what a direct temperature read reports.

Discussion:
https://lore.kernel.org/linux-iio/20261118232418.7fc702a8@jic23-hlaptop/T/#t

Tested on an ICM-42688-P (SPI) on an i.MX8M Plus board: on 6.18 with
these patches backported to the 6.18 driver (minor context adjustments,
built as an external module), and on 6.6 with the driver backported
from mainline:
- gyro correct from the first reads after boot and after runtime
  suspend; accel unchanged
- idle temperature read returns -EBUSY; current values whenever accel or
  gyro is on
- PWR_MGMT0.TEMP_DIS never set (regmap debugfs)
- buffered capture of gyro and accel, separately and concurrently
  (including stopping one while the other runs), with and without the
  temperature channel, and temperature-only: correct data at 50 Hz
- repeated buffer enable/disable; module reload
Build-tested on the IIO togreg branch.

I kept the INV_ICM42600_PWR_MGMT0_TEMP_DIS definition in inv_icm42600.h,
now unused, to document the register bit; happy to drop it if you
prefer.

Joe LeVeque (2):
  iio: imu: inv_icm42600: return -EBUSY for temperature reads when idle
  iio: imu: inv_icm42600: remove temperature sensor enable/disable

 drivers/iio/imu/inv_icm42600/inv_icm42600.h   |  6 ---
 .../iio/imu/inv_icm42600/inv_icm42600_accel.c | 16 ++------
 .../imu/inv_icm42600/inv_icm42600_buffer.c    | 14 ++-----
 .../iio/imu/inv_icm42600/inv_icm42600_core.c  | 37 ++++---------------
 .../iio/imu/inv_icm42600/inv_icm42600_gyro.c  | 16 ++------
 .../iio/imu/inv_icm42600/inv_icm42600_temp.c  | 10 ++++-
 6 files changed, 26 insertions(+), 73 deletions(-)

-- 
2.34.1


             reply	other threads:[~2026-11-20  2:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  2:08 Joe LeVeque [this message]
2026-11-20  2:08 ` [PATCH 1/2] iio: imu: inv_icm42600: return -EBUSY for temperature reads when idle Joe LeVeque
2026-11-20  2:08 ` [PATCH 2/2] iio: imu: inv_icm42600: remove temperature sensor enable/disable Joe LeVeque

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=20261120020850.24318-1-joe.l@reflexrobotics.com \
    --to=joe.l@reflexrobotics.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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

all inboxes | Powered by JetHome®