iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample
authorVignesh R <vigneshr@ti.com>
Wed, 17 Aug 2016 12:13:01 +0000 (17:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:07:38 +0000 (10:07 +0200)
commit023e76b1d1fd4857ba6af6e99dfbefd667aae6d1
tree8034e34c302f2d98e469dd888fd4f05af10e2f4c
parenta1f72192d04cf4cef432f37b590f6c5f9c8f9791
iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample

commit 7175cce1c3f1d8c8840d2004f78f96a3904249b5 upstream.

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ti_am335x_adc.c
include/linux/mfd/ti_am335x_tscadc.h