diff options
author | Vignesh R <vigneshr@ti.com> | 2016-08-17 17:43:01 +0530 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-21 19:48:31 +0100 |
commit | 7175cce1c3f1d8c8840d2004f78f96a3904249b5 (patch) | |
tree | 1943c8cf16ab4075753629fe273aba2ee51bba96 /drivers/iio/adc | |
parent | 90c43ec6997a892448f1f86180a515f59cafd8a3 (diff) | |
download | linux-7175cce1c3f1d8c8840d2004f78f96a3904249b5.tar.bz2 |
iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample
Now that open delay and sample delay for each channel is configurable
via DT, the default IDLE_TIMEOUT value is not enough as this is
calculated based on hardcoded macros. This results in driver returning
EBUSY sometimes. Fix this by increasing the timeout
value based on maximum value possible to open delay and sample delays
for each channel.
Fixes: 5dc11e810676e ("iio: adc: ti_am335x_adc: make sample delay, open delay, averaging DT parameters")
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index bed9977a1863..c3cfacca2541 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -381,7 +381,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en); - timeout = jiffies + usecs_to_jiffies + timeout = jiffies + msecs_to_jiffies (IDLE_TIMEOUT * adc_dev->channels); /* Wait for Fifo threshold interrupt */ while (1) { |