From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793386412; b=oiGoyNpZUCxnuPl1uwoTYKxKttsGvedjb1Tr4MBamXA4SBcrxDsiBQ3n+e5jo6LfBD5J fkpHqdGOAznxPKjriIU8f1iANWtT6jF2ib9C5J2jWxfCwc8G7EDIlI3x6d9Qtj5N0RYRx y4reVOc6gQF0a5X4Yk39q+nQYchrZVyTE7OY0R3RY6vBU3BgQhfcj3vjSC+Oju0NEFcp/ xyYgN3yXsQ0oa20JgNSEJSa1nTNC50JlmmfroPJmXa23u66fkYUODI0Y/IDA8hqMVboO1 Xu9biXE+4khKtsx7va5xhmJVdPbN5FAhbD+UkSJ1jHw5K1ENSPOdrp+u4aV05XB4zaQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793386412; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=uu0C0Yr+xrcRg90frO5nemP1vWNiqZgW/5nsLGnwo/E=; b=Ji82hFgwTr5VMa52YheffwcepxfWkRi35r2M22si/SJG7TXoHT54sVmjsM5DFZJpGli+ XNZMqOSTGLGqWjfKH5PAJOr/LIMyES3EYjnlOtrszVXp8HQCoLwsIfBodt/5XTNzq5+m1 axXYBMvQrnoMcL7bLnqfgSJH0pMaXVY7MrXzolqdAxqEJ3AcYZJ2+NvTL16CVCXN+SZW1 PqCPAh5CKTwimTNJbiAM80QO4HoTQAXOWw1V9L83LIWzBY/KTikBV6QTYHBEBWu2T3s51 KGk0haPKVDojbeYBbVj38gxSefXGC5C8L8VWKKSeX5f5+RgWjFoR/tbf2GsAUhmcgSQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VhPGwf1E; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47ECD606A326; Fri, 30 Oct 2026 18:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VhPGwf1E Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1793386411; b=X+nT009Wg8TKjeoODjKWRjmWXYKUZ5t6ghV4MKGAReLJIWDtvwke4k20SMPk52mOM/It Jp3Lv1ABdQqxgIDQwF15nGZ784KTve+y529EYSDYT/3T6giViMnrH8TjgeTf7EQYjvRzL ZbeFQ2z10ObQP5ezOMMCJ2/mweKTyRAcnnphoAJeVGAZM3g5xexUC1FuGfVZtuceU8Oq3 s7os0Y/ch/aoxKETcm3TX/DV3ZzUrBs99xrCqUmV23Ls/xmEXagztdkpeipsPc6t/4yrQ pqD8aIyc6fNglMoZ6soX0Nq3tsmHckCP0Czt6wRWd2s071VSTBWZYN4OCL04iYm/NUQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1793386411; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=uu0C0Yr+xrcRg90frO5nemP1vWNiqZgW/5nsLGnwo/E=; b=mjWFSqN/Ls+k7Vz6Q82NEs+BJ4wz7xALjnWFz+44Sd+vQmZalLuQQPlfs+PL2NBPMHnd gl7W7IwSPjRH4zrpGuhrFCTM2RcblOZ4OuhobmaYJJnAgXgFDZY9tkM5soMgOFt886qTd JUzj1xKsfaJveUWZTXa8M7WhsyMpm2c+Fl/CUNaimVdt8WbzyBheIdfKXcEQcXo3jdAQ2 h8gqAlR6sXWIe++MrYIujysEdciZBq3QCW9tl/oyoq2rWNQpDtQddoWNg5EP+Z1XITD+d /zh0HxGKpqgzP6+hiZQUM7jiEEPQ+7AWN8HJENSFr4uG783HukZAfp25KQD11kxGB7w== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 99FE11F000C1; Fri, 30 Oct 2026 18:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793386411; bh=uu0C0Yr+xrcRg90frO5nemP1vWNiqZgW/5nsLGnwo/E=; h=From:Subject:Date:To:Cc:Reply-To; b=VhPGwf1EJNSZ1OL3qXTtLdzg0ADklL3lSnSmElUciYYPoscsWuorQyOdLQDG8Ye3M xx19zVsHCWu8nwPlQp0ZeX5kWfE5tz8k71+GqBDVlbSm8vIFrPWWqdsLc5rEN1UOmt I0FVF/Pqsqyehv+FP139Ek+gYs+3pYB5TvjivBe7go0gg3DiAXoqgP15YsJYQr477D UtS1VUpBodgkUrb0TWhHc8BohjvyPc+WzC89J3OV29joREewA5qkZ0KhM2r2gnV6Rl paliY7qWcyEyxIr6LxfMfjHIi85W23GdVbMrDnW6vwCdAbKlHxdKpAB337aq0LHrml BSOfH9yGF2wZQ== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id EF3EC44245; Fri, 30 Oct 2026 18:53:29 +0000 (UTC) From: Vidhu Sarwal via B4 Relay Subject: [PATCH v2 0/3] iio: proximity: Add Benewake TF-Luna LiDAR driver Date: Sat, 31 Oct 2026 00:23:27 +0530 Message-Id: <20261031-tf-luna-v2-0-ce403579bb8a@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/z2OwQ6CMBBEf4X0bLUtFsGT/2E4tGWBNdCathAN4 d+laDy+mdmZXUgAjxDINVuIhxkDOruBOGTE9Mp2QLHZmAgmCs54RWNLh8kqCqIoJTB5YY0kW/r pocXX3nSvvxwm/QAT03lKaBWAaq+s6ZOE6E4RQkTbJbfHEJ1/74/MPLX8NgX7b86cMipzVZZtl TdanG/dqHA4GjeSel3XDyJGq4TOAAAA X-Change-ID: 20261019-tf-luna-e2685e0570d5 To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vidhu Sarwal , Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Shuah Khan , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1793386408; l=2749; i=vidhu.linux@gmail.com; s=20260713; h=from:subject:message-id; bh=MucnKaMrWXm8c/wm47nu5n36To370scr33nPrqefbek=; b=ObaqujQPpUBcUW6EUd5dWA8bKHxeQHVfgURjGc7VftphKfVV5n0OLqavYRQ68ZEuUW/5VaDhp Lm+Qz32CqAbCe2/YEXU5qAO7XzZNpFfwUuv4ZELThZ4xNbvmE7iGZeg X-Developer-Key: i=vidhu.linux@gmail.com; a=ed25519; pk=xDu3Cbesz76CQXwY8lteI74n3ELVIV7wCsuYAvcX1Q4= X-Endpoint-Received: by B4 Relay for vidhu.linux@gmail.com/20260713 with auth_id=869 X-Original-From: Vidhu Sarwal Reply-To: vidhu.linux@gmail.com This series adds support for the Benewake TF-Luna, a single point ToF LiDAR distance sensor with a range of 0.2 m to 8 m. The sensor uses either UART or I2C, selected by a strap pin at power-up. This series covers the I2C interface only. Patch 1 adds the vendor prefix, patch 2 adds the binding and patch 3 adds the driver, which reports distance using an IIO_DISTANCE channel. The driver keeps the sensor in trigger mode and starts a measurement per read. The manual warns that reads in continuous mode can race with the sensor updating its result registers unless they are synchronised to the data ready output, which the driver does not use yet. Two issues I faced with the hardware that the manual does not mention: - The sensor silently drops a register write that arrives right after another one, so probe reads the mode back after setting it. - The boot time is not documented. I was able to measure 350ms after a reboot before the registers read back correctly, so probe waits 500 ms after enabling the supply, keeping some buffer. Later on I plan to add buffered caputure using data ready interrupt and runtime PM in a follow up series. This was tested on hardware using Raspberry Pi 4 and with firmware v3.6.0 built out of tree on the 6.18 RPi kernel both via new_device as well as a DT Overlay. --- Changes in v2: - dt-bindings: describe the UART interface as well per Krzysztof (dropped Reviewed-by as binding has changed) - Use a local regmap variable in probe and tf_luna_measure() per Joshua and Andy - Use msleep() instead of fsleep per Joshua and Andy - Use FourCC for signature and print it with %p4ch per Andy - Comment explaining why there is no regmap cache per Andy - Use a Datasheet: tag, drop unused includes per Andy and Joshua - Keep the channel array per Jonathan, as buffered support is planned - Link to v1: https://patch.msgid.link/20261020-tf-luna-v1-0-53a88f93db24@gmail.com --- Vidhu Sarwal (3): dt-bindings: vendor-prefixes: Add Benewake dt-bindings: iio: proximity: Add Benewake TF-Luna iio: proximity: Add Benewake TF-Luna LiDAR driver .../bindings/iio/proximity/benewake,tf-luna.yaml | 66 ++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 7 + drivers/iio/proximity/Kconfig | 11 + drivers/iio/proximity/Makefile | 1 + drivers/iio/proximity/tf-luna.c | 260 +++++++++++++++++++++ 6 files changed, 347 insertions(+) --- base-commit: 43ffda3c7f8456bbe641ae8249a077a361b97880 change-id: 20261019-tf-luna-e2685e0570d5 Best regards, -- Vidhu Sarwal