aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/eeti_ts.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-15Merge tag 'v5.2' into nextDmitry Torokhov1-14/+1
Sync up with mainline to resolve conflicts in iforce driver.
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 160Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this file is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this file is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this library if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.475087903@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-15Input: eeti_ts - read hardware state once after wakeupDaniel Mack1-15/+56
For systems in which the touch IRQ is acting as wakeup source, and that do not support level-driven interrupts, the interrupt controller might not latch the GPIO IRQ during sleep. In such cases, the interrupt will never occur again after resume, hence the touch screen appears dead. To fix this, check for the assertion of the attn gpio, and read form the controller once in the resume path to read the hardware status and to arm the IRQ again. Introduce a mutex to guard eeti_ts_read() against parallel invocations from different contexts. Signed-off-by: Daniel Mack <daniel@zonque.org> Reported-by: Sven Neumann <Sven.Neumann@teufel.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-04Input: eeti - fix link to documentation and email address in headerDaniel Mack1-3/+3
Keep the documentation link up-to-date in case anybody need to dive into it again, and update email address while at it. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-04Input: eeti - drop module parameters, parse DT propertiesDaniel Mack1-17/+5
The only user of this driver in mainline does not make use of the module parameters, so let's remove them. All properties for this driver should be set through DT or pdata. Use touchscreen_parse_properties() to automatically set some of the common touchscreen properties and derive the axis inversion through that. And finally, use touchscreen_report_pos() to handle the DT properties automatically instead of doing the inversion ourselves. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-04Input: eeti - add device tree matching tableDaniel Mack1-0/+9
Provide a match table so that the driver can be used in devicetree setups. More properties are added in a later patch. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: eeti_ts - switch to gpiod APIDmitry Torokhov1-17/+7
gpiod API allows standard way of specifying GPIO polarity and takes it into account when reading or setting GPIO state. It also allows us to switch to common way of obtaining GPIO descriptor and away form legacy platform data. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-05Input: eeti_ts - expect platform code to set interrupt triggerDmitry Torokhov1-5/+1
Instead of keying interrupt trigger off GPIO polarity, let's rely on platform code to set it up properly for us. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - switch to using threaded interruptDmitry Torokhov1-43/+36
Instead of having standard interrupt handler and manually firing work item to perform I2C reads, let's switch to threaded interrupts, which were designed specifically for this purpose. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use gpio_get_value_cansleepDmitry Torokhov1-1/+1
We are reading GPIO state in a non-atomic context (workqueue), so we can use "cansleep" variant, and thus make the driver available on systems where GPIO controllers require sleeping when reading GPIO state. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - respect interrupt set in client structureDmitry Torokhov1-7/+6
Instead of expecting that GPIO is always interrupt source, let's use interrupt specified in I2C client. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - switch to using managed resourcesDmitry Torokhov1-48/+22
Using devm_* APIs simpifies error handling and device teardown. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use input_set_capability()Dmitry Torokhov1-2/+1
Use input_set_capability() instead of manipulating evbit/keybit masks directly. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use get_unaligned_be16() to retrieve dataDmitry Torokhov1-2/+4
Instead of manually converting big endian data on wire into host endianness, let's use helpers to do that for us. It might save us a few cycles if host endianness matches what's on wire. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - use BIT(n)Dmitry Torokhov1-4/+4
Use idiomatic BIT(n) to form single-bit masks. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03Input: eeti_ts - rename eeti_ts_priv to eeti_tsDmitry Torokhov1-57/+58
Also rename 'priv' variables to eeti. Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21Input: touchscreen - drop unnecessary calls to device_init_wakeupGuenter Roeck1-1/+0
Calling device_init_wakeup in the remove function is unnecessary since the device is going away, and thus won't be able to cause any wakeups under any circumstances. Besides, the driver cleanup code already handles the necessary cleanup. Similarly, disabling wakeup in the probe error path is unnecessary, as is disabling wakeup in the probe function in the first place. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18Input: eeti_ts - drop goto to return statementGuenter Roeck1-3/+1
Replace 'goto l; ... l: return e;' with 'return e;' Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-11-02Input: touchscreen - use __maybe_unused instead of ifdef around suspend/resumeJingoo Han1-4/+2
Use __maybe_unused instead of ifdef guards around suspend/resume functions, in order to increase build coverage and fix build warnings. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-12-06Input: use dev_get_platdata()Jingoo Han1-1/+1
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-08-12Input: eeti_ts - add CONFIG_PM_SLEEP to suspend/resumeJingoo Han1-4/+2
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the build warnings when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/input/touchscreen/eeti_ts.c:268:12: warning: 'eeti_ts_suspend' defined but not used [-Wunused-function] drivers/input/touchscreen/eeti_ts.c:287:12: warning: 'eeti_ts_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-03-31Input: eeti_ts - remove redundant null checkSachin Kamat1-2/+1
'pdata' is already dereferenced earlier. Hence this check is meaningless. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-08-09Input: eeti_ts: pass gpio value instead of IRQArnd Bergmann1-8/+13
The EETI touchscreen asserts its IRQ line as soon as it has data in its internal buffers. The line is automatically deasserted once all data has been read via I2C. Hence, the driver has to monitor the GPIO line and cannot simply rely on the interrupt handler reception. In the current implementation of the driver, irq_to_gpio() is used to determine the GPIO number from the i2c_client's IRQ value. As irq_to_gpio() is not available on all platforms, this patch changes this and makes the driver ignore the passed in IRQ. Instead, a GPIO is added to the platform_data struct and gpio_to_irq is used to derive the IRQ from that GPIO. If this fails, bail out. The driver is only able to work in environments where the touchscreen GPIO can be mapped to an IRQ. Without this patch, building raumfeld_defconfig results in: drivers/input/touchscreen/eeti_ts.c: In function 'eeti_ts_irq_active': drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration] Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: stable@vger.kernel.org (v3.2+) Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Sven Neumann <s.neumann@raumfeld.com> Cc: linux-input@vger.kernel.org Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-03-16Input: convert I2C drivers to use module_i2c_driver()Axel Lin1-13/+1
This patch converts the drivers in drivers/input/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-2/+2
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-01-06Input: eeti_ts - convert to dev_pm_opsMark Brown1-7/+9
There is a general move towards the use of dev_pm_ops rather than bus specific suspend APIs as this simplifies both the bus and PM core implementations. Convert the eeti_ts driver over. Compile tested only by me, but Sven Neumann reports that the new code works. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Sven Neumann <s.neumann@raumfeld.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang1-2/+0
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-05-05Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds1-10/+46
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: joydev - allow binding to button-only devices Input: elantech - ignore high bits in the position coordinates Input: elantech - allow forcing Elantech protocol Input: elantech - fix firmware version check Input: ati_remote - add some missing devices from lirc_atiusb Input: eeti_ts - cancel pending work when going to suspend Input: Add support of Synaptics Clickpad device Revert "Input: ALPS - add signature for HP Pavilion dm3 laptops" Input: psmouse - ignore parity error for basic protocols
2010-04-20Input: eeti_ts - cancel pending work when going to suspendDaniel Mack1-10/+46
This fixes a race between the suspend code and input events. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-08-12Input: eeti_ts - allow active high irq linesDaniel Mack1-3/+19
This adds a struct eeti_ts_platform_data which currently holds only one value to specify the interrupt polarity. The driver has a fallback if no platform data is passed in via the i2c_board_info, so no regression is caused. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-05-19Input: add driver for EETI touchpanelsDaniel Mack1-0/+286
This patch adds a driver for EETI's I2C connected touchscreens. Signed-off-by: Daniel Mack <daniel@caiaq.de> Tested-by: Sven Neumann <s.neumann@raumfeld.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>