aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/pxa27x_keypad.c
AgeCommit message (Collapse)Author
2014-01-06Input: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-11-14Merge branch 'next' into for-linusDmitry Torokhov
Merge first round of changes for 3.13 merge window.
2013-10-06Input: pxa27x_keypad - include linux/of.h headerSachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-09-18Input: pxa27x_keypad - fix NULL pointer dereferenceMike Dunn
A NULL pointer dereference exception occurs in the driver probe function when device tree is used. The pdata pointer will be NULL in this case, but the code dereferences it in all cases. When device tree is used, a platform data structure is allocated and initialized, and in all cases this pointer is copied to the driver's private data, so the variable being tested should be accessed through the driver's private data structure. Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-18Input: pxa27x-keypad - make platform data constDmitry Torokhov
It should not be changed by the driver, so let's make it const pointer. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-18Input: pxa27x-keypad - convert to using SIMPLE_DEV_PM_OPSDmitry Torokhov
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-18Input: pxa27x-keypad - add device tree supportChao Xie
Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-06-18Input: pxa27x-keypad - use matrix_keymap for matrix keysChao Xie
pxa27x-keypad includes matrix keys. Make use of matrix_keymap for the matrix keys. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-05-23Input: pxa27x_keypad - pass correct pointer to free_irq()Lars-Peter Clausen
free_irq() expects the same pointer that was passed to request_irq(), otherwise the IRQ is not freed. The issue was found using the following coccinelle script: <smpl> @r1@ type T; T devid; @@ request_irq(..., devid) @r2@ type r1.T; T devid; position p; @@ free_irq@p(..., devid) @@ position p != r2.p; @@ *free_irq@p(...) </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-05-08Input: pxa27x_keypad - remove redundant platform_set_drvdata()Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. 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 Pemberton
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 Pemberton
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 Pemberton
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-10-30Input: pxa27x_keypad - clear pending interrupts on keypad configVasily Khoruzhick
Bootloader can leave interrupt bit pending, and it confuses driver. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-14ARM: pxa: move platform_data definitionsArnd Bergmann
Platform data for device drivers should be defined in include/linux/platform_data/*.h, not in the architecture and platform specific directories. This moves such data out of the pxa include directories Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Jeff Garzik <jgarzik@redhat.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Paul Parsons <lost.distance@yahoo.com> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Acked-By: Stefan Schmidt <stefan@openezx.org> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Daniel Ribeiro <drwyrm@gmail.com> Cc: Harald Welte <laforge@openezx.org> Cc: Philipp Zabel <philipp.zabel@gmail.com> Cc: Tomas Cech <sleep_walker@suse.cz> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Jonathan Cameron <jic23@cam.ac.uk> Cc: Dan Williams <djbw@fb.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Chris Ball <cjb@laptop.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Liam Girdwood <lrg@ti.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: openezx-devel@lists.openezx.org
2012-04-27Input: pxa27x_keypad add choice to set direct_key_maskChao Xie
Direct keys usage may not start from KP_DKIN0, add a msk option to configure the specifics for platforms that can skip some keys. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27Input: pxa27x_keypad direct key may be low activeChao Xie
KPDK_DK only indicates the pin level of direct key. So it is related to board, and low level may be active which indicates that a key is pressed. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27Input: pxa27x_keypad bug fix for direct_key_maskChao Xie
When direcct_key_num is 0, the mask should be 0. When direcct_key_num is 1, the mask should be 0b1. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27Input: pxa27x_keypad keep clock on as wakeup sourceChao Xie
When the keypad is used as wake up source, the clock can not be disabled. Or it can not detect key pressing. If the keypad is used as wake up source, when resume back, do not enable the clock and configure it again because the register content is retained. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2011-11-30Input: keyboard - use macro module_platform_driver()JJ Ding
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>
2011-09-07Input: remove IRQF_DISABLED from driversYong Zhang
This flag is a NOOP and can be removed now. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-10-09ARM: pxa27x_keypad: added wakeup event handler for keypad interruptsMark F. Brown
mach-mmp needs to clear wake event in order to clear the keypad interrupt Signed-off-by: Mark F. Brown <mark.brown314@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2010-10-09ARM: pxa: moved pxa27x_keypad.h to platform pxa directoryMark F. Brown
mach-mmp utilizes pxa27x_keypad code so we need to move header to platform pxa directory. Signed-off-by: Mark F. Brown <mark.brown314@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2010-08-25Input: pxa27x_keypad - remove input_free_device() in pxa27x_keypad_remove()Axel Lin
No need to call input_free_device() after input_unregister_device(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo
implicit slab.h inclusion from percpu.h 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-09-15Nicolas Pitre has a new email addressNicolas Pitre
Due to problems at cam.org, my nico@cam.org email address is no longer valid. FRom now on, nico@fluxnic.net should be used instead. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-10Input: pxa27x_keypad - allow modifying keymap from userspaceDmitry Torokhov
Tested-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-26Input: pxa27x_keypad - switch to using dev_pm_opsDmitry Torokhov
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-22Input: pxa27x_keypad - remove extra clk_disableDmitry Torokhov
clk_disable() in remove method is not needed since we already have clk_disable in pxa27x_keypad_close(). Also make sure the driver uses resource_size() and helpers from include/input/matrix_keypad.h Tested-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-11-27[ARM] pxa: don't pass a consumer clock name for devices with unique clocksRussell King
Where devices only have one consumer, passing a consumer clock ID has no real benefit. Remove it. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King
This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07[ARM] Eliminate useless includes of asm/mach-types.hRussell King
There are 43 includes of asm/mach-types.h by files that don't reference anything from that file. Remove these unnecessary includes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-06-17Merge branch 'for-linus' into nextDmitry Torokhov
Conflicts: drivers/input/mouse/appletouch.c
2008-06-02Input: pxa27x_keypad - add wakeup supportEric Miao
Signed-off-by: Eric Miao <eric.miao@marvell.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-05-28Input: pxa27x_keypad - miscellaneous fixesAntonio Ospite
1. Set input bits for direct keys codes 2. Set input bits for rotary encoder codes only if rotary encoder is enabled 3. Enable EV_REL only if rotary encoder is enabled and rel_codes are set up Signed-off-by: Antonio Ospite <ao2@openezx.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-24Input: add MODULE_ALIAS() to hotpluggable platform modulesKay Sievers
Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable "input" platform drivers, to re-enable auto loading. [dbrownell@users.sourceforge.net: more drivers, registration fixes] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-03-20Input: pxa27x - fix keypad KPC macrosSamuel Ortiz
We want to mask (key_number - 1), not key_number. The current implementation works fine for all values but the maximum one, i.e. 8. Signed-off-by: Samuel Ortiz <sameo@openedhand.com> Acked-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - add debounce_interval to the keypad platform dataEric Miao
Currently, only one debounce_interval is introduced for both direct and matrix keys. This is true in most cases, although the keypad controller supports different debounce for direct/matrix keys. Some platforms do require this to be tuned, instead of the default reset value of 100ms. Rotary encoder will always use zero debounce time for now to achieve certain sensitivity. Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - use device resources for I/O memory mapping and IRQEric Miao
1. use ioremap() for registers access, this improves the portability of the driver (e.g. same IP on different processor with different I/O memory range), and make it possible to remove those registers definition in pxa-regs.h as PXA is undergoing a clean-up of that header file 2. use device specific IRQ instead of hardcoded IRQ_KEYPAD, same reason as above 3. clean up the error handling path in _probe() 4. remove DRIVER_NAME and use pdev->name when necessary, we don't actually need a constant string literals Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - enable rotary encoders and direct keysEric Miao
1. Rotary encoder events can be configured either as relative events as the legacy code does or as any specified key code, this is useful on some platform which uses the rotary keys as KEY_{UP/DOWN/LEFT/RIGHT} 2. Add support for direct keys, the corresponding keycodes for each direct key can now be specified within the platform data 3. Remove the direct/rotary key detection code from the IRQ handler to dedicated functions to improve readability Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - introduce pxa27x_keypad_config()Eric Miao
Introduce pxa27x_keypad_config() for keypad registers configuration and remove the reg_kpc, reg_kprec from platform data structure so that configurations of keypad registers can be centralized to a single function. It can also be re-used when resuming. Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - introduce driver structure and use KEY() to define ↵Eric Miao
matrix keys 1. Introduce the "struct pxa27x_keypad" structure for driver specific information, such as "struct clk", generated matrix key codes and so on 2. Use KEY() macro to define matrix keys, instead of original 8x8 map this makes definition easier with keypad where keys are sparse 3. Keep a generated array in "struct pxa27x_keypad" for fast lookup 4. Separate the matrix scan into a dedicated function for readability and report only those keys whose state has been changed, instead of report all states 5. Make use of KPAS to decide the faster path if only one key has been detected Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - remove pin configuration from the driverEric Miao
The pin configurations will slowly be moved to the board specific code at initialization thus to make the driver more generic. Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31Input: pxa27x_keypad - rename the driver (was pxa27x_keyboard)Eric Miao
The controller should really be called keypad, and also align the naming of functions and structures to use "pxa27x_keypad" as prefix, instead of "pxakbd". Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>