History log of /include/linux/spi/ads7846.h
Revision Date Author Comments
c4f4925439f13a243aecfb36c693613603c0bfbd 21-Nov-2012 Igor Grinberg <grinberg@compulab.co.il> Input: ads7846 - enable pendown GPIO debounce time setting

Some platforms need the pendown GPIO debounce time setting programmed.
Since the pendown GPIO is handled by the driver, the debounce time
should also be handled along with the pendown GPIO request.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
ebcaaad9d5e8fd284b8dcf25a24999420f0f56d8 12-May-2011 Alexander Stein <alexander.stein@systec-electronic.com> Input: ads7846 - add possibility to use external vref on ads7846

Just set vref_mv in your platform config to use external vref. Otherwise
the internal one is used.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
0f622bf465e78c390e13c5f4a14d0b3f8fb7c7e5 01-Jul-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> Input: ads7846 - do not allow altering platform data

Tested-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
7804302b14032d357d889e4a23e463eb6a6c5136 28-Jun-2010 Anatolij Gustschin <agust@denx.de> Input: ads7846 - allow specifying irq trigger type in platform data

On some platforms, for example with GPIO interrupts on mpc5121,
it is not possible to configure falling edge interrupts.

Specifying irq trigger type in platform data structure
allows using ads7846 driver on such platforms.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
fdba2bb1f2eed85085a0fe154e1acb82de3239f7 11-Mar-2010 Ranjith Lohithakshan <ranjithl@ti.com> Input: ads7846 - add wakeup support

Add wakeup support to the ads7846 driver. Platforms can enable wakeup
capability by setting the wakeup flag in ads7846_platform_data. With this
patch the ads7846 driver can be used to wake the system from suspend.

Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
06a09124b5ec65f81df66c56695d9a9ae04a0114 10-Mar-2010 Michael Hennerich <michael.hennerich@analog.com> 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>
86579a4cccf18a2ddbf7de8fc5a0f5d9b94ed76d 19-May-2009 Michael Roth <mroth@nessie.de> Input: ads7846 - support swapping x and y axes

Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
fd746d540abf8c686f5f868ae62112692e684088 12-Apr-2009 Eric Miao <eric.miao@marvell.com> Input: ads7846 - introduce platform specific way to synchronize sampling

Noises can be introduced when LCD signals are being driven, some platforms
provide a signal to assist the synchronization of this sampling procedure.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
6ae19b04ab41a4db0f0c48ec0b78950f6b028823 10-Sep-2008 Eric Miao <eric.y.miao@gmail.com> Input: ads7846 - introduce .gpio_pendown to get pendown state

The GPIO connected to ADS7846 nPENIRQ signal is usually used to get
the pendown state as well. Introduce a .gpio_pendown, and use this
to decide the pendown state if .get_pendown_state is NULL.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
4d5975e5016a9025814b92981de21eaf9203caa6 10-Sep-2008 Eric Miao <eric.y.miao@gmail.com> Input: ads7846 - introduce .gpio_pendown to get pendown state

The GPIO connected to ADS7846 nPENIRQ signal is usually used to get
the pendown state as well. Introduce a .gpio_pendown, and use this
to decide the pendown state if .get_pendown_state is NULL.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
7c6d0ee14cb7a4cfad4864dc196256da5749bc0c 02-Apr-2008 David Brownell <david-b@pacbell.net> Input: ads7846 - simplify support of external vREF (and ads7843)

This updates the ads7846 driver to handle external vREF (required
on boards using ads7843 chips) without module parameters, and also
removes a needless variable with its associated bogus gcc warning.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1d25891f3241103d14ea78236504474a138b8ada 18-Jul-2007 Semih Hazar <semih.hazar@indefia.com> Input: ads7846 - re-check pendown status before reporting events

Pendown status from the PENIRQ pin is currently read only at the beginning
of a sample set. If the pen is lifted just after sampling has began then
sampled values become wrong.

This patch adds an optional platform penirq_recheck_delay attribute. If
non-zero, samples are only reported to the input subsystem if PENIRQ is
still active that long after the samples taken.

Signed-off-by: Semih Hazar <semih.hazar@indefia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
e4f48861993294c27849076741eb0c090482560b 18-Jul-2007 Semih Hazar <semih.hazar@indefia.com> Input: ads7846 - introduce sample settling delay

The ads7846 driver has support for filtering, but when the chip gets
deselected between samples this causes noise. This patch adds support
for an optional settling delay time, so that two consecutive samples
will be taken with the specified delay time apart. This ensures that
the chip won't be deselected, so the noise won't appear.

Filtering can still be done, but will have less work to do since each
time a new sample is taken the same delay applies.

Signed-off-by: Semih Hazar <semih.hazar@indefia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
de2defd96d7d92fe8b5f9cf2bfd385d8d4819923 18-Jan-2007 Imre Deak <imre.deak@solidboot.com> Input: ads7846 - optionally leave Vref on during differential measurements

On some LCDs leaving the Vref on provides much better readings.

Signed-off-by: Jarkko Oikarinen <jarkko.oikarinen@nokia.com>
Signed-off-by: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
da970e69efb9fd0be0c23ace5bde42d4caf17b40 18-Jan-2007 Imre Deak <imre.deak@solidboot.com> Input: ads7846 - pluggable filtering logic

Some LCDs like the LS041Y3 require a customized filtering
logic for reliable readings, so make the filtering function
replacable through platform specific hooks.

Signed-off-by: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
d5b415c95f0e6510451f1446cea832c1f77bd7ea 26-Apr-2006 Imre Deak <imre.deak@nokia.com> Input: ads7846 - improve filtering for thumb press accuracy

Providing more accurate coordinates for thumb press requires additional
steps in the filtering logic:

- Ignore samples found invalid by the debouncing logic, or the ones that
have out of bound pressure value.
- Add a parameter to repeat debouncing, so that more then two consecutive
good readings are required for a valid sample.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Acked-by: Juha Yrjola <juha.yrjola@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
c9e617a563ad646239270fa2222cdb06966cf1fa 12-Apr-2006 Imre Deak <imre.deak@nokia.com> Input: ads7846 - handle IRQs that were latched during disabled IRQs

The pen down IRQ will toggle during each X,Y,Z measurement cycle.
Even though the IRQ is disabled it will be latched and delivered
when after enable_irq. Thus in the IRQ handler we must avoid
starting a new measurement cycle when such an "unwanted" IRQ happens.
Add a get_pendown_state platform function, which will probably
determine this by reading the current GPIO level of the pen IRQ pin.

Move the IRQ reenabling from the SPI RX function to the timer. After
the last power down message the pen IRQ pin is still active for a
while and get_pendown_state would report incorrectly a pen down state.

When suspending we should check the ts->pending flag instead of
ts->pendown, since the timer can be pending regardless of ts->pendown.
Also if ts->pending is set we can be sure that the timer is running,
so no need to rearm it. Similarly if ts->pending is not set we can
be sure that the IRQ is enabled (and the timer is not).

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
0b7018aae7e1798f55f736b9a77c201708aa0e33 12-Apr-2006 Imre Deak <imre.deak@nokia.com> Input: ads7846 - debouncing and rudimentary sample filtering

Some touchscreens seem to oscillate heavily for a while after touching
the screen.  Implement support for sampling the screen until we get two
consecutive values that are close enough.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Juha Yrjola <juha.yrjola@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2e5a7bd978bf4118a0c8edf2e6ff81d0a72fee47 08-Jan-2006 David Brownell <david-b@pacbell.net> [PATCH] spi: ads7836 uses spi_driver

This updates the ads7864 driver to use the new "spi_driver" struct, and
includes some minor unrelated cleanup.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ffa458c1bd9b6f653008d450f337602f3d52a646 08-Jan-2006 David Brownell <david-b@pacbell.net> [PATCH] spi: ads7846 driver

This is a driver for the ADS7846 touchscreen sensor, derived from
the corgi_ts and omap_ts drivers. Key differences from those two:

- Uses the new SPI framework (minimalist version)
- <linux/spi/ads7846.h> abstracts board-specific touchscreen info
- Sysfs attributes for the temperature and voltage sensors
- Uses fewer ARM-specific IRQ primitives

The temperature and voltage sensors show up in sysfs like this:

$ pwd
/sys/devices/platform/omap-uwire/spi2.0
$ ls
bus@ input:event0@ power/ temp1 vbatt
driver@ modalias temp0 vaux
$ cat modalias
ads7846
$ cat temp0
991
$ cat temp1
1177
$

So far only basic testing has been done. There's a fair amount of hardware
that uses this sensor, and which also runs Linux, which should eventually
be able to use this driver.

One portability note may be of special interest. It turns out that not all
SPI controllers are happy issuing requests that do things like "write 8 bit
command, read 12 bit response". Most of them seem happy to handle various
word sizes, so the issue isn't "12 bit response" but rather "different rx
and tx write sizes", despite that being a common MicroWire convention. So
this version of the driver no longer reads 12 bit native-endian words; it
reads 16-bit big-endian responses, then byteswaps them and shifts the
results to discard the noise.

Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>