From 213ebda416049f00fe473baab7363f68a8912b0a Mon Sep 17 00:00:00 2001 From: David Fries Date: Wed, 15 Oct 2008 22:05:01 -0700 Subject: [PATCH] --- yaml --- r: 114930 b: refs/heads/master c: 8e3dae2b4727dc216e2dc16d2f0271b5f31b680c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/w1/w1_io.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2ab84067d28c..0f93f9de65fb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7dc8f527ef20bf95143dfbe2ecc01dc70b1e6ab7 +refs/heads/master: 8e3dae2b4727dc216e2dc16d2f0271b5f31b680c diff --git a/trunk/drivers/w1/w1_io.c b/trunk/drivers/w1/w1_io.c index 97b338a16abc..f4f82f1f486e 100644 --- a/trunk/drivers/w1/w1_io.c +++ b/trunk/drivers/w1/w1_io.c @@ -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;