From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B3CF3D3D1F for ; Fri, 29 May 2026 12:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780056647; cv=none; b=W7qFo1skRgYU6AA4+NXHaESM8hQ5SP3AoexTKR8hKuzQ7EJDD2wJioDP1DJYTpG94vCTS8gj6rbRYRq2phuKpwf+2PxQxeYTKuV95LwdqtrdW40Yx/z8eklN99aaxgEUnC4bRpAoWpFI6fUVFeqAFwkPdAeq9FKgac60uKaIrWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780056647; c=relaxed/simple; bh=TVCBkSH0t0I/QdJHG/97TcLdJ/J00jwLfv2FVpplnfI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ov2Z7clGOibPkicA+4ythDh5FBf4EXpOT8cKfkztZrjgHx3cWZAyJAy01oHB9Ztvr2kPwTD6pNWBv9E2jpdEMHBneDpZLaOJA/Iam51js5AgRdrC6QPWSstsEg8qjMiMaJejTc7KdRBmn74Y0edEMxbYkIU6T2X/5cq2wiyQB3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NtQ0kcLV; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NtQ0kcLV" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-36a8ee1e28cso6039463a91.0 for ; Fri, 29 May 2026 05:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780056646; x=1780661446; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=I+lw2/6g+NhHdfY1R5gSsEUHoCuNL+aJO/wx8JDQeY4=; b=NtQ0kcLVN8uTa0Nf0GZirVkpjtZ0o0eImxU/4mIUgwJRW7pKu4DBBdSc2blny3zM2q rCUJZvSURWNCIhYXMucHfr5d2708h6RHOfSVqk/P0ynxDb1sWnJ65/2hN4WbAZxcyUfZ +G9LTWECihF3hbmutFXx2AGzmd+vcTTumCZ8F9yA1yF2oHQ/U+Rwx0cW49tRF0l4GI1f 3rGo/0BGP7+6u4V8gBhF8OMCzH6Lpj69xocneaiSm/5KuobxXrhpfqUKwHA+kTfRdUxr jlzpBiBO90F46HD7v6mwrkoUrSCHPsojqv65EZuLFc0iNuzEme3R7bIrxtGbM3zXb6Gt JE9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780056646; x=1780661446; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=I+lw2/6g+NhHdfY1R5gSsEUHoCuNL+aJO/wx8JDQeY4=; b=DOeBNXU80RX3LSxI38JOUE3WoSfrt7afsepuiLoWoXfXR9FT2Ux0DypoRbsV5HDxuq gIPlWkHnAVcuYQzWgiH3DBhMtIrU9cZHeh1kCF77dhUq6JD/d5XicnizcuN/Y7J0jf8c O1ktY7a1yLEcQNt5WdRflXwvFhrGkgMMbE7wAlNtiwa141bFW762ypUtX2IBOEnRMmat vyQBR5KUbcsWfVGhtH0cltcdFem8R5WhohSTlR3iTIhYRxdmTz6z4ZS73ZOXt1TSKPlM CYCxWRB7vYDtFvxIpXqMS3B3l14y5zC8LXxps1HBsf0mmX48Zxhed2hhSTJUhKL3HA32 a/+Q== X-Forwarded-Encrypted: i=1; AFNElJ+mRpgI4OE+//BeW/MtLDmzL60FgBwS6Tuni6Gau6jW6+wX/5uNRCjD2gxpVIGkLXtd8dpXTPgRJKWLf2Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0EfjO0mhU2M7oAODk01tZsBFMQMA6N56W3hAQxdFtJ87v8QV/ UvDoiTElbzym01MsqSVzsyT9l5CYVBLxOxAduYkFPw64LJ4dk71ucmZe X-Gm-Gg: Acq92OEHLZGLbqcKY6yMQSZ/d/6uE72g6F/hX4bjIyECxqbA1Q6tkXsIy8DCz0xvltn rFNK0H2w0iCkxv2ZL/syhieJLMEqUA934LcCtJtgPGqzuWnggYSK/FOK/4cRn2u3PtWVAtmwiXV 6KAagg7rLD1XUPEhOu7Pv1nRPOV47WwFcXuau1ABpZQwfufgYIvFWllkyH4B0G/tl3fGr9Z3gc2 Wu5vCRK0JjJZBrOAa/SSZv0DhdXDW5j5W8j86QoDfTvDCwuoIwyhR2pvZmKmHm+b8AZTK6QpHnR QH56+G+BULo7IBs0zsYv1QSYenTthsfAYQxcs6zPz8j7vpiX/FcbHQsYGATaMyOZwrOT28qSOqq MW8ROGcfDQmMBR5yEFx2UsEfFa2uRa+mJZFpgZmHC3p5IILst6F+L/tIx0+sRqprkLGbRnjgqQx xH8WBnh4v5TPszFDp2SUrtcY0hfrD2XTNdEN7kFcfAqL3JVox7VZjwpnrEiSz7lWKBVAyDONHeM f+CCEX/IZHtbAbPIabLDHa+C/NNbOqB0RMkzUFz0pjKyjAq X-Received: by 2002:a17:90a:e7c9:b0:368:1088:bb1d with SMTP id 98e67ed59e1d1-36bbcfd9807mr2907182a91.15.1780056645424; Fri, 29 May 2026 05:10:45 -0700 (PDT) Received: from DESKTOP-G3E0OSP.localdomain ([112.172.255.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36bbdf3afc6sm942820a91.7.2026.05.29.05.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 05:10:45 -0700 (PDT) From: Jinseob Kim To: Jonathan Cameron , linux-iio@vger.kernel.org Cc: David Lechner , Nuno Sa , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC v3 0/6] iio: add Open Sensor Fusion OSF0 UART driver Date: Fri, 29 May 2026 21:09:59 +0900 Message-ID: <20260529121005.1470-1-kimjinseob88@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This RFC series adds an Industrial I/O driver for Open Sensor Fusion OSF0 UART devices. Open Sensor Fusion is an open hardware project for sensor aggregation devices and Linux IIO host support. OSF0 is not a general standard; it is the current wire format used by this project and by the RFC driver in this series. The first concrete hardware target is OSF GREEN, an STM32F405-based sensor aggregation board that streams sensor samples to a Linux host. Project links: https://www.opensensorfusion.org/ https://github.com/opensensorfusion https://github.com/opensensorfusion/opensensorfusion-linux The driver receives OSF0 frames over a serdev UART, validates the stream, decodes capability and sample frames, and registers IIO devices for the supported sensor types. The current RFC driver covers the device-to-host path used for accelerometer, gyroscope, magnetometer, and temperature samples. Changes since v2: * Reworked the binding around the concrete OSF GREEN hardware target. * Changed the compatible from opensensorfusion,osf-uart to opensensorfusion,osf-green. * Renamed the binding file to opensensorfusion,osf-green.yaml. * Updated the example node name to generic sensor. * Added serial-peripheral-props.yaml and unevaluatedProperties: false. * Added public project links and clarified that OSF0 is not a general standard. * Separated the OSF0 wire format from the subset currently supported by this RFC driver. * Clarified SENSOR_SAMPLE as a 16-byte payload header followed by 4 * channel_count bytes of s32 channel data. * Clarified device-side timestamp limitations. * Spelled out Attitude and Heading Reference System (AHRS). * Added sensor_type, sample_format, channel_count, reserved-field, and payload length overflow validation. * Changed reserved fields to validate-only handling. * Fixed IIO_BUFFER / IIO_KFIFO_BUF dependency handling. * Added channel_count checks before pushing samples to IIO buffers. * Added locking for cached latest samples. * Removed explicit linux-iio and devicetree list entries from MAINTAINERS. * Folded MAINTAINERS updates into the patches that add the corresponding files. * Addressed Sashiko feedback from v2. The runtime smoke test used for the previous revision was performed with an OSF GREEN prototype connected to a Raspberry Pi 4 over UART/serdev. This v3 series was also checked with dt_binding_check, checkpatch, and a W=1 target build in the local full-tree environment. Jinseob Kim (6): dt-bindings: iio: add OSF GREEN sensor aggregation device Documentation: iio: add Open Sensor Fusion protocol v0 reference iio: osf: add protocol v0 decoding iio: osf: add stream parser iio: osf: add UART serdev transport iio: osf: register IIO devices from capabilities .../iio/imu/opensensorfusion,osf-green.yaml | 43 +++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + .../iio/open-sensor-fusion-protocol-v0.rst | 308 ++++++++++++++++++ MAINTAINERS | 13 + drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + drivers/iio/opensensorfusion/Kconfig | 14 + drivers/iio/opensensorfusion/Makefile | 6 + drivers/iio/opensensorfusion/osf_core.c | 305 +++++++++++++++++ drivers/iio/opensensorfusion/osf_core.h | 70 ++++ drivers/iio/opensensorfusion/osf_iio.c | 285 ++++++++++++++++ drivers/iio/opensensorfusion/osf_iio.h | 22 ++ drivers/iio/opensensorfusion/osf_protocol.c | 247 ++++++++++++++ drivers/iio/opensensorfusion/osf_protocol.h | 95 ++++++ drivers/iio/opensensorfusion/osf_serdev.c | 111 +++++++ drivers/iio/opensensorfusion/osf_stream.c | 207 ++++++++++++ drivers/iio/opensensorfusion/osf_stream.h | 31 ++ 17 files changed, 1761 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/imu/opensensorfusion,osf-green.yaml create mode 100644 Documentation/iio/open-sensor-fusion-protocol-v0.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_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