mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] iio: imu: Add support for QST QMI8658C
@ 2026-12-04  8:55 NanamiKite
  2026-12-04  9:47 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: NanamiKite @ 2026-12-04  8:55 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, devicetree, linux-kernel, NanamiKite

This series adds a DT binding and an initial I2C driver for the QST
QMI8658C 6-axis IMU (3-axis accelerometer, 3-axis gyroscope, and
temperature sensor).

Right now it only covers direct sysfs reads, scale/ODR settings,
mount-matrix, and vdd/vddio supplies. Triggers, FIFO, interrupts, and
runtime PM can come later once the basic layout looks reasonable.

A few things I'd like feedback on:

- Keeping both accel and gyro enabled for now: the chip uses different
  ODR tables for the same aODR register values depending on whether the
  gyro is on or off. Leaving it in 6DOF mode keeps the ODR table simple
  for an initial driver, or would you rather see separate modes from
  the start?
- Regulator startup delay: the datasheet lists t0 = 150 ms from power
  up. Should probe() sleep after enabling supplies before reading
  WHO_AM_I, in case a board actually switches them off?
- Chip IDs: my QMI8658C module returns WHO_AM_I = 0x05 and
  REVISION_ID = 0x7b (rev 0.9 datasheet says 0x79). The driver warns on
  an unexpected WHO_AM_I rather than failing probe, and only logs
  REVISION_ID at dbg level.

Compile-tested against linux-next (next-20261203) with W=1 C=1 and
dt_binding_check (dtschema 2026.9), and tested on a Raspberry Pi 4B
(i2c1, 0x6b) running 6.1.21-v8+ with a small local build shim for
cleanup.h/array_size.h/.probe_new (driver source itself is untouched).
Accel readings give ~9.64 m/s^2 at rest, switching +/-2g to +/-4g halves
the raw values as expected, temp reads ~19.2 C, and 3 unbind/bind cycles
come back clean (which caught that SensorDisable needs to be cleared
before writing RESET, otherwise the reset fires late and wipes CTRL1
back to 0x20).

NanamiKite (2):
  dt-bindings: iio: imu: Add QST QMI8658C
  iio: imu: Add driver for QST QMI8658C

 .../bindings/iio/imu/qstcorp,qmi8658c.yaml    |  71 ++
 MAINTAINERS                                   |   7 +
 drivers/iio/imu/Kconfig                       |  12 +
 drivers/iio/imu/Makefile                      |   2 +
 drivers/iio/imu/qmi8658.c                     | 622 ++++++++++++++++++
 5 files changed, 714 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/imu/qstcorp,qmi8658c.yaml
 create mode 100644 drivers/iio/imu/qmi8658.c

-- 
2.56.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH v1 0/2] iio: imu: Add support for QST QMI8658C
  2026-12-04  8:55 [RFC PATCH v1 0/2] iio: imu: Add support for QST QMI8658C NanamiKite
@ 2026-12-04  9:47 ` Andy Shevchenko
  2026-12-04 10:59   ` NanamiKite
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-12-04  9:47 UTC (permalink / raw)
  To: NanamiKite
  Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, devicetree, linux-kernel

On Fri, Dec 04, 2026 at 04:55:02PM +0800, NanamiKite wrote:
> This series adds a DT binding and an initial I2C driver for the QST
> QMI8658C 6-axis IMU (3-axis accelerometer, 3-axis gyroscope, and
> temperature sensor).
> 
> Right now it only covers direct sysfs reads, scale/ODR settings,
> mount-matrix, and vdd/vddio supplies. Triggers, FIFO, interrupts, and
> runtime PM can come later once the basic layout looks reasonable.
> 
> A few things I'd like feedback on:

First of all, please setup the email and patch sending on your side.
The three patches were sent as three different emails! No, we want
a single email thread (for example, --thread to `git format-patch` makes
this happen).

> - Keeping both accel and gyro enabled for now: the chip uses different
>   ODR tables for the same aODR register values depending on whether the
>   gyro is on or off. Leaving it in 6DOF mode keeps the ODR table simple
>   for an initial driver, or would you rather see separate modes from
>   the start?
> - Regulator startup delay: the datasheet lists t0 = 150 ms from power
>   up. Should probe() sleep after enabling supplies before reading
>   WHO_AM_I, in case a board actually switches them off?
> - Chip IDs: my QMI8658C module returns WHO_AM_I = 0x05 and
>   REVISION_ID = 0x7b (rev 0.9 datasheet says 0x79). The driver warns on
>   an unexpected WHO_AM_I rather than failing probe, and only logs
>   REVISION_ID at dbg level.

Why a brand new driver? You should research existing ones and if there are some
close enough explain, why they are not suitable to host this HW.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH v1 0/2] iio: imu: Add support for QST QMI8658C
  2026-12-04  9:47 ` Andy Shevchenko
@ 2026-12-04 10:59   ` NanamiKite
  0 siblings, 0 replies; 3+ messages in thread
From: NanamiKite @ 2026-12-04 10:59 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, devicetree, linux-kernel

Hi Andy,

On Fri, 04 Dec 2026 11:47:58 +0200, Andy Shevchenko wrote:
> First of all, please setup the email and patch sending on your side.
> The three patches were sent as three different emails! No, we want
> a single email thread (for example, --thread to `git format-patch` makes
> this happen).

Sorry about the broken threading. I did pass --thread, but smtp.qq.com
silently rewrites outgoing Message-ID headers, breaking the In-Reply-To
links between patches. I'll switch to b4's web relay before sending v2.

> Why a brand new driver? You should research existing ones and if there are some
> close enough explain, why they are not suitable to host this HW.

I checked the existing drivers under drivers/iio/imu/ (Bosch bmi*/smi*/bno055,
InvenSense inv_icm*/inv_mpu6050, ST st_lsm*, ADI adis*, NXP fxos8700,
Kionix kmx61) as well as the existing QST magnetometer drivers (qmc5883l,
qmc6308). The QMI8658C uses the QST/FIS2108 register layout (WHO_AM_I at
0x00 = 0x05, CTRL1..CTRL9 at 0x02..0x0a, contiguous output data at
0x33..0x40, soft reset 0xb0 to 0x60, and coupled 6DOF/accel-only ODR
tables), which doesn't match any existing driver in the tree.

As for the use case, the QMI8658C is common on low-cost embedded and
wearable hardware, and I'm also using it externally for orientation
sensing on my 2-in-1 tablet keyboard cover.

I'll include this rationale in the cover letter and commit message for v2.

Thanks,
NanamiKite


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04  8:55 [RFC PATCH v1 0/2] iio: imu: Add support for QST QMI8658C NanamiKite
2026-12-04  9:47 ` Andy Shevchenko
2026-12-04 10:59   ` NanamiKite

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®