aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-12-05spi: use simplified spi_sync() calling conventionMarc Pignat1-7/+6
Given the patch which simplifies the spi_sync calling convention, this one updates the callers of that routine which tried using it according to the previous specification. (Most didn't.) Signed-off-by: Marc Pignat <marc.pignat@hevs.ch> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby1-2/+2
get rid of input BIT* duplicate defines use newly global defined macros for input layer. Also remove includes of input.h from non-input sources only for BIT macro definiton. Define the macro temporarily in local manner, all those local definitons will be removed further in this patchset (to not break bisecting). BIT macro will be globally defined (1<<x) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <dtor@mail.ru> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: <lenb@kernel.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: <perex@suse.cz> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <vernux@us.ibm.com> Cc: <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-09hwmon: Convert from class_device to deviceTony Jones1-2/+2
Convert from class_device to device for hwmon_device_register/unregister Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
2007-07-18Input: ads7846 - re-check pendown status before reporting eventsSemih Hazar1-0/+15
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>
2007-07-18Input: ads7846 - introduce sample settling delaySemih Hazar1-1/+64
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>
2007-05-22Input: ads7846 - SPI_CPHA mode bugfixSemih Hazar1-1/+1
In commit [1] the SPI mode is set to 1, but it should be 0. As stated in the commit, ads784x samples the data on the rising edge. SPI mode 1 samples on the falling edge [2] though. The root cause of this is a bug in the omap_uwire code, which treats CPHA=1 incorrectly; so these two bugs cancel each other out on one of the main regression test platforms for this driver. [1] kernel.org GIT 7937e86a70235e1584486654687dc9908a11e00a [2] http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-05-22Input: ads7846 - document that it handles tsc2046 tooDavid Brownell1-0/+1
The TSC2046 is an updated version of the ADS7846 ... mention that in the Kconfig helptext and driver source. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-04-12Input: touchscreens - switch to using input_dev->dev.parentDmitry Torokhov1-1/+1
In preparation for struct class_device -> struct device input core conversion, switch to using input_dev->dev.parent when specifying device position in sysfs tree. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-02-28Input: ads7846 - add support for the ads7843 touchscreenNicolas Ferre1-13/+15
The ads7843 support has now become almost trivial since the last rework. Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-02-16[PATCH] hrtimers: namespace and enum cleanupThomas Gleixner1-5/+6
- hrtimers did not use the hrtimer_restart enum and relied on the implict int representation. Fix the prototypes and the functions using the enums. - Use seperate name spaces for the enumerations - Convert hrtimer_restart macro to inline function - Add comments No functional changes. [akpm@osdl.org: fix input driver] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: john stultz <johnstul@us.ibm.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-18Input: ads7846 - be more compatible with the hwmon frameworkDavid Brownell1-89/+217
- Hook up to hwmon * show sensor attributes only if hwmon is present * ... and the board's reference voltage is known * otherwise be just a touchscreen - Report voltages per hwmon convention * measure in millivolts * voltages are named in[0-8]_input (ugh) * for 7846 chips, properly range-adjust vBATT/in1_input Battery measurements help during recharge monitoring. On OSK/Mistral, the measured voltage agreed with a multimeter to several decimal places. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-01-18Input: ads7846 - detect pen up from GPIO stateImre Deak1-39/+41
We can't depend on the pressure value to determine when the pen was lifted, so use the GPIO line state instead. This also helps with chips (like ads7843) that don't have pressure sensors. 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>
2007-01-18Input: ads7846 - select correct SPI modeImre Deak1-0/+4
Talk to ADS7846 chip using SPI mode 1, which is what the chip supports: writes on falling clock edge, reads on rising. Signed-off-by: Imre Deak <imre.deak@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-01-18Input: ads7846 - switch to using hrtimerImre Deak1-11/+15
Use hrtimer instead of the normal timer, since it provides better sampling resolution. This will: - avoid a problem where we have a 1 jiffy poll period and dynamic tick on - utilize high resolution HW clocks when they are added to the hrtimer framework 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>
2007-01-18Input: ads7846 - optionally leave Vref on during differential measurementsImre Deak1-13/+17
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>
2007-01-18Input: ads7846 - pluggable filtering logicImre Deak1-40/+95
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>
2006-12-08Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov1-1/+1
Conflicts: drivers/usb/input/hid.h
2006-12-07[PATCH] slab: remove SLAB_KERNELChristoph Lameter1-1/+1
SLAB_KERNEL is an alias of GFP_KERNEL. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-02Input: ads7846 - handle errors from sysfsDmitry Torokhov1-34/+61
Add sysfs error handling and switch to using attribute groups to simplify it. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-1/+1
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-07-02[PATCH] irq-flags: misc drivers: Use the new IRQF_ constantsThomas Gleixner1-1/+1
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-25[PATCH] random: remove redundant SA_SAMPLE_RANDOM from touchscreen driversMatt Mackall1-2/+1
The core input layer is already calling add_input_randomness. Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Dmitry Torokhov <dtor_core@ameritech.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-05-26[PATCH] ads7846 conversion accuracyDavid Brownell1-25/+28
This improves accuracy of the touchscreen and hwmon sensor readings, addressing an issue noted by Imre Deak: there's an extra bit written before the sample (12 bits) gets written out. It also catches up to various comments, and makes the /proc/interrupts entry sensible again. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Imre Deak <imre.deak@nokia.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Dmitry Torokhov <dtor_core@ameritech.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-26Input: ads7846 - improve filtering for thumb press accuracyImre Deak1-15/+57
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>
2006-04-26Input: ads7846 - report 0 pressure value along with pen up eventImre Deak1-2/+4
X touchscreen drivers that don't interpret the designated pen up message assume a pen up event from a pressure value 0. For these we generate a pressure 0 message along with the pen up message. 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>
2006-04-11Input: ads7846 - handle IRQs that were latched during disabled IRQsImre Deak1-34/+48
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>
2006-04-11Input: ads7846 - miscellaneous fixesImre Deak1-30/+114
- Add disable attribute to support device locking mode where unintentional touch event shouldn't wake up the system; - Update comments; - Add missing spin_lock_init; - Do device resume with the lock held; - Do cleanup calls / free memory in the reverse order of initialization. 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>
2006-04-11Input: ads7846 - use msleep() instead of udelay() in suspendJuha Yrjola1-1/+1
Sometimes a polling loop had a hard time changing state without pre-emption enabled. Use msleep instead, it's better anyway. 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>
2006-04-11Input: ads7846 - debouncing and rudimentary sample filteringImre Deak1-38/+118
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>
2006-04-11Input: ads7846 - power down ADC a bit laterImre Deak1-3/+18
Submit a seperate request for powering down the ADC in ads7846, doing it after the last read request. Otherwise some of the read values are incorrect. 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>
2006-04-11Input: ads7846 - add pen_down sysfs attributeImre Deak1-0/+19
It's handy for userspace diagnostics to see the pen down status, to see whether the touchscreen is "stuck" (shortcircuited). 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>
2006-03-26[PATCH] ads7846: sparc32 warning fixAndrew Morton1-1/+1
drivers/input/touchscreen/ads7846.c: In function `ads7846_read12_ser': drivers/input/touchscreen/ads7846.c:207: warning: implicit declaration of function `disable_irq' drivers/input/touchscreen/ads7846.c:209: warning: implicit declaration of function `enable_irq' Cc: Dmitry Torokhov <dtor_core@ameritech.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25[PATCH] ads7846 build fixAndrew Morton1-0/+1
sparc32: drivers/input/touchscreen/ads7846.c: In function `ads7846_read12_ser': drivers/input/touchscreen/ads7846.c:206: warning: implicit declaration of function `disable_irq' drivers/input/touchscreen/ads7846.c:208: warning: implicit declaration of function `enable_irq' Cc: Dmitry Torokhov <dtor_core@ameritech.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-15Input: ads7846 - assorted updatesDavid Brownell1-24/+44
This updates the ads7846 touchscreen driver: - to allow faster clocking (this driver doesn't push sample rates); - bugfixes the conversion of spi_transfer to lists; - some dma-unsafe command buffers are fixed. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-02-15Input: ads7846 - convert to to dynamic input_dev allocationDmitry Torokhov1-32/+47
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-01-19[ARM] Convert request_irq+set_irq_type to request_irq with SA_TRIGGERRussell King1-6/+3
There's no need to have request_irq followed by set_irq_type. Just use request_irq with the appropriate SA_TRIGGER flags. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-13[PATCH] spi: use linked lists rather than an arrayVitaly Wool1-4/+8
This makes the SPI core and its users access transfers in the SPI message structure as linked list not as an array, as discussed on LKML. From: David Brownell <dbrownell@users.sourceforge.net> Updates including doc, bugfixes to the list code, add spi_message_add_tail(). Plus, initialize things _before_ grabbing the locks in some cases (in case it grows more expensive). This also merges some bitbang updates of mine that didn't yet make it into the mm tree. Signed-off-by: Vitaly Wool <vwool@ru.mvista.com> Signed-off-by: Dmitry Pervushin <dpervushin@gmail.com> 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>
2006-01-13[PATCH] spi: ads7836 uses spi_driverDavid Brownell1-42/+42
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>
2006-01-13[PATCH] spi: ads7846 driverDavid Brownell1-0/+621
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>