aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-03-09Input: ads7846 - add support for AD7843 partsMichael Hennerich1-0/+10
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>
2010-02-25Input: ads7846 - add regulator supportGrazvydas Ignotas1-1/+27
The ADS7846/TSC2046 touchscreen controllers can (and usually are) connected to various regulators for power, so add regulator support. Valid regulator will now be required, so boards without complete regulator setup should either disable regulator framework or enable CONFIG_REGULATOR_DUMMY. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-23Input: ads7846 - switch to using dev_vdbg()Pavel Machek1-16/+7
Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-23Input: ads7846 - fix pressure reportingPavel Machek1-1/+1
On Zaurus, hx4700 and others pressure is reported inverted -- the lighter the pressure, the bigger numerical value. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-09-23spi: prefix modalias with "spi:"Anton Vorontsov1-0/+1
This makes it consistent with other buses (platform, i2c, vio, ...). I'm not sure why we use the prefixes, but there must be a reason. This was easy enough to do it, and I did it. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Samuel Ortiz <sameo@openedhand.com> Cc: "John W. Linville" <linville@tuxdriver.com> Acked-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-11Input: ads7846 - pin change interrupt supportMichael Roth1-3/+9
Some SoCs support only pin change interrupts on GPIO pins used as irq lines. The ads7846 core is not affected from the additional irqs on the rising edge because the code accounts touch bounce anyway by kicking in a timer and disabling the irq after the first request and reenabling the irq after a timeout when there is no longer pen down detected. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-05-19Input: ads7846 - more detailed model name in sysfsMichael Roth1-1/+3
Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-05-19Input: ads7846 - support swapping x and y axesMichael Roth1-0/+7
Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-04-16Merge branch 'next' into for-linusDmitry Torokhov1-1/+11
2009-04-15Input: ads7846 - fix unsafe disable_irqBen Nizette1-1/+1
The use of disable_irq inside the handler for the interrupt being disabled has always been dangerous. disable_irq should wait for that handler to complete before returning -> deadlock. For some reason this wasn't actually the case until 3aa551c9b was merged but since this time, the ads7846 driver has deadlocked the system on first interrupt. Convert the driver to use the handler-safe _nosync variant. Signed-off-by: Ben Nizette <bn@niasdigital.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-04-11Input: ads7846 - introduce platform specific way to synchronize samplingEric Miao1-0/+10
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>
2009-03-30trivial: Fix misspelling of "Celsius".Adam Buchbinder1-1/+1
A few comments say "Celcius"; this fixes them. No code changes. Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-06Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-3/+3
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (29 commits) Input: i8042 - add Dell Vostro 1510 to nomux list Input: gtco - use USB endpoint API Input: add support for Maple controller as a joystick Input: atkbd - broaden the Dell DMI signatures Input: HIL drivers - add MODULE_ALIAS() Input: map_to_7segment.h - convert to __inline__ for userspace Input: add support for enhanced rotary controller on pxa930 and pxa935 Input: add support for trackball on pxa930 and pxa935 Input: add da9034 touchscreen support Input: ads7846 - strict_strtoul takes unsigned long Input: make some variables and functions static Input: add tsc2007 based touchscreen driver Input: psmouse - add module parameters to control OLPC touchpad delays Input: i8042 - add Gigabyte M912 netbook to noloop exception table Input: atkbd - Samsung NC10 key repeat fix Input: atkbd - add keyboard quirk for HP Pavilion ZV6100 laptop Input: libps2 - handle 0xfc responses from devices Input: add support for Wacom W8001 penabled serial touchscreen Input: synaptics - report multi-taps only if supported by the device Input: add joystick driver for Walkera WK-0701 RC transmitter ...
2008-12-23Input: ads7846 - strict_strtoul takes unsigned longHarvey Harrison1-1/+1
Fix sparse warning introduced by: commit 160f1fef7e52e974489b3c70fbd4e094c06965c2 Input: convert drivers to use strict_strtoul() Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-11-25hrtimer: removing all ur callback modesPeter Zijlstra1-2/+2
Impact: cleanup, move all hrtimer processing into hardirq context This is an attempt at removing some of the hrtimer complexity by reducing the number of callback modes to 1. This means that all hrtimer callback functions will be ran from HARD-irq context. I went through all the 30 odd hrtimer callback functions in the kernel and saw only one that I'm not quite sure of, which is the one in net/can/bcm.c - hence I'm CC-ing the folks responsible for that code. Furthermore, the hrtimer core now calls callbacks directly with IRQs disabled in case you try to enqueue an expired timer. If this timer is a periodic timer (which should use hrtimer_forward() to advance its time) then it might be possible to end up in an inf. recursive loop due to the fact that hrtimer_forward() doesn't round up to the next timer granularity, and therefore keeps on calling the callback - obviously this needs a fix. Aside from that, this seems to compile and actually boot on my dual core test box - although I'm sure there are some bugs in, me not hitting any makes me certain :-) Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-30Input: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers1-2/+2
Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-10-09Input: ads7846 - fix cache line sharing issueDmitry Torokhov1-36/+51
We had a report a while back that the ads7846 driver had some issues when used with DMA-based SPI controllers (like atmel_spi) on systems where main memory is not DMA-coherent (most non-x86 boards). Allocate memory potentially used for DMA separately to avoid cache line issues. Reported-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-10Input: ads7846 - introduce .gpio_pendown to get pendown stateEric Miao1-14/+54
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>
2008-09-10Input: convert drivers to use strict_strtoul()Joe Rouvier1-3/+4
strict_strtoul() allows newline character at the end of the the input string and therefore is more user-friendly. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2008-07-23Input: ads7846 - optimize order of calculating Rt in ads7846_rx()Hans-Christian Egtvedt1-5/+5
Alter the if expression for calculating Rt. The old implementation would run unnecessary code when the ADS7843 device was used. The patch also fixes the code style to kernel standard. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-07-23Input: ads7846 - fix sparse endian warningsHarvey Harrison1-4/+2
Also remove the temporary pointer and use ->rx_buf directly. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-25Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-12/+10
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (40 commits) Input: wacom - add support for Cintiq 20WSX Input: ucb1400_ts - IRQ probe fix Input: at32psif - update MODULE_AUTHOR with new email Input: mac_hid - add lockdep annotation to emumousebtn Input: i8042 - fix incorrect usage of strncpy and strncat Input: bf54x-keys - add infrastructure for keypad wakeups Input: add MODULE_ALIAS() to hotpluggable platform modules Input: drivers/char/keyboard.c - use time_after Input: fix ordering in joystick Makefile Input: wm97xx-core - support use as a wakeup source Input: wm97xx-core - use IRQF_SAMPLE_RANDOM Input: wm97xx-core - only schedule interrupt handler if not already scheduled Input: add Zhen Hua driver Input: aiptek - add support for Genius G-PEN 560 tablet Input: wacom - implement suspend and autosuspend Input: xpad - set proper buffer length for outgoing requests Input: omap-keypad - fix build warning Input: gpio_keys - irq handling cleanup Input: add PS/2 serio driver for AVR32 devices Input: put ledstate in the keyboard notifier ...
2008-04-14ARM: OMAP: 5912 OSK GPIO updatesDavid Brownell1-40/+0
Start cleaning up GPIO handling for OMAP5912 OSK board: - Initialize GPIOs using the cross-platform calls, not the old OMAP-private ones. - Move touchscreen setup out of ads7846 code into board-specfic setup code, where it belongs. This doesn't depend on the patches to update OMAP to use the gpiolib implementation framework. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-04-02Input: ads7846 - simplify support of external vREF (and ads7843)David Brownell1-12/+10
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>
2008-03-14Input: ads7846 - fix uninitialized var warningAndrew Morton1-1/+1
drivers/input/touchscreen/ads7846.c: In function 'ads7846_read12_ser': drivers/input/touchscreen/ads7846.c:216: warning: 'sample' may be used uninitialized in this function Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-02-07Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-4/+4
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (34 commits) Input: i8042 - non-x86 build fix Input: pxa27x_keypad - also enable on PXA3xx Input: pxa27x_keypad - add debounce_interval to the keypad platform data Input: pxa27x_keypad - use device resources for I/O memory mapping and IRQ Input: pxa27x_keypad - enable rotary encoders and direct keys Input: pxa27x_keypad - introduce pxa27x_keypad_config() Input: pxa27x_keypad - introduce driver structure and use KEY() to define matrix keys Input: pxa27x_keypad - remove pin configuration from the driver Input: pxa27x_keypad - rename the driver (was pxa27x_keyboard) Input: constify function pointer tables (seq_operations) Input: i8042 - add Fujitsu-Siemens Amilo Pro 2010 to nomux list Input: i8042 - enable DMI quirks on x86-64 Input: i8042 - add Dritek quirk for Acer Aspire 9110 Input: add input event to APM event bridge Input: mousedev - use BIT_MASK instead of BIT Input: remove duplicate includes Input: remove cdev from input_dev structure Input: remove duplicated headers in drivers/char/keyboard.c Input: i8042 - add Dritek keyboard extension quirk Input: add Tosa keyboard driver ...
2008-01-21Input: ads7846 - stop updating dev->power.power_stateDavid Brownell1-4/+4
This stops the ads7846 driver from using dev->power.power_state; that field is deprecated (overdue for removal) and the only reason to update it was to make the /sys/devices/.../power/state files (now removed) work better. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
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>