aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/tsc2005.c
Commit message (Collapse)AuthorAge
* Input: tsc2005 - fix locking issueAaro Koskinen2011-03-24
| | | | | | | | | | | | | | Commit 0b950d3 (Input: tsc2005 - add open/close) introduced a locking issue with the ESD watchdog: __tsc2005_disable() is calling cancel_delayed_work_sync() with mutex held, and the work also needs the same mutex. Fix the problem by using mutex_trylock() in tsc2005_esd_work(). If the mutex is taken, we know we are in the middle of disable or enable and the watchdog check can be skipped. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - use relative jiffies to schedule the watchdogAaro Koskinen2011-03-24
| | | | | | | | Use relative jiffies to schedule the watchdog. Otherwise it will run like a mad one. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - driver should depend on GENERIC_HARDIRQSGeert Uytterhoeven2011-03-24
| | | | | | | | | | | | drivers/input/touchscreen/tsc2005.c: In function ‘tsc2005_probe’: drivers/input/touchscreen/tsc2005.c:666: error: implicit declaration of function ‘set_irq_wake’ In addition, migrate from set_irq_wake() (marked "do not use" as of commit a0cd9ca2b907d7ee26575e7b63ac92dad768a75e ("genirq: Namespace cleanup")) to irq_set_irq_wake(). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - remove 'disable' sysfs attributeDmitry Torokhov2011-03-17
| | | | | | | | | | I believe that enable/disable functionality should not be implemented on the individual driver level but rather in device core, potentially reusing parts of PM framework. Therefore the driver-specific "disable" attribute is removed from the mainline driver. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - add open/closeDmitry Torokhov2011-03-17
| | | | | | | | | | | | | | | | Introduce open and close methods for the input device to keep the device powered down when it is not in use. Also rework interaction between interrupt thread and starting/shutting off/resetting the device: instead of taking a mutex in the intterrupt thread and elsewhere disable interrupts before transitioning the device in a new state. The ESD handling is also separated from the IRQ thread; we poll regularly at a given interval and simply skip reads if we see that valid interrupt happened not so long ago. This allows us not cancel and reschedule ESD work from interrupt context all the time. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - handle read errors from SPI layerDmitry Torokhov2011-03-17
| | | | | Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - do not rearm timer in hardirq handlerDmitry Torokhov2011-03-17
| | | | | | | | We will most likely rearm it yet again the IRQ thread so doing it here is pointless. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - don't use work for 'pen up' handlingDmitry Torokhov2011-03-17
| | | | | | | | | We do not need process context to send input events so let's switch to a regular timer. I am going to get rid of taking ts->mutex in tsc2005_irq_thread() later. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - do not use 0 in place of NULLDmitry Torokhov2011-03-17
| | | | | | | | | Sparse in unhappy when people use 0 instead of NULL for pointers so let's rework the way we initialize spi_transfer structure in tsc2005_cmd() and tsc2005_write(). Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - use true/false for boolean variablesDmitry Torokhov2011-03-17
| | | | | Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - hide selftest attribute if we can't resetDmitry Torokhov2011-03-17
| | | | | | | | | If implementation to perform self-test/reset has not been provided by the platform code hide 'selftest' sysfs attribute instead of returning error when someone tries to use it. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - rework driver initialization codeDmitry Torokhov2011-03-17
| | | | | | | | We need to make sure we have time/work initialized before requesting and enabling interrupts, otherwise we might start using them way too early. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - set up bus type in input deviceDmitry Torokhov2011-03-17
| | | | | | | | We know what bus we are residing on (SPI) so let's make this data available to the users. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - set up parent deviceDmitry Torokhov2011-03-17
| | | | | | | | Set up SPI device as parent of the input device so it gets placed into proper place in sysfs tree. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - clear driver data after unbindingDmitry Torokhov2011-03-17
| | | | | | | | We should not leave garbage pointers in driver structure after we unbind it from the device or if bind fails. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - add module descriptionDmitry Torokhov2011-03-17
| | | | | | | | Add proper module description so that it would show in 'modinfo' output. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - remove driver banner messageDmitry Torokhov2011-03-17
| | | | | | | | The boot process is noisy as it is and input core already announces all new device so let's get rid of the banner message in the driver. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - remove incorrect module aliasDmitry Torokhov2011-03-17
| | | | | | | | TSC2005 is not a platform driver so it should not define "platform:tsc2005" module alias. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - convert to using dev_pm_opsDmitry Torokhov2011-03-17
| | | | | | | | | Newer code should not be using legacy suspend/resume methods but rather supply dev_pm_ops structure as it allows better control over power management. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: tsc2005 - use spi_get/set_drvdata()Dmitry Torokhov2011-03-17
| | | | | | | | | Instead of peeking into underlying device and using dev_get/set_drvdata(), let's use SPI layer's implementation to access driver-private data (which may be different from driver-core private data). Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: introduce tsc2005 driverLauri Leukkunen2011-03-17
Discussions: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26748.html Introduce a driver for the Texas Instruments TSC2005 touchscreen controller (http://focus.ti.com/docs/prod/folders/print/tsc2005.html). The patch is based on a driver by Lauri Leukkunen, with modifications by David Brownell, Phil Carmody, Imre Deak, Hiroshi DOYU, Ari Kauppi, Tony Lindgren, Jarkko Nikula, Eero Nurkkala and Roman Tereshonkov. Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com> [aaro.koskinen@nokia.com: patch description, rebasing & cleanup] Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> [ext-srikar.1.bhavanarayana@nokia.com: various fixes] Signed-off-by: Srikar <ext-srikar.1.bhavanarayana@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>