1 From dd9c33edf9c2734a7107c96c61d3ffcea90837f4 Mon Sep 17 00:00:00 2001
2 From: Gregoire Gentil <gregoire@gentil.com>
3 Date: Fri, 12 Mar 2010 13:50:52 +0100
4 Subject: [PATCH 09/14] ads7846: add settling delay to pdata
7 drivers/input/touchscreen/ads7846.c | 22 ++++++++++++++++++++++
8 1 files changed, 22 insertions(+), 0 deletions(-)
10 diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
11 index 56b0ffd..1d9f97c 100644
12 --- a/drivers/input/touchscreen/ads7846.c
13 +++ b/drivers/input/touchscreen/ads7846.c
14 @@ -515,6 +515,26 @@ static ssize_t show_x_plate_ohms(struct device *dev, struct device_attribute *at
15 return sprintf(buf, "%u\n", ts->x_plate_ohms);
18 +static ssize_t show_settle_delay_usecs(struct device *dev, struct device_attribute *attr, char *buf) {
19 + struct ads7846 *ts = dev_get_drvdata(dev);
20 + struct ads7846_platform_data *pdata = ts->spi->dev.platform_data;
22 + return sprintf(buf, "%u\n", pdata->settle_delay_usecs);
25 +static ssize_t write_settle_delay_usecs(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
26 + struct ads7846 *ts = dev_get_drvdata(dev);
27 + struct ads7846_platform_data *pdata = ts->spi->dev.platform_data;
31 + if (strict_strtoul(buf, 10, &i))
34 + pdata->settle_delay_usecs = i;
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);
41 @@ -563,6 +583,7 @@ static DEVICE_ATTR(debounce_max, S_IRUGO | S_IWUGO, show_debounce_max, write_deb
42 static DEVICE_ATTR(debounce_tol, S_IRUGO | S_IWUGO, show_debounce_tol, write_debounce_tol);
43 static DEVICE_ATTR(debounce_rep, S_IRUGO | S_IWUGO, show_debounce_rep, write_debounce_rep);
44 static DEVICE_ATTR(x_plate_ohms, S_IRUGO | S_IWUGO, show_x_plate_ohms, write_x_plate_ohms);
45 +static DEVICE_ATTR(settle_delay_usecs, S_IRUGO | S_IWUGO, show_settle_delay_usecs, write_settle_delay_usecs);
47 static struct attribute *ads784x_attributes[] = {
48 &dev_attr_pen_down.attr,
49 @@ -571,6 +592,7 @@ static struct attribute *ads784x_attributes[] = {
50 &dev_attr_debounce_tol.attr,
51 &dev_attr_debounce_rep.attr,
52 &dev_attr_x_plate_ohms.attr,
53 + &dev_attr_settle_delay_usecs.attr,