iio: srf04: fix wrong limitation in distance measuring
authorAndreas Klinger <ak@it-klinger.de>
Sun, 6 Oct 2019 14:29:56 +0000 (16:29 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 12 Oct 2019 13:31:09 +0000 (14:31 +0100)
commit431f7667bd6889a274913162dfd19cce9d84848e
treea3b6d2b7a6d80cd9de71b9a6e5271ff069f521af
parent24e1eb5c0d78cfb9750b690bbe997d4d59170258
iio: srf04: fix wrong limitation in distance measuring

The measured time value in the driver is limited to the maximum distance
which can be read by the sensor. This limitation was wrong and is fixed
by this patch.

It also takes into account that we are supporting a variety of sensors
today and that the recently added sensors have a higher maximum
distance range.

Changes in v2:
- Added a Tested-by

Suggested-by: Zbyněk Kocur <zbynek.kocur@fel.cvut.cz>
Tested-by: Zbyněk Kocur <zbynek.kocur@fel.cvut.cz>
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Cc:<Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/srf04.c