Devicetree
 help / color / mirror / Atom feed
* [PATCH v8 0/5] iio: add Open Sensor Fusion IIO driver
@ 2026-08-20  5:06 Jinseob Kim
  2026-08-20  5:06 ` [PATCH v8 1/5] dt-bindings: iio: add Open Sensor Fusion device Jinseob Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jinseob Kim @ 2026-08-20  5:06 UTC (permalink / raw)
  To: jic23, linux-iio
  Cc: dlechner, nuno.sa, andy, linux-kernel, rdunlap, joshua.crofts1,
	u.kleine-koenig, julianbraha, robh, krzk+dt, conor+dt, grondon,
	devicetree, corbet, skhan, linux-doc

Open Sensor Fusion (OSF) is a physical sensor board that reports
measurements over UART.  Add a serdev driver using the generic
"opensensorfusion,osf" compatible.

The compatible is intentionally independent of a board model or firmware
revision.  A fixed wire header carries the protocol version, while a
capability report discovers the available sensors and channels at runtime.
Supported capabilities are exposed as four IIO devices: accelerometer,
gyroscope, magnetometer, and temperature.

Changes since v7:

  - Separate wire decoding from support policy.  Validate the protocol
    major and reserved header bytes after frame authentication, and ignore
    unsupported capability entries without discarding supported entries.
  - Harden resynchronization: unauthenticated candidates discard one head
    byte, while authenticated frames consume the complete frame for every
    handled, ignored, or rejected outcome.
  - Retain split one-, two-, and three-byte magic prefixes across UART
    callbacks, and use an opaque callback so the stream parser does not
    depend on the driver added by patch 5.
  - Zero-initialize explicitly aligned IIO scans, use
    iio_push_to_buffers_with_ts(), and simplify the buffered fast path and
    one-axis versus three-axis handling.
  - Commit a sensor sample to the direct-read cache only after the
    registered IIO channel and buffer path accepts it.  A rejected
    CRC-valid sample therefore cannot change direct RAW state or the last
    accepted sequence.
  - Add focused KUnit coverage for accepted, ignored, rejected, and
    malformed sample paths and protection against invalid-sample cache-slot
    exhaustion.  Run the same suite against pre-fix ordering as a negative
    control.
  - Consolidate MAINTAINERS coverage under
    F: drivers/iio/opensensorfusion/.

Static and build validation completed for the corrected source includes
git diff --check, scripts/checkpatch.pl --strict with no errors or warnings
on all five patches, four passing focused KUnit cases, the expected two
failures when the same tests are run against the pre-fix core, the targeted
DT binding check with dtschema 2026.6, the IIO documentation build with no
OSF-specific warnings, clean W=1 GCC and Clang module builds, per-patch
build checks, and clean-base application with an identical final tree.

Pre-audit v8 hardware validation used a Raspberry Pi 4 over UART with a
physical OSF board.  It covered serdev probe and bind, capability
discovery, direct raw reads, a 66.5-second simultaneous buffered capture of all four IIO
devices, and unload and reload.  The capture delivered 919 accelerometer
samples and 918 samples from each of the gyroscope, magnetometer, and
temperature devices, without a kernel warning, OOPS, or IIO overrun.

A focused post-audit Raspberry Pi regression then exercised the corrected
ARM64 module in a one-shot tryboot without installing it or changing boot
artifacts.  Both the first load and reload registered four IIO devices and
passed direct raw reads.  A 12.0005-second simultaneous buffered capture
delivered 165 accelerometer, 165 gyroscope, 166 magnetometer, and 166
temperature records, with no read errors, timestamp regressions, or
critical dmesg findings.  Unload, reload, and final cleanup passed, and one
normal reboot restored the stock kernel with the OSF module and devices
absent.

A validation-only debug build from the pre-audit v8 development source was
used solely to observe internal parser and DEVICE_STATUS counters.
All parser error counters stayed at zero, and all 94 DEVICE_STATUS reports had a zero
dropped-frame count.  The submitted source exposes no debug counter ABI.

This series is based on the IIO testing branch at
a9fa85254feee2b52b2bb4fbb4920ece47dfd6f8.

Previous revisions:

v1: https://lore.kernel.org/r/20260520072843.3593-1-kimjinseob88@gmail.com
v2: https://lore.kernel.org/r/20260524085312.15369-1-kimjinseob88@gmail.com
v3: https://lore.kernel.org/r/20260529121005.1470-1-kimjinseob88@gmail.com
v4: https://lore.kernel.org/r/20260607234343.22109-1-kimjinseob88@gmail.com
v5: https://lore.kernel.org/r/20260616072242.3942-1-kimjinseob88@gmail.com
v6: https://lore.kernel.org/r/20260628191337.937-1-kimjinseob88@gmail.com
v7: https://lore.kernel.org/r/20260707014525.1015-1-kimjinseob88@gmail.com

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                                   |   8 +
 drivers/iio/Kconfig                           |   1 +
 drivers/iio/Makefile                          |   1 +
 drivers/iio/opensensorfusion/Kconfig          |  27 +
 drivers/iio/opensensorfusion/Makefile         |   7 +
 drivers/iio/opensensorfusion/osf_core.c       | 393 ++++++++++++++
 drivers/iio/opensensorfusion/osf_core.h       |  70 +++
 drivers/iio/opensensorfusion/osf_core_test.c  | 493 ++++++++++++++++++
 drivers/iio/opensensorfusion/osf_iio.c        | 304 +++++++++++
 drivers/iio/opensensorfusion/osf_iio.h        |  22 +
 drivers/iio/opensensorfusion/osf_protocol.c   | 224 ++++++++
 drivers/iio/opensensorfusion/osf_protocol.h   | 101 ++++
 drivers/iio/opensensorfusion/osf_serdev.c     | 124 +++++
 drivers/iio/opensensorfusion/osf_stream.c     | 231 ++++++++
 drivers/iio/opensensorfusion/osf_stream.h     |  53 ++
 19 files changed, 2186 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/opensensorfusion,osf.yaml
 create mode 100644 Documentation/iio/open-sensor-fusion.rst
 create mode 100644 drivers/iio/opensensorfusion/Kconfig
 create mode 100644 drivers/iio/opensensorfusion/Makefile
 create mode 100644 drivers/iio/opensensorfusion/osf_core.c
 create mode 100644 drivers/iio/opensensorfusion/osf_core.h
 create mode 100644 drivers/iio/opensensorfusion/osf_core_test.c
 create mode 100644 drivers/iio/opensensorfusion/osf_iio.c
 create mode 100644 drivers/iio/opensensorfusion/osf_iio.h
 create mode 100644 drivers/iio/opensensorfusion/osf_protocol.c
 create mode 100644 drivers/iio/opensensorfusion/osf_protocol.h
 create mode 100644 drivers/iio/opensensorfusion/osf_serdev.c
 create mode 100644 drivers/iio/opensensorfusion/osf_stream.c
 create mode 100644 drivers/iio/opensensorfusion/osf_stream.h

-- 
2.43.0


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

end of thread, other threads:[~2026-08-20  5:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  5:06 [PATCH v8 0/5] iio: add Open Sensor Fusion IIO driver Jinseob Kim
2026-08-20  5:06 ` [PATCH v8 1/5] dt-bindings: iio: add Open Sensor Fusion device Jinseob Kim
2026-08-20  5:06 ` [PATCH v8 2/5] Documentation: iio: add Open Sensor Fusion driver overview Jinseob Kim
2026-08-20  5:06 ` [PATCH v8 3/5] iio: osf: add protocol decoding Jinseob Kim
2026-08-20  5:06 ` [PATCH v8 4/5] iio: osf: add authenticated stream parser Jinseob Kim
2026-08-20  5:06 ` [PATCH v8 5/5] iio: osf: add UART IIO driver Jinseob Kim
2026-08-20  5:27   ` sashiko-bot

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