1*4882a593Smuzhiyun======================= 2*4882a593SmuzhiyunKernel driver w1_ds2413 3*4882a593Smuzhiyun======================= 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunSupported chips: 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun * Maxim DS2413 1-Wire Dual Channel Addressable Switch 8*4882a593Smuzhiyun 9*4882a593Smuzhiyunsupported family codes: 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun ================ ==== 12*4882a593Smuzhiyun W1_FAMILY_DS2413 0x3A 13*4882a593Smuzhiyun ================ ==== 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunAuthor: Mariusz Bialonczyk <manio@skyboo.net> 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunDescription 18*4882a593Smuzhiyun----------- 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunThe DS2413 chip has two open-drain outputs (PIO A and PIO B). 21*4882a593SmuzhiyunSupport is provided through the sysfs files "output" and "state". 22*4882a593Smuzhiyun 23*4882a593SmuzhiyunReading state 24*4882a593Smuzhiyun------------- 25*4882a593SmuzhiyunThe "state" file provides one-byte value which is in the same format as for 26*4882a593Smuzhiyunthe chip PIO_ACCESS_READ command (refer the datasheet for details): 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun======== ============================================================= 29*4882a593SmuzhiyunBit 0: PIOA Pin State 30*4882a593SmuzhiyunBit 1: PIOA Output Latch State 31*4882a593SmuzhiyunBit 2: PIOB Pin State 32*4882a593SmuzhiyunBit 3: PIOB Output Latch State 33*4882a593SmuzhiyunBit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) 34*4882a593Smuzhiyun======== ============================================================= 35*4882a593Smuzhiyun 36*4882a593SmuzhiyunThis file is readonly. 37*4882a593Smuzhiyun 38*4882a593SmuzhiyunWriting output 39*4882a593Smuzhiyun-------------- 40*4882a593SmuzhiyunYou can set the PIO pins using the "output" file. 41*4882a593SmuzhiyunIt is writable, you can write one-byte value to this sysfs file. 42*4882a593SmuzhiyunSimilarly the byte format is the same as for the PIO_ACCESS_WRITE command: 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun======== ====================================== 45*4882a593SmuzhiyunBit 0: PIOA 46*4882a593SmuzhiyunBit 1: PIOB 47*4882a593SmuzhiyunBit 2-7: No matter (driver will set it to "1"s) 48*4882a593Smuzhiyun======== ====================================== 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunThe chip has some kind of basic protection against transmission errors. 52*4882a593SmuzhiyunWhen reading the state, there is a four complement bits. 53*4882a593SmuzhiyunThe driver is checking this complement, and when it is wrong then it is 54*4882a593Smuzhiyunreturning I/O error. 55*4882a593Smuzhiyun 56*4882a593SmuzhiyunWhen writing output, the master must repeat the PIO Output Data byte in 57*4882a593Smuzhiyunits inverted form and it is waiting for a confirmation. 58*4882a593SmuzhiyunIf the write is unsuccessful for three times, the write also returns 59*4882a593SmuzhiyunI/O error. 60