Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: magnetometer: add support for QST QMC6308
@ 2026-07-14 20:28 Jorijn van der Graaf
  2026-07-14 20:28 ` [PATCH 1/2] dt-bindings: iio: magnetometer: add " Jorijn van der Graaf
  2026-07-14 20:28 ` [PATCH 2/2] iio: magnetometer: add support for " Jorijn van der Graaf
  0 siblings, 2 replies; 5+ messages in thread
From: Jorijn van der Graaf @ 2026-07-14 20:28 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jorijn van der Graaf, David Lechner, Nuno Sá,
	Andy Shevchenko, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Siratul Islam, Luca Weiss, linux-iio, devicetree, linux-kernel

This adds a driver and DT binding for the QST QMC6308, a 3-axis AMR
magnetometer found e.g. in the Fairphone 6. The series is based on
iio/togreg.

The chip is a sibling of the recently added QMC5883L but is not
register compatible with it (different chip ID register and value,
data output at 0x01..0x06, and the range field lives in control
register 2), so this is a separate driver; its structure intentionally
follows qmc5883l.c. The QMC6308's 4-pin WLCSP has no DRDY/interrupt
pin at all, so there is nothing to hang a trigger off; reads are
polled from the chip's periodic measurement mode (its one-shot mode
has no specified conversion time to bound a wait on), with runtime PM
dropping the chip into its 2-3 uA suspend mode between uses. A
software-triggered buffer mode could be added later without breaking
the ABI.

Tested on a Fairphone 6, where the sensor sits on a bit-banged
i2c-gpio bus, using a byte-identical backport on that device's
7.1-based kernel; on this base the driver is build- and modpost-
verified (arm64 defconfig, W=1 clean). Testing covered the chip ID
probe, raw reads, every ODR (10/50/100/200 Hz), oversampling ratio
(8/4/2/1) and scale setting (the same ambient field reads consistently
across all four ranges), the mount matrix validated against Earth's
field by pointing the device at the cardinal directions, and runtime
PM verified at the bus level (the mode register reads back as suspend
after the autosuspend delay, wakes on read, and accepts configuration
writes while suspended). The FP6 board DTS will be submitted
separately through the qcom tree once this lands.

Jorijn van der Graaf (2):
  dt-bindings: iio: magnetometer: add QST QMC6308
  iio: magnetometer: add support for QST QMC6308

 .../iio/magnetometer/qstcorp,qmc6308.yaml     |  48 ++
 MAINTAINERS                                   |   7 +
 drivers/iio/magnetometer/Kconfig              |  11 +
 drivers/iio/magnetometer/Makefile             |   1 +
 drivers/iio/magnetometer/qmc6308.c            | 590 ++++++++++++++++++
 5 files changed, 657 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/qstcorp,qmc6308.yaml
 create mode 100644 drivers/iio/magnetometer/qmc6308.c


base-commit: 2e2f2de7532cbbc2269de8be20ec709606c6e79b
-- 
2.55.0


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

end of thread, other threads:[~2026-07-14 21:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 20:28 [PATCH 0/2] iio: magnetometer: add support for QST QMC6308 Jorijn van der Graaf
2026-07-14 20:28 ` [PATCH 1/2] dt-bindings: iio: magnetometer: add " Jorijn van der Graaf
2026-07-14 20:28 ` [PATCH 2/2] iio: magnetometer: add support for " Jorijn van der Graaf
2026-07-14 20:38   ` sashiko-bot
2026-07-14 21:21   ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox