iio: dht11: Improve reliability - be more tolerant about missing start bits
authorHarald Geyer <harald@ccbib.org>
Sun, 17 Jan 2016 16:13:29 +0000 (16:13 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 30 Jan 2016 16:27:13 +0000 (16:27 +0000)
commit22acc120a141ce0a3b6e98799d15970ef687bc70
tree5b12ebcfe799413050372677f77046b1f37cbc96
parentc984b9cbbd17d3eb602de3802e25d975182474fa
iio: dht11: Improve reliability - be more tolerant about missing start bits

Instead of guessing where the data starts, we now just try to decode from
every possible start position. This causes no additional overhead if we
properly received the full preamble and only costs a few extra CPU cycles
in the case where the preamble is corrupted. This is much more efficient
than to return an error to userspace and start over again.

Signed-off-by: Harald Geyer <harald@ccbib.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/humidity/dht11.c