[lm-sensors] [PATCH 2.6.12-rc5-mm2] w1 search cleanup

BGardner at Wabtec.com BGardner at Wabtec.com
Thu Jun 2 19:09:52 CEST 2005


While writing a driver for the DS2482 (an i2c to w1 bridge), 
I made a few enhancements to the w1 subsystem.

1.
I added a new I/O function: triplet
A triplet reads two bits and writes a direction bit.  The DS2482
implements this in hardware.
I modified w1_search() to use w1_triplet() at its core.

2.
I cleaned up the I/O functions to separate emulated vs native w1
support.
A w1 bus master must be able to do one of:
  a. Set and sample the line via write_bit() and read_bit()
  b. Support reset_bus() and touch_bit()
Function set (a) is only needed for emulated devices (ie, a parallel
port).
I hid w1_read_bit() and w1_write_bit() behind w1_touch_bit(), and
changed functions to call touch_bit() instead or read/write_bit().
 
3. 
Searching is fairly slow - it requires about 200 w1 bit cycles per
device, multiplied by the number of devices on the bus.
I modified the w1_process() to NOT periodically search the bus.
A sysfs entry was added to request a search. (w1_master_search).
To request a search, echo anything into w1_master_search and it'll run
another search.

4.
I added a default family so that a slave device will get reported even
if there isn't a driver for that family.

Signed-off-by: Ben Gardner <bgardner at wabtec.com>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: w1search.diff.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050602/e2d8b838/attachment.txt>


More information about the lm-sensors mailing list