]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:07 +0000 (13:16 +0100)
commit8cd82e9c9ed75558f283b934a295dc9cdc40b45b
tree13ac89ede2f2fe87090473e120431b6fa82f6581
parente00adaff45b5bcc31492f0a1a5188550cd3f2bb6
iio: srf04: fix wrong limitation in distance measuring

BugLink: https://bugs.launchpad.net/bugs/1853519
commit 431f7667bd6889a274913162dfd19cce9d84848e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iio/proximity/srf04.c