aboutsummaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-adf7846-add-more-debugging.patch
blob: f15e0a2e507eb141d5e9cdcdf08ec2c79bdb915b (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From e00ae0c0fa35b4b67bbc905581c2c7bde0e29901 Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <gregoire@gentil.com>
Date: Fri, 12 Mar 2010 13:50:38 +0100
Subject: [PATCH 05/17] adf7846: add more debugging

---
 drivers/input/touchscreen/ads7846.c |   73 +++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 45287ab..ebdeeeb 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -495,9 +495,82 @@ static ssize_t ads7846_disable_store(struct device *dev,
 
 static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
 
+static ssize_t show_debounce_max(struct device *dev, struct device_attribute *attr, char *buf) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	return sprintf(buf, "%u\n", ts->debounce_max);
+}
+
+static ssize_t show_debounce_tol(struct device *dev, struct device_attribute *attr, char *buf) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	return sprintf(buf, "%u\n", ts->debounce_tol);
+}
+
+static ssize_t show_debounce_rep(struct device *dev, struct device_attribute *attr, char *buf) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	return sprintf(buf, "%u\n", ts->debounce_rep);
+}
+
+static ssize_t show_x_plate_ohms(struct device *dev, struct device_attribute *attr, char *buf) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	return sprintf(buf, "%u\n", ts->x_plate_ohms);
+}
+
+static ssize_t write_debounce_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	unsigned long i;
+
+        if (strict_strtoul(buf, 10, &i))
+		return -EINVAL;
+
+	ts->debounce_max = i;
+	return count;
+}
+
+static ssize_t write_debounce_tol(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	unsigned long i;
+
+        if (strict_strtoul(buf, 10, &i))
+		return -EINVAL;
+
+	ts->debounce_tol = i;
+	return count;
+}
+
+static ssize_t write_debounce_rep(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	unsigned long i;
+
+        if (strict_strtoul(buf, 10, &i))
+		return -EINVAL;
+
+	ts->debounce_rep = i;
+	return count;
+}
+
+static ssize_t write_x_plate_ohms(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
+	struct ads7846 *ts = dev_get_drvdata(dev);
+	unsigned long i;
+
+        if (strict_strtoul(buf, 10, &i))
+		return -EINVAL;
+
+	ts->x_plate_ohms = i;
+	return count;
+}
+
+static DEVICE_ATTR(debounce_max, S_IRUGO | S_IWUGO, show_debounce_max, write_debounce_max);
+static DEVICE_ATTR(debounce_tol, S_IRUGO | S_IWUGO, show_debounce_tol, write_debounce_tol);
+static DEVICE_ATTR(debounce_rep, S_IRUGO | S_IWUGO, show_debounce_rep, write_debounce_rep);
+static DEVICE_ATTR(x_plate_ohms, S_IRUGO | S_IWUGO, show_x_plate_ohms, write_x_plate_ohms);
+
 static struct attribute *ads784x_attributes[] = {
 	&dev_attr_pen_down.attr,
 	&dev_attr_disable.attr,
+	&dev_attr_debounce_max.attr,
+	&dev_attr_debounce_tol.attr,
+	&dev_attr_debounce_rep.attr,
+	&dev_attr_x_plate_ohms.attr,
 	NULL,
 };
 
-- 
1.6.6.1