summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch
new file mode 100644
index 00000000..d1456ada
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch
@@ -0,0 +1,54 @@
1From 994bbaf10e91e859c54ba238e72e8f6f496c14e0 Mon Sep 17 00:00:00 2001
2From: Joel A Fernandes <joelagnel@ti.com>
3Date: Tue, 29 Nov 2011 09:44:22 -0600
4Subject: [PATCH 12/22] tscadc: switch to polling instead of interrupts
5
6Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
7---
8 drivers/input/touchscreen/ti_tscadc.c | 16 ++++++++++++++--
9 1 file changed, 14 insertions(+), 2 deletions(-)
10
11diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c
12index 1f9cbf5..8e2a994 100644
13--- a/drivers/input/touchscreen/ti_tscadc.c
14+++ b/drivers/input/touchscreen/ti_tscadc.c
15@@ -477,6 +477,8 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) {
16 struct device *dev;
17 struct tscadc *ts_dev;
18 int channel_num;
19+ int fifo0count = 0;
20+ int read_sample = 0;
21
22 pdev = (struct platform_device *)container_of(kobj, struct device, kobj);
23 dev = &pdev->dev;
24@@ -496,7 +498,17 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) {
25
26 tsc_adc_step_config(ts_dev, channel_num);
27
28- memcpy(buf, attr->name, strlen(attr->name)+1);
29+ do {
30+ fifo0count = tscadc_readl(ts_dev, TSCADC_REG_FIFO0CNT);
31+ }
32+ while (!fifo0count);
33+
34+ while (fifo0count--) {
35+ read_sample = tscadc_readl(ts_dev, TSCADC_REG_FIFO0) & 0xfff;
36+ // printk("polling sample: %d: %x\n", fifo0count, read_sample);
37+ }
38+ sprintf(buf, "%d", read_sample);
39+
40 return strlen(attr->name);
41 }
42
43@@ -656,7 +668,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev)
44 }
45 else {
46 tscadc_writel(ts_dev, TSCADC_REG_FIFO0THR, 0);
47- irqenable = TSCADC_IRQENB_FIFO0THRES;
48+ irqenable = 0; // TSCADC_IRQENB_FIFO0THRES;
49 }
50 tscadc_writel(ts_dev, TSCADC_REG_IRQENABLE, irqenable);
51
52--
531.7.9.4
54