Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114930
b: refs/heads/master
c: 8e3dae2
h: refs/heads/master
v: v3
  • Loading branch information
David Fries authored and Linus Torvalds committed Oct 16, 2008
1 parent aa22c07 commit 213ebda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7dc8f527ef20bf95143dfbe2ecc01dc70b1e6ab7
refs/heads/master: 8e3dae2b4727dc216e2dc16d2f0271b5f31b680c
14 changes: 13 additions & 1 deletion trunk/drivers/w1/w1_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,24 @@ int w1_reset_bus(struct w1_master *dev)
result = dev->bus_master->reset_bus(dev->bus_master->data) & 0x1;
else {
dev->bus_master->write_bit(dev->bus_master->data, 0);
/* minimum 480, max ? us
* be nice and sleep, except 18b20 spec lists 960us maximum,
* so until we can sleep with microsecond accuracy, spin.
* Feel free to come up with some other way to give up the
* cpu for such a short amount of time AND get it back in
* the maximum amount of time.
*/
w1_delay(480);
dev->bus_master->write_bit(dev->bus_master->data, 1);
w1_delay(70);

result = dev->bus_master->read_bit(dev->bus_master->data) & 0x1;
w1_delay(410);
/* minmum 70 (above) + 410 = 480 us
* There aren't any timing requirements between a reset and
* the following transactions. Sleeping is safe here.
*/
/* w1_delay(410); min required time */
msleep(1);
}

return result;
Expand Down

0 comments on commit 213ebda

Please sign in to comment.