lkml.org 
[lkml]   [2013]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] iio: ti_am335x_adc: Take touchscreen channels into account for conversion timeout
The calculation of the old conversion timeout value was based on the number of
channels used by this driver. This doesn't take into account that other channels
can be used by the touchscreen driver. Adjust the timeout value to the maximum
if the touchscreen driver is enabled

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
---
drivers/iio/adc/ti_am335x_adc.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 3ceac3e..898fc78 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -146,7 +146,11 @@ static int tiadc_read_raw(struct iio_dev *indio_dev,
bool found = false;
u32 step_en;
unsigned long timeout = jiffies + usecs_to_jiffies
+#ifdef CONFIG_TOUCHSCREEN_TI_AM335X_TSC
+ (IDLE_TIMEOUT * TOTAL_CHANNELS);
+#else
(IDLE_TIMEOUT * adc_dev->channels);
+#endif
step_en = get_adc_step_mask(adc_dev);
am335x_tsc_se_set(adc_dev->mfd_tscadc, step_en);

--
1.8.4.rc3


\
 
 \ /
  Last update: 2013-09-10 23:21    [W:0.328 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site