summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch
new file mode 100644
index 00000000..f15e0a2e
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch
@@ -0,0 +1,99 @@
1From e00ae0c0fa35b4b67bbc905581c2c7bde0e29901 Mon Sep 17 00:00:00 2001
2From: Gregoire Gentil <gregoire@gentil.com>
3Date: Fri, 12 Mar 2010 13:50:38 +0100
4Subject: [PATCH 05/17] adf7846: add more debugging
5
6---
7 drivers/input/touchscreen/ads7846.c | 73 +++++++++++++++++++++++++++++++++++
8 1 files changed, 73 insertions(+), 0 deletions(-)
9
10diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
11index 45287ab..ebdeeeb 100644
12--- a/drivers/input/touchscreen/ads7846.c
13+++ b/drivers/input/touchscreen/ads7846.c
14@@ -495,9 +495,82 @@ static ssize_t ads7846_disable_store(struct device *dev,
15
16 static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
17
18+static ssize_t show_debounce_max(struct device *dev, struct device_attribute *attr, char *buf) {
19+ struct ads7846 *ts = dev_get_drvdata(dev);
20+ return sprintf(buf, "%u\n", ts->debounce_max);
21+}
22+
23+static ssize_t show_debounce_tol(struct device *dev, struct device_attribute *attr, char *buf) {
24+ struct ads7846 *ts = dev_get_drvdata(dev);
25+ return sprintf(buf, "%u\n", ts->debounce_tol);
26+}
27+
28+static ssize_t show_debounce_rep(struct device *dev, struct device_attribute *attr, char *buf) {
29+ struct ads7846 *ts = dev_get_drvdata(dev);
30+ return sprintf(buf, "%u\n", ts->debounce_rep);
31+}
32+
33+static ssize_t show_x_plate_ohms(struct device *dev, struct device_attribute *attr, char *buf) {
34+ struct ads7846 *ts = dev_get_drvdata(dev);
35+ return sprintf(buf, "%u\n", ts->x_plate_ohms);
36+}
37+
38+static ssize_t write_debounce_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
39+ struct ads7846 *ts = dev_get_drvdata(dev);
40+ unsigned long i;
41+
42+ if (strict_strtoul(buf, 10, &i))
43+ return -EINVAL;
44+
45+ ts->debounce_max = i;
46+ return count;
47+}
48+
49+static ssize_t write_debounce_tol(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
50+ struct ads7846 *ts = dev_get_drvdata(dev);
51+ unsigned long i;
52+
53+ if (strict_strtoul(buf, 10, &i))
54+ return -EINVAL;
55+
56+ ts->debounce_tol = i;
57+ return count;
58+}
59+
60+static ssize_t write_debounce_rep(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
61+ struct ads7846 *ts = dev_get_drvdata(dev);
62+ unsigned long i;
63+
64+ if (strict_strtoul(buf, 10, &i))
65+ return -EINVAL;
66+
67+ ts->debounce_rep = i;
68+ return count;
69+}
70+
71+static ssize_t write_x_plate_ohms(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
72+ struct ads7846 *ts = dev_get_drvdata(dev);
73+ unsigned long i;
74+
75+ if (strict_strtoul(buf, 10, &i))
76+ return -EINVAL;
77+
78+ ts->x_plate_ohms = i;
79+ return count;
80+}
81+
82+static DEVICE_ATTR(debounce_max, S_IRUGO | S_IWUGO, show_debounce_max, write_debounce_max);
83+static DEVICE_ATTR(debounce_tol, S_IRUGO | S_IWUGO, show_debounce_tol, write_debounce_tol);
84+static DEVICE_ATTR(debounce_rep, S_IRUGO | S_IWUGO, show_debounce_rep, write_debounce_rep);
85+static DEVICE_ATTR(x_plate_ohms, S_IRUGO | S_IWUGO, show_x_plate_ohms, write_x_plate_ohms);
86+
87 static struct attribute *ads784x_attributes[] = {
88 &dev_attr_pen_down.attr,
89 &dev_attr_disable.attr,
90+ &dev_attr_debounce_max.attr,
91+ &dev_attr_debounce_tol.attr,
92+ &dev_attr_debounce_rep.attr,
93+ &dev_attr_x_plate_ohms.attr,
94 NULL,
95 };
96
97--
981.6.6.1
99