summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
AgeCommit message (Collapse)AuthorFilesLines
2021-05-04Merge branch 'next' into for-linusDmitry Torokhov5-52/+78
Prepare input updates for 5.13 merge window.
2021-04-07Input: gpio-keys - fix crash when disabliing GPIO-less buttonsDmitry Torokhov1-17/+13
My brain-damaged adjustments to Paul's patch caused crashes in gpio_keys_disable_button() when driver is used in GPIO-less (i.e. purely interrupt-driven) setups, because I mixed together debounce and release timers when they are in fact separate: Unable to handle kernel NULL pointer dereference at virtual address 0000000c ... PC is at hrtimer_active+0xc/0x98 LR is at hrtimer_try_to_cancel+0x24/0x140 ... [<c01c43b8>] (hrtimer_active) from [<c01c50f4>] (hrtimer_try_to_cancel+0x24/0x140) [<c01c50f4>] (hrtimer_try_to_cancel) from [<c01c5224>] (hrtimer_cancel+0x14/0x4c) [<c01c5224>] (hrtimer_cancel) from [<bf1cae24>] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys]) [<bf1cae24>] (gpio_keys_attr_store_helper [gpio_keys]) from [<bf1cae80>] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys]) [<bf1cae80>] (gpio_keys_store_disabled_keys [gpio_keys]) from [<c038ec7c>] (kernfs_fop_write_iter+0x10c/0x1cc) [<c038ec7c>] (kernfs_fop_write_iter) from [<c02df858>] (vfs_write+0x2ac/0x404) [<c02df858>] (vfs_write) from [<c02dfaf4>] (ksys_write+0x64/0xdc) [<c02dfaf4>] (ksys_write) from [<c0100080>] (ret_fast_syscall+0x0/0x58) Let's fix it up. Fixes: c9efb0ba281e ("Input: gpio-keys - use hrtimer for software debounce, if possible") Reported-by: Tony Lindgren <tony@atomide.com> Tested-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/YG1DFFgojSVfdpaz@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-27Input: imx_keypad - convert to a DT-only driverFabio Estevam1-11/+2
i.MX has been converted to a DT-only platform, so make the adjustments to the driver to convert it to a DT-only driver. Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20210327194307.541248-1-festevam@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-25Input: move to use request_irq by IRQF_NO_AUTOEN flagBarry Song2-5/+3
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable because of requesting. On the other hand, request_irq() after setting IRQ_NOAUTOEN as below irq_set_status_flags(irq, IRQ_NOAUTOEN); request_irq(dev, irq...); can also be replaced by request_irq() with IRQF_NO_AUTOEN flag. Signed-off-by: Barry Song <song.bao.hua@hisilicon.com> Link: https://lore.kernel.org/r/20210302224916.13980-3-song.bao.hua@hisilicon.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-25Merge tag 'v5.12-rc4' into nextDmitry Torokhov1-3/+1
Sync up with the mainline to bring in newest APIs.
2021-03-25Input: gpio-keys - use hrtimer for software debounce, if possiblePaul Cercueil1-14/+52
We want to be able to report the input event as soon as the debounce delay elapsed. However, the current code does not really ensure that, as it uses the jiffies-based schedule_delayed_work() API. With a small enough HZ value (HZ <= 100), this results in some input events being lost, when a key is quickly pressed then released (on a human's time scale). Switching to hrtimers fixes this issue, and will work even on extremely low HZ values (tested at HZ=24). This is however only possible if reading the GPIO is possible without sleeping. If this condition is not met, the previous approach of using a jiffies-based timer is taken. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20210307222240.380583-3-paul@crapouillou.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-25Input: gpio-keys - use hrtimer for release timerPaul Cercueil1-11/+16
Dealing with input, timing is important; if the button should be released in one millisecond, then it should be done in one millisecond and not a hundred milliseconds. Therefore, the standard timer API is not really suitable for this task. Convert the gpio-keys driver to use a hrtimer instead of the standard timer to address this issue. Note that by using a hard IRQ for the hrtimer callback, we can get rid of the spin_lock_irqsave() and spin_unlock_irqrestore(). Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20210307222240.380583-2-paul@crapouillou.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-25Input: gpio-keys - remove extra call to input_syncPaul Cercueil1-1/+1
The input_sync() function is already called after the loop in gpio_keys_report_state(), so it does not need to be called after each iteration within gpio_keys_gpio_report_event(). Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20210307222240.380583-1-paul@crapouillou.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-23Input: nspire-keypad - enable interrupts only when openedFabian Vogt1-25/+31
The driver registers an interrupt handler in _probe, but didn't configure them until later when the _open function is called. In between, the keypad can fire an IRQ due to touchpad activity, which the handler ignores. This causes the kernel to disable the interrupt, blocking the keypad from working. Fix this by disabling interrupts before registering the handler. Additionally, disable them in _close, so that they're only enabled while open. Fixes: fc4f31461892 ("Input: add TI-Nspire keypad support") Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de> Link: https://lore.kernel.org/r/3383725.iizBOSrK1V@linux-e202.suse.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-23Merge branch 'for-linus' of ↵Linus Torvalds4-132/+278
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "Mostly existing driver fixes plus a new driver for game controllers directly connected to Nintendo 64, and an enhancement for keyboards driven by Chrome OS EC to communicate layout of the top row to userspace" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (47 commits) Input: st1232 - fix NORMAL vs. IDLE state handling Input: aiptek - convert sysfs sprintf/snprintf family to sysfs_emit Input: alps - fix spelling of "positive" ARM: dts: cros-ec-keyboard: Use keymap macros dt-bindings: input: Fix the keymap for LOCK key dt-bindings: input: Create macros for cros-ec keymap Input: cros-ec-keyb - expose function row physical map to userspace dt-bindings: input: cros-ec-keyb: Add a new property describing top row Input: applespi - fix occasional crc errors under load. Input: applespi - don't wait for responses to commands indefinitely. Input: st1232 - add IDLE state as ready condition Input: zinitix - fix return type of zinitix_init_touch() Input: i8042 - add ASUS Zenbook Flip to noselftest list Input: add missing dependencies on CONFIG_HAS_IOMEM Input: joydev - prevent potential read overflow in ioctl Input: elo - fix an error code in elo_connect() Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S Input: sur40 - fix an error code in sur40_probe() Input: elants_i2c - detect enum overflow Input: zinitix - remove unneeded semicolon ...
2021-02-22Input: cros-ec-keyb - expose function row physical map to userspacePhilip Chen1-0/+79
The top-row keys in a keyboard usually have dual functionalities. E.g. A function key "F1" is also an action key "Browser back". Therefore, when an application receives an action key code from a top-row key press, the application needs to know how to correlate the action key code with the function key code and do the conversion whenever necessary. Since the userpace already knows the key scanlines (row/column) associated with a received key code. Essentially, the userspace only needs a mapping between the key row/column and the matching physical location in the top row. So, enhance the cros-ec-keyb driver to create such a mapping and expose it to userspace in the form of a function_row_physmap attribute. The attribute would be a space separated ordered list of row/column codes for the keys in the function row, in a left-to-right order. The attribute will only be present when the device has a custom design for the top-row keys. Signed-off-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210115122412.v7.2.I6542d7d9d0b246e7079bb16b41e697b2ac4b4e39@changeid Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-22Merge tag 'v5.11' into nextDmitry Torokhov2-9/+35
Merge with mainline to get latest APIs and device tree bindings.
2021-02-19Input: applespi - fix occasional crc errors under load.Ronald Tschalär1-0/+2
For some reason, when the system is under heavy CPU load, the read following the write sometimes occurs unusually quickly, resulting in the read data not being quite ready and hence a bad packet getting read. Adding another delay after reading the status message appears to fix this. Signed-off-by: Ronald Tschalär <ronald@innovation.ch> Link: https://lore.kernel.org/r/20210217190718.11035-2-ronald@innovation.ch Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-19Input: applespi - don't wait for responses to commands indefinitely.Ronald Tschalär1-6/+15
The response to a command may never arrive or it may be corrupted (and hence dropped) for some reason. While exceedingly rare, when it did happen it blocked all further commands. One way to fix this was to do a suspend/resume. However, recovering automatically seems like a nicer option. Hence this puts a time limit (1 sec) on how long we're willing to wait for a response, after which we assume it got lost. Signed-off-by: Ronald Tschalär <ronald@innovation.ch> Link: https://lore.kernel.org/r/20210217190718.11035-1-ronald@innovation.ch Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-19Input: add missing dependencies on CONFIG_HAS_IOMEMDmitry Torokhov1-2/+2
devm_ioremap_resource() is only guaranteed to be present if CONFIG_HAS_IOMEM is set. Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/YCyauGyqxut69JNz@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-01ARM: 9049/1: locomo: make locomo bus's remove callback return voidUwe Kleine-König1-3/+1
The driver core ignores the return value of struct bus_type::remove because there is only little that can be done. To simplify the quest to make this function return void, let struct locomo_driver::remove return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea and ensures future users behave accordingly. Link: https://lore.kernel.org/r/20201126110140.2021758-1-u.kleine-koenig@pengutronix.de Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2021-01-10Input: omap4-keypad - implement errata check for lost key-up eventsTony Lindgren1-0/+30
We are still missing handling for errata i689 related issues for the case where we never see a key up interrupt for the last pressed key. To fix the issue, we must scan the key state again after the keyboard controller has idled to check if a key up event was missed. This is described in the omap4 silicon errata documentation for Errata ID i689 "1.32 Keyboard Key Up Event Can Be Missed": "When a key is released for a time shorter than the debounce time, in-between 2 key press (KP1 and KP2), the keyboard state machine will go to idle mode and will never detect the key release (after KP1, and also after KP2), and thus will never generate a new IRQ indicating the key release." We can use PM runtime autosuspend features to check the keyboard state after it enters idle. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/X/vrygoBxzGyXhfc@atomide.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-10Input: omap4-keypad - use PM runtime autosuspendTony Lindgren1-11/+39
Implement PM runtime autosuspend support to prepare for adding handling to clear stuck last pressed key in the following patches. The hardware has support for autoidle and can wake up to keypress events. Let's also update omap4_keypad_probe() to use dev instead of &pdev->dev since we already have it from the earlier changes. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/X/vqCs5/EDURprAJ@atomide.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-10Input: omap4-keypad - move rest of key scanning to a separate functionTony Lindgren1-13/+26
Let's move rest of the key scanning code to omap4_keypad_scan_keys(). We will use omap4_keypad_scan_keys() also for implementing errata handling to clear the stuck last key in the following patch. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210110190529.46135-4-tony@atomide.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-10Input: omap4-keypad - scan keys in two phases and simplify with bitmaskTony Lindgren1-28/+45
Because of errata i689 the keyboard can idle with state where no key up interrupts are seen until after the next key press. This means we need to first check for any lost key up events before scanning for new down events. For example, rapidly pressing shift-shift-j can sometimes produce a J instead of j. Let's fix the issue by scanning the keyboard in two phases. First we scan for any key up events that we may have missed, and then we scan for key down events. Let's also simplify things with for_each_set_bit() as suggested by Dmitry Torokhov <dmitry.torokhov@gmail.com>. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210110190529.46135-3-tony@atomide.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-10Input: omap4-keypad - disable unused long interruptsTony Lindgren1-3/+2
We are not using the long events and they produce extra interrupts. Let's not enable them at all. Note that also the v3.0.8 Linux Android kernel has long interrupts disabled. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20210110190529.46135-2-tony@atomide.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-10Input: omap4-keypad - switch to use managed resourcesDmitry Torokhov1-84/+53
Now that input core supports devres-managed input devices we can clean up this driver a bit. Link: https://lore.kernel.org/r/X/qfJKiM21uyksYl@google.com Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-18Input: imx_keypad - add dependency on HAS_IOMEMDmitry Torokhov1-1/+1
devm_platform_ioremap_resource() depends on CONFIG_HAS_IOMEM, so let's add it to the dependencies when COMPILE_TEST is enabled. Reported-by: kernel test robot <lkp@intel.com> Fixes: c8834032ffe2 ("Input: imx_keypad - add COMPILE_TEST support") Link: https://lore.kernel.org/r/X9llpA3w1zlZCHXU@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-15Merge branch 'for-linus' of ↵Linus Torvalds18-261/+193
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - support for inhibiting input devices at request from userspace. If a device implements open/close methods, it can also put device into low power state. This is needed, for example, to disable keyboard and touchpad on convertibles when they are transitioned into tablet mode - now that ordinary input devices can be configured for polling mode, dedicated input polling device implementation has been removed - GTCO tablet driver has been removed, as it used problematic custom HID parser, devices are EOL, and there is no interest from the manufacturer - a new driver for Dialog DA7280 haptic chips has been introduced - a new driver for power button on Dell Wyse 3020 - support for eKTF2132 in ektf2127 driver - support for SC2721 and SC2730 in sc27xx-vibra driver - enhancements for Atmel touchscreens, AD7846 touchscreens, Elan touchpads, ADP5589, ST1232 touchscreen, TM2 touchkey drivers - fixes and cleanups to allow clean builds with W=1 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (86 commits) Input: da7280 - fix spelling mistake "sequemce" -> "sequence" Input: cyapa_gen6 - fix out-of-bounds stack access Input: sc27xx - add support for sc2730 and sc2721 dt-bindings: input: Add compatible string for SC2721 and SC2730 dt-bindings: input: Convert sc27xx-vibra.txt to json-schema Input: stmpe - add axis inversion and swapping capability Input: adp5589-keys - do not explicitly control IRQ for wakeup Input: adp5589-keys - do not unconditionally configure as wakeup source Input: ipx4xx-beeper - convert comma to semicolon Input: parkbd - convert comma to semicolon Input: new da7280 haptic driver dt-bindings: input: Add document bindings for DA7280 MAINTAINERS: da7280 updates to the Dialog Semiconductor search terms Input: elantech - fix protocol errors for some trackpoints in SMBus mode Input: elan_i2c - add new trackpoint report type 0x5F Input: elants - document some registers and values Input: atmel_mxt_ts - simplify the return expression of mxt_send_bootloader_cmd() Input: imx_keypad - add COMPILE_TEST support Input: applespi - use new structure for SPI transfer delays Input: synaptics-rmi4 - use new structure for SPI transfer delays ...
2020-12-14Merge branch 'next' into for-linusDmitry Torokhov19-262/+194
Prepare input updates for 5.11 merge window.
2020-12-12Merge branch 'for-linus' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a fix for cm109 stomping on its own control URB if it tries to toggle buzzer immediately after userspace opens input device (found by syzcaller) - another fix for Raydium touchscreens that do not like splitting command transfers - quirks for i8042, soc_button_array, and goodix drivers to make them work better with certain hardware. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: goodix - add upside-down quirk for Teclast X98 Pro tablet Input: cm109 - do not stomp on control URB Input: i8042 - add Acer laptops to the i8042 reset list Input: cros_ec_keyb - send 'scancodes' in addition to key events Input: soc_button_array - add Lenovo Yoga Tablet2 1051L to the dmi_use_low_level_irq list Input: raydium_ts_i2c - do not split tx transactions
2020-12-11Input: adp5589-keys - do not explicitly control IRQ for wakeupDmitry Torokhov1-18/+9
If device is set up as a wakeup source, I2C core configures the interrupt line as wake IRQ and PM core automatically configures it for waking up the system on system suspend transition, so we do not have to explicitly call enable_irq_wake() and disable_irq_wake() in suspend/resume. Link: https://lore.kernel.org/r/20201120073920.3214492-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-11Input: adp5589-keys - do not unconditionally configure as wakeup sourceDmitry Torokhov1-2/+0
We should not be configuring the controller as a wakeup source in the driver, but rather rely on I2C core to mark it as such by either instantiating as I2C_CLIENT_WAKEUP or specifying "wakeup-source" device property. Link: https://lore.kernel.org/r/20201120073920.3214492-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-10Input: imx_keypad - add COMPILE_TEST supportAnson Huang1-1/+1
Add COMPILE_TEST support to imx_keypad driver for better compile testing coverage. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/1583137573-16628-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-10Input: applespi - use new structure for SPI transfer delaysSergiu Cuciurean1-4/+8
In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd272df6 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Tested-by: Ronald Tschalär <ronald@innovation.ch> Reviewed-by: Ronald Tschalär <ronald@innovation.ch> Link: https://lore.kernel.org/r/20200227124534.23399-1-sergiu.cuciurean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-09Input: tm2-touchkey - add vddio regulatorStephan Gerhold1-1/+2
The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail. Implement support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201203131242.44397-3-stephan@gerhold.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-09Input: cros_ec_keyb - send 'scancodes' in addition to key eventsDmitry Torokhov1-0/+1
To let userspace know what 'scancodes' should be used in EVIOCGKEYCODE and EVIOCSKEYCODE ioctls, we should send EV_MSC/MSC_SCAN events in addition to EV_KEY/KEY_* events. The driver already declared MSC_SCAN capability, so it is only matter of actually sending the events. Link: https://lore.kernel.org/r/X87aOaSptPTvZ3nZ@google.com Acked-by: Rajat Jain <rajatja@google.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-02Input: use input_device_enabled()Andrzej Pietrasiewicz11-21/+21
Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-02Input: omap4-keypad - set up interrupt as wakeup sourceDmitry Torokhov1-35/+8
Marking main interrupt as wakeup interrupt in probe allows us to drop custom suspend/resume methods whose only purpose was to configure interrupt for waking up the system. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-22Input: omap4-keypad - fix runtime PM error handlingZhang Qilong1-36/+53
In omap4_keypad_probe, the patch fix several bugs. 1) pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak. 2) In err_unmap, forget to disable runtime of device, pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced. 3) In err_pm_disable, it will call pm_runtime_put_sync twice not one time. To fix this we factor out code reading revision and disabling touchpad, and drop PM reference once we are done talking to the device. Fixes: f77621cc640a7 ("Input: omap-keypad - dynamically handle register offsets") Fixes: 5ad567ffbaf20 ("Input: omap4-keypad - wire up runtime PM handling") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Link: https://lore.kernel.org/r/20201120133918.2559681-1-zhangqilong3@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-19Input: applespi - provide missing struct 'message' descriptionsLee Jones1-0/+9
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'keyboard' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'touchpad' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'tp_info' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'tp_info_command' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'init_mt_command' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'capsl_command' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'bl_command' not described in 'message' drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'data' not described in 'message' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201112110204.2083435-15-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-19Input: adp5589-keys - use BIT()Dmitry Torokhov1-34/+35
Let's use BIT() macro instead of explicitly shifting '1'. Acked-by: Alexandru Ardelean <Alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201119072440.GA116840@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-19Input: adp5589-keys - mark suspend and resume methods as __maybe_unusedDmitry Torokhov1-4/+2
This improves compile coverage of the code; unused code will be dropped by the linker. Acked-by: Alexandru Ardelean <Alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201119072418.GA114677@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-18Input: adp5589-keys - use devm_add_action_or_reset() for register clearAlexandru Ardelean1-10/+13
The driver clears the general configuration register during the remove() hook. This should also be done in case the driver exits on error. This change move the clear of that register to the devm_add_action_or_reset() hook. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201112074308.71351-6-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-18Input: adp5589-keys - use devm_gpiochip_add_data() for gpiosAlexandru Ardelean1-20/+2
This change makes use of the devm_gpiochip_add_data() function. With this the gpiochip_remove() function can be removed, and the adp5589_gpio_remove() function as well. The kpad->export_gpio variable is also redundant now, and has been removed. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201112074308.71351-5-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-18Input: adp5589-keys - remove setup/teardown hooks for gpiosAlexandru Ardelean1-21/+0
This is currently just dead code. It's from around a time when platform-data was used, and a board could hook it's own special callback for setup/teardown, and a private object (via 'context'). This change removes it, as there are no more users in mainline for this. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201112074308.71351-4-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-18Input: adp5589-keys - use device-managed function in adp5589_keypad_add()Alexandru Ardelean1-31/+10
This change makes use of the devm_input_allocate_device() function, which gets rid of the input_free_device() and input_unregister_device() calls. When a device is allocated via input_allocate_device(), the input_register_device() call will also be device-managed, so there is no longer need to manually call unregister. Also, the irq is allocated with the devm_request_threaded_irq(), so with these two changes, the adp5589_keypad_remove() function is no longer needed. This cleans up the error & exit paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201112074308.71351-3-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-18Input: adp5589-keys - use devm_kzalloc() to allocate the kpad objectAlexandru Ardelean1-9/+4
This removes the need to manually free the kpad object and cleans up some exit/error paths. The error path cleanup should reduce the risk of any memory leaks with this object. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20201112074308.71351-2-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-17Merge tag 'v5.9' into nextDmitry Torokhov1-1/+1
Sync up with mainline to bring in the latest DTS files.
2020-11-17Merge branch 'for-linus' of ↵Linus Torvalds1-8/+33
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: "A fix for use-after-free in the Sun keyboard driver, a fix to firmware updates on newer ICs in the Elan touchpad diver, and a couple misc driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elan_i2c - fix firmware update on newer ICs Input: resistive-adc-touch - fix kconfig dependency on IIO_BUFFER Input: sunkbd - avoid use-after-free in teardown paths Input: i8042 - allow insmod to succeed on devices without an i8042 controller Input: adxl34x - clean up a data type in adxl34x_probe()
2020-11-12Input: samsung-keypad - remove set but unused variable 'var'Lee Jones1-2/+1
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/samsung-keypad.c: In function ‘samsung_keypad_irq’: drivers/input/keyboard/samsung-keypad.c:149:15: warning: variable ‘val’ set but not used [-Wunused-but-set-variable] Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201112110204.2083435-3-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-08Input: cros_ec_keyb - struct headers should start with 'struct <name>'Lee Jones1-4/+5
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/cros_ec_keyb.c:72: warning: cannot understand function prototype: 'struct cros_ec_bs_map ' Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20201104162427.2984742-8-lee.jones@linaro.org [dtor: fixed up docbook comments for cros_ec_keyb structure as well] Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-08Input: gpio_keys - fix misnamed function parameter 'dev'Lee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/gpio_keys.c:119: warning: Function parameter or member 'dev' not described in 'get_bm_events_by_type' drivers/input/keyboard/gpio_keys.c:119: warning: Excess function parameter 'input' description in 'get_bm_events_by_type' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104162427.2984742-12-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-08Input: pmic8xxx-keypad - fix kernel-doc formattingLee Jones1-11/+11
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'num_rows' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'num_cols' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'input' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'regmap' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'key_sense_irq' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'key_stuck_irq' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'keycodes' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'dev' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'keystate' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'stuckstate' not described in 'pmic8xxx_kp' drivers/input/keyboard/pmic8xxx-keypad.c:106: warning: Function parameter or member 'ctrl_reg' not described in 'pmic8xxx_kp' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104162427.2984742-21-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-08Input: nomadik-ske-keypad - provide some missing struct member docsLee Jones1-0/+2
Fixes the following W=1 kernel build warning(s): drivers/input/keyboard/nomadik-ske-keypad.c:71: warning: Function parameter or member 'pclk' not described in 'ske_keypad' drivers/input/keyboard/nomadik-ske-keypad.c:71: warning: Function parameter or member 'ske_keypad_lock' not described in 'ske_keypad' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201104162427.2984742-20-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>