summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0009-tscadc-make-stepconfig-channel-configurable.patch
blob: 5f43ac4ca07c344bdae64a2165cabec700b27914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 3b70f6dd0dd6f6c1fbd71b7090a3340382b3c77e Mon Sep 17 00:00:00 2001
From: Joel A Fernandes <joelagnel@ti.com>
Date: Mon, 28 Nov 2011 18:18:04 -0600
Subject: [PATCH 09/79] tscadc: make stepconfig channel-configurable

Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
---
 drivers/input/touchscreen/ti_tscadc.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c
index b50a08c..6083de7 100644
--- a/drivers/input/touchscreen/ti_tscadc.c
+++ b/drivers/input/touchscreen/ti_tscadc.c
@@ -135,7 +135,9 @@ static void tscadc_writel(struct tscadc *tsc, unsigned int reg,
 	writel(val, tsc->tsc_base + reg);
 }
 
-static void tsc_adc_step_config(struct tscadc *ts_dev)
+/* Configure ADC to sample on channel (1-8) */
+
+static void tsc_adc_step_config(struct tscadc *ts_dev, int channel)
 {
 	unsigned int	stepconfig = 0, delay = 0, chargeconfig = 0;
 
@@ -147,7 +149,7 @@ static void tsc_adc_step_config(struct tscadc *ts_dev)
  	 */
 	stepconfig = TSCADC_STEPCONFIG_MODE_SWONESHOT |
 		TSCADC_STEPCONFIG_2SAMPLES_AVG |
-		(0x7 << 19);
+		((channel-1) << 19);
 
 	delay = TSCADC_STEPCONFIG_SAMPLEDLY | TSCADC_STEPCONFIG_OPENDLY;
 
@@ -604,7 +606,7 @@ static	int __devinit tscadc_probe(struct platform_device *pdev)
 			goto err_fail;
 	}
 	else {
-		tsc_adc_step_config(ts_dev);
+		tsc_adc_step_config(ts_dev, 8);
 		tscadc_writel(ts_dev, TSCADC_REG_FIFO0THR, 0);
 		irqenable = TSCADC_IRQENB_FIFO0THRES;
 	}
-- 
1.7.10