]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
iio: adc: ti-ads1015: add adequate wait time to get correct conversion
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 20 Jul 2017 15:24:22 +0000 (00:24 +0900)
committerSeth Forshee <seth.forshee@canonical.com>
Sun, 10 Sep 2017 23:08:45 +0000 (18:08 -0500)
commitc9461ba10782f93f28bf38d2de5bf3e64dbc2d81
treec86f963246ad34438fdfb15cc1d1b5efd6945c62
parent8c1ba7ea3b391f326b4b2691bd9eee9dbd9a42ec
iio: adc: ti-ads1015: add adequate wait time to get correct conversion

BugLink: http://bugs.launchpad.net/bugs/1716284
commit 4744d4e2afebf9644a439da9ca73d822fdd67bd9 upstream.

This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously.  So this driver
inserts a wait time before reading the conversion register if the
configuration is changed from a previous request.

Currently, the wait time is only the period required for a single
conversion that is calculated as the reciprocal of the sampling frequency.
However we also need to wait for the the previous conversion to complete.
Otherwise we probably get the conversion result for the previous
configuration when the sampling frequency is lower.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/iio/adc/ti-ads1015.c