qt4-*-gles 4.6.2: add 'depth' argument to configure, bump PR
[openembedded.git] / recipes / linux / linux-omap-psp-2.6.32 / omap3-touchbook / 0007-adf7846-add-more-debugging.patch
blobd5942c89963aabd57711c82a93fa483dccf9eba0
1 From 1b90e477d484f666ba2224b950b2810fcaf53df2 Mon Sep 17 00:00:00 2001
2 From: Gregoire Gentil <gregoire@gentil.com>
3 Date: Fri, 12 Mar 2010 13:50:38 +0100
4 Subject: [PATCH 07/14] adf7846: add more debugging
6 ---
7 drivers/input/touchscreen/ads7846.c | 73 +++++++++++++++++++++++++++++++++++
8 1 files changed, 73 insertions(+), 0 deletions(-)
10 diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
11 index 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,
16 static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
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);
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);
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);
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);
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;
42 + if (strict_strtoul(buf, 10, &i))
43 + return -EINVAL;
45 + ts->debounce_max = i;
46 + return count;
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;
53 + if (strict_strtoul(buf, 10, &i))
54 + return -EINVAL;
56 + ts->debounce_tol = i;
57 + return count;
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;
64 + if (strict_strtoul(buf, 10, &i))
65 + return -EINVAL;
67 + ts->debounce_rep = i;
68 + return count;
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;
75 + if (strict_strtoul(buf, 10, &i))
76 + return -EINVAL;
78 + ts->x_plate_ohms = i;
79 + return count;
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);
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,
97 --
98 1.6.6.1