[PATCH v7 0/5] iio: add Open Sensor Fusion IIO driver

From: Jinseob Kim

Date: Mon Jul 06 2026 - 21:46:04 EST


This series adds a Linux IIO driver for Open Sensor Fusion devices
exposed over a UART/serdev host interface. The driver parses OSF frames
and creates IIO devices at runtime from capability reports. Expected IIO
devices are accel, gyro, magnetometer, and temperature when those
capabilities are reported.

The binding, supported protocol subset, runtime discovery model, and
driver-facing ABI remain review-relevant, but this revision drops the RFC
tag because there are no specific open questions being asked in the cover
letter.

v7 was prepared after auditing earlier review comments and either
addressing them in code/docs or answering them on-list.

Previous versions:

v1:
https://lore.kernel.org/r/20260520072843.3593-1-kimjinseob88@xxxxxxxxx

v2:
https://lore.kernel.org/r/20260524085312.15369-1-kimjinseob88@xxxxxxxxx

v3:
https://lore.kernel.org/r/20260529121005.1470-1-kimjinseob88@xxxxxxxxx

v4:
https://lore.kernel.org/r/20260607234343.22109-1-kimjinseob88@xxxxxxxxx

v5:
https://lore.kernel.org/r/20260616072242.3942-1-kimjinseob88@xxxxxxxxx

v6:
https://lore.kernel.org/r/20260628191337.937-1-kimjinseob88@xxxxxxxxx

Changes in v7:
- Dropped the RFC tag; no specific open questions remain in the cover
letter.
- Added previous-version lore links.
- Removed the confusing compatible/OSF GREEN/OSF0 explanatory sentence
from the binding.
- Removed "initial" wording from the IIO documentation.
- Reused the common OSF_FRAME_MAGIC definition in the stream parser.
- Fixed OSF_FRAME_MAGIC comment wording.
- Removed dead overflow checks for u16 protocol counts.
- Removed the unused partial_frames statistic.
- Fixed remaining loop-local variable issues.
- Reworked the stream/core contract so CRC-valid/authenticated frames are
consumed as full frames even when ignored or rejected at application
level.
- Preserved one-byte resync only for unauthenticated/framing failures.
- Preserved IIO buffer synchronization and zeroed scan storage.
- Removed the duplicate IIO dependency from the OSF Kconfig entry.

Validation:
- git diff --check: pass.
- checkpatch --strict: pass, 0 errors, 0 warnings, 0 checks.
- dt_binding_check: pass with dtschema 2026.4.
- GCC W=1 module build: pass, no OSF compiler warnings.
- clang W=1 module build with LLVM=1 external build: pass, no OSF
compiler warnings.
- local stream parser semantic tests: pass, including CRC-valid bad
protocol_major and nonzero reserved frames with embedded OSF frames.
- static IIO scan layout/padding checks: pass.

Jinseob Kim (5):
dt-bindings: iio: add Open Sensor Fusion device
Documentation: iio: add Open Sensor Fusion driver overview
iio: osf: add protocol decoding
iio: osf: add authenticated stream parser
iio: osf: add UART IIO driver

.../bindings/iio/opensensorfusion,osf.yaml | 52 +++
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
Documentation/iio/index.rst | 1 +
Documentation/iio/open-sensor-fusion.rst | 72 ++++
MAINTAINERS | 14 +
drivers/iio/Kconfig | 1 +
drivers/iio/Makefile | 1 +
drivers/iio/opensensorfusion/Kconfig | 15 +
drivers/iio/opensensorfusion/Makefile | 6 +
drivers/iio/opensensorfusion/osf_core.c | 320 ++++++++++++++++++
drivers/iio/opensensorfusion/osf_core.h | 70 ++++
drivers/iio/opensensorfusion/osf_iio.c | 308 +++++++++++++++++
drivers/iio/opensensorfusion/osf_iio.h | 22 ++
drivers/iio/opensensorfusion/osf_protocol.c | 242 +++++++++++++
drivers/iio/opensensorfusion/osf_protocol.h | 100 ++++++
drivers/iio/opensensorfusion/osf_serdev.c | 114 +++++++
drivers/iio/opensensorfusion/osf_stream.c | 189 +++++++++++
drivers/iio/opensensorfusion/osf_stream.h | 30 ++
18 files changed, 1559 insertions(+)


base-commit: ab5fce87a778cb780a05984a2ca448f2b41aafbf
--
2.43.0