summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/tca8418_keypad.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-28Input: tca8418 - remove set but not used variable 'max_keys'YueHaibing1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/input/keyboard/tca8418_keypad.c: In function tca8418_keypad_probe: drivers/input/keyboard/tca8418_keypad.c:269:24: warning: variable max_keys set but not used [-Wunused-but-set-variable] It's not used since commit 16ff7cb1848a ("Input: tca8418-keypad - switch to using managed resources") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-20Input: tca8418 - enable interrupt after it has been requestedDamien Riegel1-12/+17
Currently, enabling keypad interrupts is one of the first operations done on the keypad, even before the interrupt is requested, so there is a small time window where the keypad can fire interrupts but the driver is not yet ready to handle them. It's fine for level interrupts because they will be handled anyway, but not so much for edge ones. This commit modifies and moves the function in charge of configuring the keypad. Enabling interrupts is now the last thing done on the keypad, and after the interrupt has been requested by the driver. Writing to the config register was also used to determine if the device was indeed present on the bus or not, this has been replaced by reading the lock/event count register to keep the same functionality. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-02-23Input: tca8418_keypad - remove double read of key event registerDmitry Torokhov1-2/+0
There is no need to tread the same register twice in a row. Fixes: ea4348c8462a ("Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-un ...") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-31Input: tca8418 - switch to using generic device propertiesDmitry Torokhov1-64/+26
Let's drop legacy platform data support (there are no users in mainline) and switch to using generic device properties, which will make the driver simpler (non-OF boards can use property sets to describe hardware). Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-31Input: matrix-keypad - switch to using generic device propertiesDmitry Torokhov1-1/+1
Instead of being OF-specific, let's switch to using generic device properties, which will make this code usable on ACPI, device tree and legacy boards that use property sets. As part of the change let's rename matrix_keypad_parse_of_params() to matrix_keypad_parse_properties(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-23Input: keyboard - drop unnecessary calls to input_set_drvdataGuenter Roeck1-2/+0
If there is no call to dev_get_drvdata() or input_get_drvdata(), the call to input_set_drvdata() is unnecessary and can be dropped. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-18Input: tca8418 - use the interrupt trigger from the device treeMaxime Ripard1-3/+3
The TCA8418 might be used using different interrupt triggers on various boards. This is not working so far because the current code forces a falling edge trigger. The device tree already provides a trigger type, so let's use whatever it sets up, and since we can be loaded without DT, keep the old behaviour for the non-DT case. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-10-27Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warningArnd Bergmann1-9/+12
Older versions of gcc warn about the tca8418_irq_handler function as they can't keep track of the variable assignment inside of the loop when using the -Wmaybe-unintialized flag: drivers/input/keyboard/tca8418_keypad.c: In function ‘tca8418_irq_handler’: drivers/input/keyboard/tca8418_keypad.c:172:9: error: ‘reg’ may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/input/keyboard/tca8418_keypad.c:165:5: note: ‘reg’ was declared here This is fixed in gcc-6, but it's possible to rearrange the code in a way that avoids the warning on older compilers as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-18Input: drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-04-25Input: tca8418 - fix loading this driver as a module from a device treeDr. H. Nikolaus Schaller1-0/+7
Loading the tca8418 driver as a module on a device tree based system needs a MODULE_ALIAS because the driver name does not match the automatic name generation rules of a 'compatible' entry on i2c bus. Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-04-05input: matrix-keymap: Add function to read the new DT bindingSimon Glass1-2/+5
We now have a binding which adds two parameters to the matrix keypad DT node. This is separate from the GPIO-driven matrix keypad binding, and unfortunately incompatible, since that uses row-gpios/col-gpios for the row and column counts. So the easiest option here is to provide a function for non-GPIO drivers to use to decode the binding. Note: We could in fact create an entirely separate structure to hold these two fields, but it does not seem worth it, yet. If we have more parameters then we can add this, and then refactor each driver to hold such a structure. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Sourav Poddar <sourav.poddar@ti.com> (v2) Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-04Drivers: misc: remove __dev* attributes.Greg Kroah-Hartman1-1/+1
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29Input: tca8418-keypad - switch to using managed resourcesDmitry Torokhov1-53/+25
Let's switch to using devm_*() interfaces to manage our resources, thus will simplify error unwinding a bit. Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - increase severity of failures in probe()Dmitry Torokhov1-3/+3
Failures to build a keymap, request an IRQ, or register input device are fatal for the driver, therefore the messages should have "error" severity instead of "debug". Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - move device ID tables closer to where they are usedDmitry Torokhov1-15/+14
This matches structure of most other input drivers. Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - use dev_get_platdata() to retrieve platform dataDmitry Torokhov1-1/+1
We need to use proper accessor functions instead of directly poking into various structures. Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - use a temporary variable for parent deviceDmitry Torokhov1-10/+10
Use a temporary variable for our parent device (coming from I2C client structure); we'll be also using it during conversion to managed resources. Reviewed-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - add support for shared interruptAlban Bedel1-3/+7
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: tca8418_keypad - add support for device tree bindingsAlban Bedel1-27/+41
Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> 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-2/+2
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-07-05Input: request threaded-only IRQs with IRQF_ONESHOTLars-Peter Clausen1-1/+1
Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail. This patch adds the IRQF_ONESHOT to input drivers where it is missing. Not modified by this patch are those drivers where the requested IRQ will always be a nested IRQ (e.g. because it's part of an MFD), since for this special case IRQF_ONESHOT is not required to be specified when requesting the IRQ. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-05-11Input: matrix-keymap - uninline and prepare for device tree supportDmitry Torokhov1-8/+7
Change matrix-keymap helper to be out-of-line, like sparse keymap, allow the helper perform basic keymap validation and return errors, and prepare for device tree support. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-29Input: tca8418_keypad - initial driver releaseKyle Manna1-0/+430
This driver has been tested with hardware and works as expected. To use it add the platform data as appropriate and register it with the corresponding I2C bus. Signed-off-by: Kyle Manna <kyle.manna@fuel7.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>