summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch
new file mode 100644
index 0000000000..25a1cb052c
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/ads7846-detection.patch
@@ -0,0 +1,41 @@
1diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
2index 2ae5ab8..a68b0a6 100644
3--- a/drivers/input/touchscreen/ads7846.c
4+++ b/drivers/input/touchscreen/ads7846.c
5@@ -1154,9 +1154,16 @@ static int __devinit ads7846_probe(struct spi_device *spi)
6 /* take a first sample, leaving nPENIRQ active and vREF off; avoid
7 * the touchscreen, in case it's not connected.
8 */
9- (void) ads7846_read12_ser(&spi->dev,
10+ err = ads7846_read12_ser(&spi->dev,
11 READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
12
13+ /* if sample is all 0's or all 1's then there is no device on spi */
14+ if ( (err == 0x000) || (err == 0xfff)) {
15+ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
16+ err = -ENODEV;
17+ goto err_free_irq;
18+ }
19+
20 err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
21 if (err)
22 goto err_remove_hwmon;
23@@ -1174,7 +1181,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
24 err_free_irq:
25 free_irq(spi->irq, ts);
26 err_free_gpio:
27- if (ts->gpio_pendown != -1)
28+ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
29 gpio_free(ts->gpio_pendown);
30 err_cleanup_filter:
31 if (ts->filter_cleanup)
32@@ -1201,7 +1208,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
33 /* suspend left the IRQ disabled */
34 enable_irq(ts->spi->irq);
35
36- if (ts->gpio_pendown != -1)
37+ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
38 gpio_free(ts->gpio_pendown);
39
40 if (ts->filter_cleanup)
41