w1: add UART w1 bus driver
authorChristoph Winklhofer <cj.winklhofer@gmail.com>
Wed, 14 Feb 2024 06:36:15 +0000 (07:36 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 15 Feb 2024 14:02:33 +0000 (15:02 +0100)
commita3c08804364e80328a9ffdac59bb26676b938195
tree498c319d9ba2e94890d67e8d4523395aaa3b5781
parent23b333375317f6c2866e1ede7e7c4a726fc22aa8
w1: add UART w1 bus driver

Add a UART 1-Wire bus driver. The driver utilizes the UART interface via
the Serial Device Bus to create the 1-Wire timing patterns. The driver
was tested on a "Raspberry Pi 3B" with a DS18B20 and on a "Variscite
DART-6UL" with a DS18S20 temperature sensor.

The 1-Wire timing pattern and the corresponding UART baud-rate with the
interpretation of the transferred bytes are described in the document:

Link: https://www.analog.com/en/technical-articles/using-a-uart-to-implement-a-1wire-bus-master.html
In short, the UART peripheral must support full-duplex and operate in
open-drain mode. The timing patterns are generated by a specific
combination of baud-rate and transmitted byte, which corresponds to a
1-Wire read bit, write bit or reset.

Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Link: https://lore.kernel.org/r/20240214-w1-uart-v7-3-6e21fa24e066@gmail.com
[krzysztof: w1_uart_serdev_receive_buf() return type fixup]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Documentation/w1/masters/index.rst
Documentation/w1/masters/w1-uart.rst [new file with mode: 0644]
drivers/w1/masters/Kconfig
drivers/w1/masters/Makefile
drivers/w1/masters/w1-uart.c [new file with mode: 0644]