diff options
| author | Michael Hennerich <michael.hennerich@analog.com> | 2010-03-09 23:38:45 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-03-10 01:12:45 -0500 |
| commit | 06a09124b5ec65f81df66c56695d9a9ae04a0114 (patch) | |
| tree | 6ae81521962ce1d013d00ae1d6915e528d8dc638 | |
| parent | 9e49f6c1339a7972e23a335c4c71a289b4c6f65b (diff) | |
Input: ads7846 - add support for AD7843 parts
The AD7873 is almost identical to the ADS7846; the only difference is
related to the Power Management bits PD0 and PD1. This results in a
slightly different PENIRQ enable behavior. For the AD7873, VREF should
be turned off during differential measurements.
So, add the AD7873/43 to the list of driver supported devices, and prevent
VREF usage during differential/ratiometric conversion modes.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
| -rw-r--r-- | drivers/input/touchscreen/Kconfig | 9 | ||||
| -rw-r--r-- | drivers/input/touchscreen/ads7846.c | 10 | ||||
| -rw-r--r-- | include/linux/spi/ads7846.h | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 7208654a94ae..8a8fa4d2d6a8 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -24,17 +24,18 @@ config TOUCHSCREEN_88PM860X | |||
| 24 | module will be called 88pm860x-ts. | 24 | module will be called 88pm860x-ts. |
| 25 | 25 | ||
| 26 | config TOUCHSCREEN_ADS7846 | 26 | config TOUCHSCREEN_ADS7846 |
| 27 | tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" | 27 | tristate "ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens" |
| 28 | depends on SPI_MASTER | 28 | depends on SPI_MASTER |
| 29 | depends on HWMON = n || HWMON | 29 | depends on HWMON = n || HWMON |
| 30 | help | 30 | help |
| 31 | Say Y here if you have a touchscreen interface using the | 31 | Say Y here if you have a touchscreen interface using the |
| 32 | ADS7846/TSC2046 or ADS7843 controller, and your board-specific | 32 | ADS7846/TSC2046/AD7873 or ADS7843/AD7843 controller, |
| 33 | setup code includes that in its table of SPI devices. | 33 | and your board-specific setup code includes that in its |
| 34 | table of SPI devices. | ||
| 34 | 35 | ||
| 35 | If HWMON is selected, and the driver is told the reference voltage | 36 | If HWMON is selected, and the driver is told the reference voltage |
| 36 | on your board, you will also get hwmon interfaces for the voltage | 37 | on your board, you will also get hwmon interfaces for the voltage |
| 37 | (and on ads7846/tsc2046, temperature) sensors of this chip. | 38 | (and on ads7846/tsc2046/ad7873, temperature) sensors of this chip. |
| 38 | 39 | ||
| 39 | If unsure, say N (but it's safe to say "Y"). | 40 | If unsure, say N (but it's safe to say "Y"). |
| 40 | 41 | ||
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 8b05d8e97543..d187be05955f 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | * TSC2046 is just newer ads7846 silicon. | 36 | * TSC2046 is just newer ads7846 silicon. |
| 37 | * Support for ads7843 tested on Atmel at91sam926x-EK. | 37 | * Support for ads7843 tested on Atmel at91sam926x-EK. |
| 38 | * Support for ads7845 has only been stubbed in. | 38 | * Support for ads7845 has only been stubbed in. |
| 39 | * Support for Analog Devices AD7873 and AD7843 tested. | ||
| 39 | * | 40 | * |
| 40 | * IRQ handling needs a workaround because of a shortcoming in handling | 41 | * IRQ handling needs a workaround because of a shortcoming in handling |
| 41 | * edge triggered IRQs on some platforms like the OMAP1/2. These | 42 | * edge triggered IRQs on some platforms like the OMAP1/2. These |
| @@ -984,6 +985,15 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
| 984 | 985 | ||
| 985 | vref = pdata->keep_vref_on; | 986 | vref = pdata->keep_vref_on; |
| 986 | 987 | ||
| 988 | if (ts->model == 7873) { | ||
| 989 | /* The AD7873 is almost identical to the ADS7846 | ||
| 990 | * keep VREF off during differential/ratiometric | ||
| 991 | * conversion modes | ||
| 992 | */ | ||
| 993 | ts->model = 7846; | ||
| 994 | vref = 0; | ||
| 995 | } | ||
| 996 | |||
| 987 | /* set up the transfers to read touchscreen state; this assumes we | 997 | /* set up the transfers to read touchscreen state; this assumes we |
| 988 | * use formula #2 for pressure, not #3. | 998 | * use formula #2 for pressure, not #3. |
| 989 | */ | 999 | */ |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 51948eb6927a..5710c15d394a 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
| @@ -12,7 +12,7 @@ enum ads7846_filter { | |||
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | struct ads7846_platform_data { | 14 | struct ads7846_platform_data { |
| 15 | u16 model; /* 7843, 7845, 7846. */ | 15 | u16 model; /* 7843, 7845, 7846, 7873. */ |
| 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
| 17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts */ |
| 18 | bool keep_vref_on; /* set to keep vref on for differential | 18 | bool keep_vref_on; /* set to keep vref on for differential |
