diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-06 09:39:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-06 09:39:13 +0100 |
commit | 17fa87fe5a5141d3c082c5c91e950aca9e0ec701 (patch) | |
tree | 5aea2ff6b9b16b49585684c5f2ce404fe444a9ba /drivers/iio/humidity/dht11.c | |
parent | 3b28f4f2c2c7fcb6770cdfe5e8cd284ee1bc9783 (diff) | |
parent | d5adbfcd5f7bcc6fa58a41c5c5ada0e5c826ce2c (diff) | |
download | linux-17fa87fe5a5141d3c082c5c91e950aca9e0ec701.tar.bz2 |
Merge 4.10-rc7 into char-misc-next
We want the hv and other fixes in here as well to handle merge and
testing issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/humidity/dht11.c')
-rw-r--r-- | drivers/iio/humidity/dht11.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c index 9c47bc98f3ac..2a22ad920333 100644 --- a/drivers/iio/humidity/dht11.c +++ b/drivers/iio/humidity/dht11.c @@ -71,7 +71,8 @@ * a) select an implementation using busy loop polling on those systems * b) use the checksum to do some probabilistic decoding */ -#define DHT11_START_TRANSMISSION 18 /* ms */ +#define DHT11_START_TRANSMISSION_MIN 18000 /* us */ +#define DHT11_START_TRANSMISSION_MAX 20000 /* us */ #define DHT11_MIN_TIMERES 34000 /* ns */ #define DHT11_THRESHOLD 49000 /* ns */ #define DHT11_AMBIG_LOW 23000 /* ns */ @@ -228,7 +229,8 @@ static int dht11_read_raw(struct iio_dev *iio_dev, ret = gpio_direction_output(dht11->gpio, 0); if (ret) goto err; - msleep(DHT11_START_TRANSMISSION); + usleep_range(DHT11_START_TRANSMISSION_MIN, + DHT11_START_TRANSMISSION_MAX); ret = gpio_direction_input(dht11->gpio); if (ret) goto err; |