diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch new file mode 100644 index 00000000..f753684a --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 078005a9c8b5913ed5eb7a7a9508e4b0a5b18c30 Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <sakoman@gmail.com> | ||
3 | Date: Tue, 15 Dec 2009 15:24:10 -0800 | ||
4 | Subject: [PATCH 09/32] drivers: input: touchscreen: ads7846: return ENODEV if device is not found | ||
5 | |||
6 | Signed-off-by: Steve Sakoman <sakoman@gmail.com> | ||
7 | --- | ||
8 | drivers/input/touchscreen/ads7846.c | 13 ++++++++++--- | ||
9 | 1 files changed, 10 insertions(+), 3 deletions(-) | ||
10 | |||
11 | diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c | ||
12 | index 1de1c19..097db10 100644 | ||
13 | --- a/drivers/input/touchscreen/ads7846.c | ||
14 | +++ b/drivers/input/touchscreen/ads7846.c | ||
15 | @@ -1338,11 +1338,18 @@ static int __devinit ads7846_probe(struct spi_device *spi) | ||
16 | * the touchscreen, in case it's not connected. | ||
17 | */ | ||
18 | if (ts->model == 7845) | ||
19 | - ads7845_read12_ser(&spi->dev, PWRDOWN); | ||
20 | + err = ads7845_read12_ser(&spi->dev, PWRDOWN); | ||
21 | else | ||
22 | - (void) ads7846_read12_ser(&spi->dev, | ||
23 | + err = ads7846_read12_ser(&spi->dev, | ||
24 | READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON); | ||
25 | |||
26 | + /* if sample is all 0's or all 1's then there is no device on spi */ | ||
27 | + if ( (err == 0x000) || (err == 0xfff)) { | ||
28 | + dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err); | ||
29 | + err = -ENODEV; | ||
30 | + goto err_free_irq; | ||
31 | + } | ||
32 | + | ||
33 | err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group); | ||
34 | if (err) | ||
35 | goto err_remove_hwmon; | ||
36 | @@ -1366,7 +1373,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | ||
37 | err_put_regulator: | ||
38 | regulator_put(ts->reg); | ||
39 | err_free_gpio: | ||
40 | - if (!ts->get_pendown_state) | ||
41 | + if (!ts->get_pendown_state && ts->gpio_pendown != -1) | ||
42 | gpio_free(ts->gpio_pendown); | ||
43 | err_cleanup_filter: | ||
44 | if (ts->filter_cleanup) | ||
45 | -- | ||
46 | 1.6.6.1 | ||
47 | |||