diff options
author | Scott Alfter <scott@alfter.us> | 2014-06-17 20:42:05 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-19 17:45:14 -0700 |
commit | 94859308a21b2bbf3d7c48789513c0c4a9ea7de1 (patch) | |
tree | a929e9e6f3dd3d81deeee65c6eb221c8488435a1 /Documentation/w1 | |
parent | 7242d42ace30825553eabd424b41b03136d37faa (diff) | |
download | lwn-94859308a21b2bbf3d7c48789513c0c4a9ea7de1.tar.gz lwn-94859308a21b2bbf3d7c48789513c0c4a9ea7de1.zip |
w1: new w1_ds2406 driver
Some preliminary work at making use of this driver led me to implement
CRC-16 checks on read and write to deal with the occasional glitchiness of
the 1-Wire bus. The revised driver (attached) returns an I/O error if the
CRC check fails. When reading the chip's state, either you get a valid
indication or you get an I/O error. When changing its state, either the
change is successful or an I/O error is returned.
Signed-off-by: Scott Alfter <scott@alfter.us>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/w1')
-rw-r--r-- | Documentation/w1/slaves/w1_ds2406 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/w1/slaves/w1_ds2406 b/Documentation/w1/slaves/w1_ds2406 new file mode 100644 index 000000000000..8137fe6f6c3d --- /dev/null +++ b/Documentation/w1/slaves/w1_ds2406 @@ -0,0 +1,25 @@ +w1_ds2406 kernel driver +======================= + +Supported chips: + * Maxim DS2406 (and other family 0x12) addressable switches + +Author: Scott Alfter <scott@alfter.us> + +Description +----------- + +The w1_ds2406 driver allows connected devices to be switched on and off. +These chips also provide 128 bytes of OTP EPROM, but reading/writing it is +not supported. In TSOC-6 form, the DS2406 provides two switch outputs and +can be provided with power on a dedicated input. In TO-92 form, it provides +one output and uses parasitic power only. + +The driver provides two sysfs files. state is readable; it gives the +current state of each switch, with PIO A in bit 0 and PIO B in bit 1. The +driver ORs this state with 0x30, so shell scripts get an ASCII 0/1/2/3 to +work with. output is writable; bits 0 and 1 control PIO A and B, +respectively. Bits 2-7 are ignored, so it's safe to write ASCII data. + +CRCs are checked on read and write. Failed checks cause an I/O error to be +returned. On a failed write, the switch status is not changed. |