[PATCH v2 0/2] iio: magnetometer: add support for QST QMC6308
From: Jorijn van der Graaf
Date: Tue Jul 21 2026 - 09:50:12 EST
This adds a driver and DT binding for the QST QMC6308, a 3-axis
anisotropic magnetoresistive (AMR) magnetometer found e.g. in the
Fairphone 6. The series is based on iio/togreg.
The chip is a sibling of the QMC5883L but is not register compatible
with it, so this is a separate driver; its structure intentionally
follows qmc5883l.c. Reads are polled from the chip's periodic
measurement mode, with runtime PM dropping the chip into its suspend
mode between uses.
The binding stays a separate file rather than being folded into
qstcorp,qmc5883l.yaml: as discussed with Siratul in the v1 thread, the
two schemas share only compatible/reg/vdd-supply, and Jonathan leaned
towards keeping the files separate given that small overlap. If the DT
maintainers prefer the combined shape I'm happy to rework it that way.
Adding mount-matrix to qstcorp,qmc5883l.yaml, also raised in that
discussion, is a natural follow-up patch either way.
Tested on a Fairphone 6 (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-verified (arm64, W=1 clean). v2 testing
re-covered raw reads, every ODR/oversampling/scale setting (the same
ambient field reads consistently across all four ranges), the
stale-sample discard on range changes, and runtime PM, including that
the chip autosuspends after probe without the v1 usage-counter
dance and that configuration writes land while suspended. The FP6
board DTS will be submitted separately through the qcom tree once
this lands.
Per-patch changelogs are in the individual patches.
v1: https://lore.kernel.org/20260714202842.340293-1-jorijnvdgraaf@xxxxxxxxxxxxx
Jorijn van der Graaf (2):
dt-bindings: iio: magnetometer: add QST QMC6308
iio: magnetometer: add support for QST QMC6308
.../iio/magnetometer/qstcorp,qmc6308.yaml | 47 ++
MAINTAINERS | 7 +
drivers/iio/magnetometer/Kconfig | 11 +
drivers/iio/magnetometer/Makefile | 1 +
drivers/iio/magnetometer/qmc6308.c | 602 ++++++++++++++++++
5 files changed, 668 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/qstcorp,qmc6308.yaml
create mode 100644 drivers/iio/magnetometer/qmc6308.c
base-commit: 036d96ceec6d966339aea34d034420991e24cfac
--
2.55.0