summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/wm831x-ts.c
Commit message (Collapse)AuthorAgeFilesLines
* mfd: Convert wm831x to irq_domainMark Brown2012-05-201-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The modern idiom is to use irq_domain to allocate interrupts. This is useful partly to allow further infrastructure to be based on the domains and partly because it makes it much easier to allocate virtual interrupts to devices as we don't need to allocate a contiguous range of interrupt numbers. Convert the wm831x driver over to this infrastructure, using a legacy IRQ mapping if an irq_base is specified in platform data and otherwise using a linear mapping, always registering the interrupts even if they won't ever be used. Only boards which need to use the GPIOs as interrupts should need to use an irq_base. This means that we can't use the MFD irq_base management since the unless we're using an explicit irq_base from platform data we can't rely on a linear mapping of interrupts. Instead we need to map things via the irq_domain - provide a conveniencem function wm831x_irq() to save a small amount of typing when doing so. Looking at this I couldn't clearly see anything the MFD core could do to make this nicer. Since we're not supporting device tree yet there's no meaningful advantage if we don't do this conversion in one, the fact that the interrupt resources are used for repeated IP blocks makes accessor functions for the irq_domain more trouble to do than they're worth. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Input: touchscreen - use macro module_platform_driver()JJ Ding2011-11-301-12/+1
| | | | | | | | Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to save some platform_driver boilerplate code. Use it. Signed-off-by: JJ Ding <dgdunix@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - move BTN_TOUCH reporting to data transferMark Brown2011-04-271-3/+2
| | | | | | | | | Don't report BTN_TOUCH until we've got data as some less robust applications can be confused by getting a touch event by itself and it doesn't seem unreasonable for them to expect coordinates along with a touch. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - allow IRQ flags to be specifiedMark Brown2011-04-271-3/+13
| | | | | | | | This allows maximum flexibility for configuring the direct GPIO based interrupts. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - fix races with IRQ managementMark Brown2011-04-271-5/+49
| | | | | | | | | | | | | | | | | | | | | If the WM831x pen down and data IRQs run in parallel it is possible for the data and pen down IRQs to deadlock themselves as one is part way through disabling its operation while the other is part way through enabling. Fix this by always disabling the pen down interrupt while data is active and vice versa. When a changeover is required we disable the IRQ that is to be stopped then schedule work that will enable the new IRQ. We need to handle the data flow in the data IRQ as the readback from the device needs to be ordered correctly with the IRQ for robust operation. This also fixes an issue when using the built in IRQs due to enable_irq() not being valid from interrupt context on an interrupt controller with bus operations like the built in IRQ controller - this issue may also have affected other interrupt controllers. We can't rely on having the data and pen down IRQs available via GPIOs on the CPU on every system. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - ensure the controller is in a known state on openMark Brown2011-03-141-1/+3
| | | | | | | | Explicitly set all the enable bits when opening the device just in case something left the device in an unexpected state. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - default pressure measurements onMark Brown2011-03-121-1/+4
| | | | | | | | tslib expects pressure measurements so enable them by default for better compatibility. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x-ts - remove use of ternary operatorMark Brown2011-01-311-5/+13
| | | | | | | | | While being applied the driver was modified to add use of the ternary operator. Write the conditionals out longhand as I find it terribly unhelpful for legibility. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: wm831x - add driver for Wolfson WM831x PMIC touchscreen controllersMark Brown2011-01-301-0/+355
Some of the WM831x series of PMICs from Wolfson Microelectronics include a resistive touchscreen controller. Implement support for these controllers within the input API. Platform data is supported to allow configuration of system parameters such as selection between four and five wire touchscreens and for specification of optional direct to CPU IRQs for sample availability and for pen down. Use of this feature for at least the data IRQ is strongly recommended. Thanks to Julien Boibessot for extensive testing and detailed feedback. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Julien Boibessot <julien.boibessot@armadeus.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>