diff options
| author | Koen Kooi <koen@openembedded.org> | 2010-05-09 10:54:01 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@openembedded.org> | 2010-05-10 17:24:41 +0200 |
| commit | 1a733aa29a95816cc344bb38441338963f1e0180 (patch) | |
| tree | bad752108628af4b7c6431a833b789815c751fde /recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch | |
| parent | acd000615cb77c4805f43df177fbe08cd2244195 (diff) | |
linux-omap-psp 2.6.32: rediff touchbook and beagleboard patches, tweak beagleboard defconfig
Diffstat (limited to 'recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch')
| -rw-r--r-- | recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch new file mode 100644 index 0000000000..a90245abd3 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0018-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch @@ -0,0 +1,53 @@ +From 551a2a661a3b55820560a30fb19c6df10086b91f Mon Sep 17 00:00:00 2001 +From: Steve Sakoman <sakoman@gmail.com> +Date: Tue, 15 Dec 2009 15:24:10 -0800 +Subject: [PATCH 18/43] drivers: input: touchscreen: ads7846: return ENODEV if device is not found + +Signed-off-by: Steve Sakoman <sakoman@gmail.com> +--- + drivers/input/touchscreen/ads7846.c | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c +index e53ac1f..45287ab 100644 +--- a/drivers/input/touchscreen/ads7846.c ++++ b/drivers/input/touchscreen/ads7846.c +@@ -1165,9 +1165,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; +@@ -1188,7 +1195,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) +@@ -1216,7 +1223,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) +-- +1.6.6.1 + |
