[PATCH RFC 0/3] iio: add Open Sensor Fusion UART driver

Jinseob Kim posted 3 patches 4 days, 16 hours ago
There is a newer version of this series
.../iio/imu/opensensorfusion,osf-uart.yaml    |  33 ++
MAINTAINERS                                   |   7 +
drivers/iio/Kconfig                           |   1 +
drivers/iio/Makefile                          |   1 +
drivers/iio/opensensorfusion/Kconfig          |  15 +
drivers/iio/opensensorfusion/Makefile         |   6 +
drivers/iio/opensensorfusion/osf_core.c       | 334 +++++++++++++++++
drivers/iio/opensensorfusion/osf_core.h       |  81 ++++
drivers/iio/opensensorfusion/osf_iio.c        | 268 +++++++++++++
drivers/iio/opensensorfusion/osf_iio.h        |  21 ++
drivers/iio/opensensorfusion/osf_protocol.c   | 234 ++++++++++++
drivers/iio/opensensorfusion/osf_protocol.h   | 100 +++++
drivers/iio/opensensorfusion/osf_serdev.c     | 354 ++++++++++++++++++
drivers/iio/opensensorfusion/osf_serdev.h     |   8 +
drivers/iio/opensensorfusion/osf_stream.c     | 212 +++++++++++
drivers/iio/opensensorfusion/osf_stream.h     |  31 ++
16 files changed, 1706 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/imu/opensensorfusion,osf-uart.yaml
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_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_serdev.h
create mode 100644 drivers/iio/opensensorfusion/osf_stream.c
create mode 100644 drivers/iio/opensensorfusion/osf_stream.h
[PATCH RFC 0/3] iio: add Open Sensor Fusion UART driver
Posted by Jinseob Kim 4 days, 16 hours ago
Open Sensor Fusion is a UART-attached sensor aggregation device. The current
prototype sends OSF protocol v0 frames over a host UART link. This RFC adds the
first Linux IIO receive path for that UART stream.

The first transport is serdev UART. USB, real sensor reads, fusion output, and
production timestamp correlation are intentionally left out of this series.

The driver code is kept in one patch for the first RFC to avoid intermediate
non-buildable states. The internal files are still split by protocol, stream,
core, transport, and IIO code.

Current validation coverage:

- STM32F405 test firmware OSF protocol v0 UART stream at 115200 8N1.
- Raspberry Pi 4 serdev probe and receive path to osf_core_receive_frame().
- CAPABILITY_REPORT-driven IIO device registration.
- IIO read_raw for accel, gyro, magn, and temp samples.
- IIO software kfifo buffer userspace read.
- scan decode helper for buffered samples.
- dt_binding_check pass for the binding.
- checkpatch.pl --strict with ERROR 0, WARNING 0, CHECK 0.
- W=1 source compile/link phase clean in the staging kernel tree.
- modpost unresolved symbol warnings came from the staging tree missing
  Module.symvers.

Known limits:

- The sample source is synthetic stream data, not real ICM-42688-P or MMC5983MA
  sensor reads.
- The IIO timestamp is Linux host receive time. Device time correlation is still
  open.
- Runtime capability removal is not implemented.
- The staging layout uses drivers/iio/opensensorfusion/. The final directory is
  open for review.

Review feedback wanted on the IIO device layout, timestamp policy, binding
shape, and driver directory.

Jinseob Kim (3):
  dt-bindings: iio: imu: add Open Sensor Fusion UART binding
  iio: osf: add Open Sensor Fusion UART IIO driver
  MAINTAINERS: add Open Sensor Fusion IIO driver entry

 .../iio/imu/opensensorfusion,osf-uart.yaml    |  33 ++
 MAINTAINERS                                   |   7 +
 drivers/iio/Kconfig                           |   1 +
 drivers/iio/Makefile                          |   1 +
 drivers/iio/opensensorfusion/Kconfig          |  15 +
 drivers/iio/opensensorfusion/Makefile         |   6 +
 drivers/iio/opensensorfusion/osf_core.c       | 334 +++++++++++++++++
 drivers/iio/opensensorfusion/osf_core.h       |  81 ++++
 drivers/iio/opensensorfusion/osf_iio.c        | 268 +++++++++++++
 drivers/iio/opensensorfusion/osf_iio.h        |  21 ++
 drivers/iio/opensensorfusion/osf_protocol.c   | 234 ++++++++++++
 drivers/iio/opensensorfusion/osf_protocol.h   | 100 +++++
 drivers/iio/opensensorfusion/osf_serdev.c     | 354 ++++++++++++++++++
 drivers/iio/opensensorfusion/osf_serdev.h     |   8 +
 drivers/iio/opensensorfusion/osf_stream.c     | 212 +++++++++++
 drivers/iio/opensensorfusion/osf_stream.h     |  31 ++
 16 files changed, 1706 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/imu/opensensorfusion,osf-uart.yaml
 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_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_serdev.h
 create mode 100644 drivers/iio/opensensorfusion/osf_stream.c
 create mode 100644 drivers/iio/opensensorfusion/osf_stream.h

-- 
2.43.0
Re: [PATCH RFC 0/3] iio: add Open Sensor Fusion UART driver
Posted by Jonathan Cameron 2 days, 8 hours ago
On Wed, 20 May 2026 16:28:40 +0900
Jinseob Kim <kimjinseob88@gmail.com> wrote:

> Open Sensor Fusion is a UART-attached sensor aggregation device. The current
> prototype sends OSF protocol v0 frames over a host UART link. This RFC adds the
> first Linux IIO receive path for that UART stream.
> 
> The first transport is serdev UART. USB, real sensor reads, fusion output, and
> production timestamp correlation are intentionally left out of this series.
> 
> The driver code is kept in one patch for the first RFC to avoid intermediate
> non-buildable states. The internal files are still split by protocol, stream,
> core, transport, and IIO code.

Even for an RFC you need to break it up.  If you do it right there won't
be non-buildable states.  Take a look at how any complex IIO driver is added.

Key thing here seems to be that we need some references.

Superficially sounds like an open source sensor hub implementation but
we need a datasheet / reference manual to be able to review this properly.

I'll have a first look but it's likely to be somewhat superficial.
Re: [PATCH RFC 0/3] iio: add Open Sensor Fusion UART driver
Posted by Andy Shevchenko 4 days, 12 hours ago
On Wed, May 20, 2026 at 1:47 PM Jinseob Kim <kimjinseob88@gmail.com> wrote:
>
> Open Sensor Fusion is a UART-attached sensor aggregation device. The current
> prototype sends OSF protocol v0 frames over a host UART link. This RFC adds the
> first Linux IIO receive path for that UART stream.
>
> The first transport is serdev UART. USB, real sensor reads, fusion output, and
> production timestamp correlation are intentionally left out of this series.
>
> The driver code is kept in one patch for the first RFC to avoid intermediate
> non-buildable states. The internal files are still split by protocol, stream,
> core, transport, and IIO code.
>
> Current validation coverage:
>
> - STM32F405 test firmware OSF protocol v0 UART stream at 115200 8N1.
> - Raspberry Pi 4 serdev probe and receive path to osf_core_receive_frame().
> - CAPABILITY_REPORT-driven IIO device registration.
> - IIO read_raw for accel, gyro, magn, and temp samples.
> - IIO software kfifo buffer userspace read.
> - scan decode helper for buffered samples.
> - dt_binding_check pass for the binding.
> - checkpatch.pl --strict with ERROR 0, WARNING 0, CHECK 0.
> - W=1 source compile/link phase clean in the staging kernel tree.
> - modpost unresolved symbol warnings came from the staging tree missing
>   Module.symvers.
>
> Known limits:
>
> - The sample source is synthetic stream data, not real ICM-42688-P or MMC5983MA
>   sensor reads.
> - The IIO timestamp is Linux host receive time. Device time correlation is still
>   open.
> - Runtime capability removal is not implemented.
> - The staging layout uses drivers/iio/opensensorfusion/. The final directory is
>   open for review.
>
> Review feedback wanted on the IIO device layout, timestamp policy, binding
> shape, and driver directory.


>  16 files changed, 1706 insertions(+)

No.
Split it to at least 5 patches (as far as I can briefly see it's
achievable): base + feature1 + feature2 + …

-- 
With Best Regards,
Andy Shevchenko