summary refs log tree commit diff
path: root/drivers/iio/adc/ti_am335x_adc.c
diff options
context:
space:
mode:
authorBrad Griffis <bgriffis@ti.com>2015-02-03 11:41:58 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-03 11:50:37 -0800
commit3a59684ccc5d529e7e9ce8b068889dbaa4c34e9b (patch)
treea7cdee1b66db17d7b071e3517128d00e1bc4d0b6 /drivers/iio/adc/ti_am335x_adc.c
parent448c7f3830ca283e485aa943279acea6bde8b270 (diff)
downloadlinux-3a59684ccc5d529e7e9ce8b068889dbaa4c34e9b.tar.gz
Input: ti_am335x_tsc - interchange touchscreen and ADC steps
This patch makes the initial changes required to workaround TSC-false
pen-up interrupts. It is required to implement these changes in order to
remove udelay in the TSC interrupt handler and false pen-up events.  The
charge step is to be executed immediately after sampling X+. Hence TSC is
made to use higher numbered steps (steps 5 to 16 for 5 co-ordinate
readouts, 4 wire TSC configuration) and ADC to use lower ones. Further X
co-ordinate readouts must be the last to be sampled, thus co-ordinates are
sampled in the order Y-Z-X.

Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.19rc1]
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/iio/adc/ti_am335x_adc.c')
-rw-r--r--drivers/iio/adc/ti_am335x_adc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index b730864731e8..adba23246474 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -86,19 +86,18 @@ static void tiadc_step_config(struct iio_dev *indio_dev)
 {
 	struct tiadc_device *adc_dev = iio_priv(indio_dev);
 	unsigned int stepconfig;
-	int i, steps;
+	int i, steps = 0;
 
 	/*
 	 * There are 16 configurable steps and 8 analog input
 	 * lines available which are shared between Touchscreen and ADC.
 	 *
-	 * Steps backwards i.e. from 16 towards 0 are used by ADC
+	 * Steps forwards i.e. from 0 towards 16 are used by ADC
 	 * depending on number of input lines needed.
 	 * Channel would represent which analog input
 	 * needs to be given to ADC to digitalize data.
 	 */
 
-	steps = TOTAL_STEPS - adc_dev->channels;
 	if (iio_buffer_enabled(indio_dev))
 		stepconfig = STEPCONFIG_AVG_16 | STEPCONFIG_FIFO1
 					| STEPCONFIG_MODE_SWCNT;