xref: /linux/Documentation/w1/slaves/w1_ds2406.rst (revision e9bb627561535dd584b43a8c0afe93a67bc6a2c5)
1*e9bb6275SMauro Carvalho Chehab=======================
2*e9bb6275SMauro Carvalho Chehabw1_ds2406 kernel driver
3*e9bb6275SMauro Carvalho Chehab=======================
4*e9bb6275SMauro Carvalho Chehab
5*e9bb6275SMauro Carvalho ChehabSupported chips:
6*e9bb6275SMauro Carvalho Chehab
7*e9bb6275SMauro Carvalho Chehab  * Maxim DS2406 (and other family 0x12) addressable switches
8*e9bb6275SMauro Carvalho Chehab
9*e9bb6275SMauro Carvalho ChehabAuthor: Scott Alfter <scott@alfter.us>
10*e9bb6275SMauro Carvalho Chehab
11*e9bb6275SMauro Carvalho ChehabDescription
12*e9bb6275SMauro Carvalho Chehab-----------
13*e9bb6275SMauro Carvalho Chehab
14*e9bb6275SMauro Carvalho ChehabThe w1_ds2406 driver allows connected devices to be switched on and off.
15*e9bb6275SMauro Carvalho ChehabThese chips also provide 128 bytes of OTP EPROM, but reading/writing it is
16*e9bb6275SMauro Carvalho Chehabnot supported.  In TSOC-6 form, the DS2406 provides two switch outputs and
17*e9bb6275SMauro Carvalho Chehabcan be provided with power on a dedicated input.  In TO-92 form, it provides
18*e9bb6275SMauro Carvalho Chehabone output and uses parasitic power only.
19*e9bb6275SMauro Carvalho Chehab
20*e9bb6275SMauro Carvalho ChehabThe driver provides two sysfs files.  state is readable; it gives the
21*e9bb6275SMauro Carvalho Chehabcurrent state of each switch, with PIO A in bit 0 and PIO B in bit 1.  The
22*e9bb6275SMauro Carvalho Chehabdriver ORs this state with 0x30, so shell scripts get an ASCII 0/1/2/3 to
23*e9bb6275SMauro Carvalho Chehabwork with.  output is writable; bits 0 and 1 control PIO A and B,
24*e9bb6275SMauro Carvalho Chehabrespectively.  Bits 2-7 are ignored, so it's safe to write ASCII data.
25*e9bb6275SMauro Carvalho Chehab
26*e9bb6275SMauro Carvalho ChehabCRCs are checked on read and write.  Failed checks cause an I/O error to be
27*e9bb6275SMauro Carvalho Chehabreturned.  On a failed write, the switch status is not changed.
28