1*4882a593Smuzhiyun======================= 2*4882a593Smuzhiyunw1_ds2406 kernel driver 3*4882a593Smuzhiyun======================= 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunSupported chips: 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun * Maxim DS2406 (and other family 0x12) addressable switches 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunAuthor: Scott Alfter <scott@alfter.us> 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunDescription 12*4882a593Smuzhiyun----------- 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunThe w1_ds2406 driver allows connected devices to be switched on and off. 15*4882a593SmuzhiyunThese chips also provide 128 bytes of OTP EPROM, but reading/writing it is 16*4882a593Smuzhiyunnot supported. In TSOC-6 form, the DS2406 provides two switch outputs and 17*4882a593Smuzhiyuncan be provided with power on a dedicated input. In TO-92 form, it provides 18*4882a593Smuzhiyunone output and uses parasitic power only. 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunThe driver provides two sysfs files. state is readable; it gives the 21*4882a593Smuzhiyuncurrent state of each switch, with PIO A in bit 0 and PIO B in bit 1. The 22*4882a593Smuzhiyundriver ORs this state with 0x30, so shell scripts get an ASCII 0/1/2/3 to 23*4882a593Smuzhiyunwork with. output is writable; bits 0 and 1 control PIO A and B, 24*4882a593Smuzhiyunrespectively. Bits 2-7 are ignored, so it's safe to write ASCII data. 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunCRCs are checked on read and write. Failed checks cause an I/O error to be 27*4882a593Smuzhiyunreturned. On a failed write, the switch status is not changed. 28