summaryrefslogtreecommitdiff
path: root/meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin@buglabs.net>2009-04-27 16:41:24 +0200
committerMarcin Juszkiewicz <marcin@buglabs.net>2009-04-28 18:09:45 +0200
commit0adc74b06210f1be01145a5977a36b83aca0aa68 (patch)
tree378495bdf474a70afef101f9e1859953d8826129 /meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch
parentd65be3dd2aaa643b5596c8470caf7f291513efee (diff)
downloadopenembedded-core-0adc74b06210f1be01145a5977a36b83aca0aa68.tar.gz
openembedded-core-0adc74b06210f1be01145a5977a36b83aca0aa68.tar.bz2
openembedded-core-0adc74b06210f1be01145a5977a36b83aca0aa68.tar.xz
openembedded-core-0adc74b06210f1be01145a5977a36b83aca0aa68.zip
beagleboard: added 2.6.29 kernel from OE
tested on B7 Signed-off-by: Marcin Juszkiewicz <marcin@buglabs.net>
Diffstat (limited to 'meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch')
-rw-r--r--meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch b/meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch
new file mode 100644
index 000000000..25a1cb052
--- /dev/null
+++ b/meta/packages/linux/linux-omap-2.6.29/ads7846-detection.patch
@@ -0,0 +1,41 @@
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 2ae5ab8..a68b0a6 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -1154,9 +1154,16 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ /* take a first sample, leaving nPENIRQ active and vREF off; avoid
+ * the touchscreen, in case it's not connected.
+ */
+- (void) ads7846_read12_ser(&spi->dev,
++ err = ads7846_read12_ser(&spi->dev,
+ READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
+
++ /* if sample is all 0's or all 1's then there is no device on spi */
++ if ( (err == 0x000) || (err == 0xfff)) {
++ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
++ err = -ENODEV;
++ goto err_free_irq;
++ }
++
+ err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
+ if (err)
+ goto err_remove_hwmon;
+@@ -1174,7 +1181,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ err_free_irq:
+ free_irq(spi->irq, ts);
+ err_free_gpio:
+- if (ts->gpio_pendown != -1)
++ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
+ gpio_free(ts->gpio_pendown);
+ err_cleanup_filter:
+ if (ts->filter_cleanup)
+@@ -1201,7 +1208,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
+ /* suspend left the IRQ disabled */
+ enable_irq(ts->spi->irq);
+
+- if (ts->gpio_pendown != -1)
++ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
+ gpio_free(ts->gpio_pendown);
+
+ if (ts->filter_cleanup)
+