summaryrefslogtreecommitdiffstats
path: root/drivers/input
AgeCommit message (Collapse)Author
2020-02-03Merge tag 'hyperv-next-signed' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull Hyper-V updates from Sasha Levin: - Most of the commits here are work to enable host-initiated hibernation support by Dexuan Cui. - Fix for a warning shown when host sends non-aligned balloon requests by Tianyu Lan. * tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: hv_utils: Add the support of hibernation hv_utils: Support host-initiated hibernation request hv_utils: Support host-initiated restart request Tools: hv: Reopen the devices if read() or write() returns errors video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs. Drivers: hv: vmbus: Ignore CHANNELMSG_TL_CONNECT_RESULT(23) video: hyperv_fb: Fix hibernation for the deferred IO feature Input: hyperv-keyboard: Add the support of hibernation hv_balloon: Balloon up according to request page number
2020-01-31Merge branch 'next' into for-linusDmitry Torokhov
Prepare input updates for 5.6 merge window.
2020-01-31Input: synaptics-rmi4 - switch to reduced reporting modeLucas Stach
When the distance thresholds are set the controller must be in reduced reporting mode for them to have any effect on the interrupt generation. This has a potentially large impact on the number of events the host needs to process. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Andrew Duggan <aduggan@synaptics.com> Link: https://lore.kernel.org/r/20200120111628.18376-1-l.stach@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-27Merge tag 'ioremap-5.6' of git://git.infradead.org/users/hch/ioremapLinus Torvalds
Pull ioremap updates from Christoph Hellwig: "Remove the ioremap_nocache API (plus wrappers) that are always identical to ioremap" * tag 'ioremap-5.6' of git://git.infradead.org/users/hch/ioremap: remove ioremap_nocache and devm_ioremap_nocache MIPS: define ioremap_nocache to ioremap
2020-01-25Input: hyperv-keyboard: Add the support of hibernationDexuan Cui
Add suspend() and resume() functions so the Hyper-V virtual keyboard can participate in VM hibernation. Note that the keyboard is a "wakeup" device that could abort an in-progress hibernation if there is keyboard event. No attempt is made to suppress this behavior. If desired, a sysadmin can disable the keyboard as a wakeup device using standard mechanisms such as: echo disabled > /sys/bus/vmbus/drivers/hyperv_keyboard/XXX/power/wakeup (where XXX is the device's GUID) Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-24Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - add sanity checks to USB endpoints in various dirvers - max77650-onkey was missing an OF table which was preventing module autoloading - a revert and a different fix for F54 handling in Synaptics dirver - a fixup for handling register in pm8xxx vibrator driver * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: pm8xxx-vib - fix handling of separate enable register Input: keyspan-remote - fix control-message timeouts Input: max77650-onkey - add of_match table Input: rmi_f54 - read from FIFO in 32 byte blocks Revert "Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers" Input: sur40 - fix interface sanity checks Input: gtco - drop redundant variable reinit Input: gtco - fix extra-descriptor debug message Input: gtco - fix endpoint sanity check Input: aiptek - use descriptors of current altsetting Input: aiptek - fix endpoint sanity check Input: pegasus_notetaker - fix endpoint sanity check Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register Input: evdev - convert kzalloc()/vzalloc() to kvzalloc()
2020-01-22Input: add IOC3 serio driverThomas Bogendoerfer
This patch adds a platform driver for supporting keyboard and mouse interface of SGI IOC3 chips. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Link: https://lore.kernel.org/r/20200122135220.22354-1-tbogendoerfer@suse.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-21Input: axp20x-pek - enable wakeup for all AXP variantsSamuel Holland
There are many devices, including several mobile battery-powered devices, using other AXP variants as their PMIC. Allow them to use the power key as a wakeup source. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Link: https://lore.kernel.org/r/20200115051253.32603-3-samuel@sholland.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-21Input: axp20x-pek - respect userspace wakeup configurationSamuel Holland
Unlike most other power button drivers, this driver unconditionally enables its wakeup IRQ. It should be using device_may_wakeup() to respect the userspace configuration of wakeup sources. Because the AXP20x MFD device uses regmap-irq, the AXP20x PEK IRQs are nested off of regmap-irq's threaded interrupt handler. The device core ignores such interrupts, so to actually disable wakeup, we must explicitly disable all non-wakeup interrupts during suspend. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20200115051253.32603-2-samuel@sholland.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-20Input: ads7846 - use new `delay` structure for SPI transfer delaysAlexandru Ardelean
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 bebcfd272df6485 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Link: https://lore.kernel.org/r/20191210141103.15910-1-alexandru.ardelean@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-20Input: pm8xxx-vib - fix handling of separate enable registerStephan Gerhold
Setting the vibrator enable_mask is not implemented correctly: For regmap_update_bits(map, reg, mask, val) we give in either regs->enable_mask or 0 (= no-op) as mask and "val" as value. But "val" actually refers to the vibrator voltage control register, which has nothing to do with the enable_mask. So we usually end up doing nothing when we really wanted to enable the vibrator. We want to set or clear the enable_mask (to enable/disable the vibrator). Therefore, change the call to always modify the enable_mask and set the bits only if we want to enable the vibrator. Fixes: d4c7c5c96c92 ("Input: pm8xxx-vib - handle separate enable register") Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Link: https://lore.kernel.org/r/20200114183442.45720-1-stephan@gerhold.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-16Input: keyspan-remote - fix control-message timeoutsJohan Hovold
The driver was issuing synchronous uninterruptible control requests without using a timeout. This could lead to the driver hanging on probe due to a malfunctioning (or malicious) device until the device is physically disconnected. While sleeping in probe the driver prevents other devices connected to the same hub from being added to (or removed from) the bus. The USB upper limit of five seconds per request should be more than enough. Fixes: 99f83c9c9ac9 ("[PATCH] USB: add driver for Keyspan Digital Remote") Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable <stable@vger.kernel.org> # 2.6.13 Link: https://lore.kernel.org/r/20200113171715.30621-1-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-16Input: max77650-onkey - add of_match tableBartosz Golaszewski
We need the of_match table if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-16Input: rmi_f54 - read from FIFO in 32 byte blocksHans Verkuil
The F54 Report Data is apparently read through a fifo and for the smbus protocol that means that between reading a block of 32 bytes the rmiaddr shouldn't be incremented. However, changing that causes other non-fifo reads to fail and so that change was reverted. This patch changes just the F54 function and it now reads 32 bytes at a time from the fifo, using the F54_FIFO_OFFSET to update the start address that is used when reading from the fifo. This has only been tested with smbus, not with i2c or spi. But I suspect that the same is needed there since I think similar problems will occur there when reading more than 256 bytes. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Timo Kaufmann <timokau@zoho.com> Link: https://lore.kernel.org/r/20200115124819.3191024-3-hverkuil-cisco@xs4all.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-16Revert "Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers"Hans Verkuil
This reverts commit a284e11c371e446371675668d8c8120a27227339. This causes problems (drifting cursor) with at least the F11 function that reads more than 32 bytes. The real issue is in the F54 driver, and so this should be fixed there, and not in rmi_smbus.c. So first revert this bad commit, then fix the real problem in F54 in another patch. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Timo Kaufmann <timokau@zoho.com> Fixes: a284e11c371e ("Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200115124819.3191024-2-hverkuil-cisco@xs4all.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Merge tag 'v5.5-rc5' into nextDmitry Torokhov
Sync up with mainline to get SPI "delay" API changes.
2020-01-10Input: edt-ft5x06 - use pm core to enable/disable the wake irqMarco Felsch
We do not have to handle the wake-irq within the driver because the pm core can handle this for us. The only use case for the suspend/resume callbacks was to handle the wake-irq so we can remove the callbacks. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: edt-ft5x06 - make wakeup-source switchableMarco Felsch
Since day one the touch controller acts as wakeup-source. This seems to be wrong since the device supports deep-sleep mechanism [1] which requires a reset to leave it. Also some designs won't use the touchscreen as wakeup-source. According discussion [2] we decided to break backward compatibility and go the common way by using the 'wakeup-source' device-property. [1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf [2] https://patchwork.kernel.org/patch/11149037/ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: edt-ft5x06 - alphabetical include reorderMarco Felsch
It seems that the include order is historical increased and no one takes care of it. Fix this to align it with the common rule to be in a alphabetical order. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: edt-ft5x06 - work around first register access errorPhilipp Zabel
The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00): edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40 It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: sur40 - fix interface sanity checksJohan Hovold
Make sure to use the current alternate setting when verifying the interface descriptors to avoid binding to an invalid interface. This in turn could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: bdb5c57f209c ("Input: add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-8-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: gtco - drop redundant variable reinitJohan Hovold
Drop the second, redundant reinitialisation of the endpoint-descriptor pointer from probe. Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-7-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: gtco - fix extra-descriptor debug messageJohan Hovold
Make sure to use the current altsetting when printing size of any extra descriptors of the interface. Also fix the s/endpoint/interface/ mixup in the message itself. Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-6-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: gtco - fix endpoint sanity checkJohan Hovold
The driver was checking the number of endpoints of the first alternate setting instead of the current one, something which could lead to the driver binding to an invalid interface. This in turn could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: 162f98dea487 ("Input: gtco - fix crash on detecting device without endpoints") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-5-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: aiptek - use descriptors of current altsettingJohan Hovold
Make sure to always use the descriptors of the current alternate setting to avoid future issues when accessing fields that may differ between settings. Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-4-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: aiptek - fix endpoint sanity checkJohan Hovold
The driver was checking the number of endpoints of the first alternate setting instead of the current one, something which could lead to the driver binding to an invalid interface. This in turn could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: 8e20cf2bce12 ("Input: aiptek - fix crash on detecting device without endpoints") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-3-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: pegasus_notetaker - fix endpoint sanity checkJohan Hovold
The driver was checking the number of endpoints of the first alternate setting instead of the current one, something which could be used by a malicious device (or USB descriptor fuzzer) to trigger a NULL-pointer dereference. Fixes: 1afca2b66aac ("Input: add Pegasus Notetaker tablet driver") Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Martin Kepplinger <martink@posteo.de> Acked-by: Vladis Dronov <vdronov@redhat.com> Link: https://lore.kernel.org/r/20191210113737.4016-2-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_registerChuhong Yuan
The driver misses a check for devm_thermal_zone_of_sensor_register(). Add a check to fix it. Fixes: e28d0c9cd381 ("input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-10Input: evdev - convert kzalloc()/vzalloc() to kvzalloc()Miles Chen
We observed a large(order-3) allocation in evdev_open() and it may cause an OOM kernel panic in kzalloc(), before we getting to the vzalloc() fallback. Fix it by converting kzalloc()/vzalloc() to kvzalloc() to avoid the OOM killer logic as we have a vmalloc fallback. InputReader invoked oom-killer: gfp_mask=0x240c2c0 (GFP_KERNEL|__GFP_NOWARN|__GFP_COMP|__GFP_ZERO), nodemask=0, order=3, oom_score_adj=-900 ... (dump_backtrace) from (show_stack+0x18/0x1c) (show_stack) from (dump_stack+0x94/0xa8) (dump_stack) from (dump_header+0x7c/0xe4) (dump_header) from (out_of_memory+0x334/0x348) (out_of_memory) from (__alloc_pages_nodemask+0xe9c/0xeb8) (__alloc_pages_nodemask) from (kmalloc_order_trace+0x34/0x128) (kmalloc_order_trace) from (__kmalloc+0x258/0x36c) (__kmalloc) from (evdev_open+0x5c/0x17c) (evdev_open) from (chrdev_open+0x100/0x204) (chrdev_open) from (do_dentry_open+0x21c/0x354) (do_dentry_open) from (vfs_open+0x58/0x84) (vfs_open) from (path_openat+0x640/0xc98) (path_openat) from (do_filp_open+0x78/0x11c) (do_filp_open) from (do_sys_open+0x130/0x244) (do_sys_open) from (SyS_openat+0x14/0x18) (SyS_openat) from (__sys_trace_return+0x0/0x10) ... Normal: 12488*4kB (UMEH) 6984*8kB (UMEH) 2101*16kB (UMEH) 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 139440kB HighMem: 206*4kB (H) 131*8kB (H) 42*16kB (H) 2*32kB (H) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2608kB ... Kernel panic - not syncing: Out of memory and no killable processes... Signed-off-by: Miles Chen <miles.chen@mediatek.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-01-09Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: "Just a few small fixups here" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: imx_sc_key - only take the valid data from SCU firmware as key state Input: add safety guards to input_set_keycode() Input: input_event - fix struct padding on sparc64 Input: uinput - always report EPOLLOUT
2020-01-06remove ioremap_nocache and devm_ioremap_nocacheChristoph Hellwig
ioremap has provided non-cached semantics by default since the Linux 2.6 days, so remove the additional ioremap_nocache interface. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Arnd Bergmann <arnd@arndb.de>
2019-12-19Input: apbps2 - add __iomem to register structBen Dooks (Codethink)
Add __iomem to the apbps2_priv.regs field to make the numerous warnings about differing address spaces go away. Fixes warnings such as: drivers/input/serio/apbps2.c:65:26: warning: incorrect type in argument 1 (different address spaces) drivers/input/serio/apbps2.c:65:26: expected void const volatile [noderef] <asn:2> *addr drivers/input/serio/apbps2.c:65:26: got unsigned int [noderef] * drivers/input/serio/apbps2.c:65:26: warning: incorrect type in argument 1 (different address spaces) drivers/input/serio/apbps2.c:65:26: expected void const volatile [noderef] <asn:2> *addr drivers/input/serio/apbps2.c:65:26: got unsigned int [noderef] * drivers/input/serio/apbps2.c:65:26: warning: incorrect type in argument 1 (different address spaces) drivers/input/serio/apbps2.c:65:26: expected void const volatile [noderef] <asn:2> *addr drivers/input/serio/apbps2.c:65:26: got unsigned int [noderef] * drivers/input/serio/apbps2.c:65:26: warning: incorrect type in argument 1 (different address spaces) drivers/input/serio/apbps2.c:65:26: expected void const volatile [noderef] <asn:2> *addr [rest snipped] Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> Link: https://lore.kernel.org/r/20191217122507.2157454-1-ben.dooks@codethink.co.uk Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-19Input: axp20x-pek - make device attributes staticBen Dooks (Codethink)
The two device attrbitues are not declared outside this file so make them static to avoid the following warnings: drivers/input/misc/axp20x-pek.c:194:1: warning: symbol 'dev_attr_startup' was not declared. Should it be static? drivers/input/misc/axp20x-pek.c:195:1: warning: symbol 'dev_attr_shutdown' was not declared. Should it be static? Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> Acked-by: Chen-Yu Tsai <wens@csie.org> Link: https://lore.kernel.org/r/20191217152541.2167080-1-ben.dooks@codethink.co.uk Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-13Input: imx_sc_key - only take the valid data from SCU firmware as key stateAnson Huang
When reading key state from SCU, the response data from SCU firmware is 4 bytes due to MU message protocol, but ONLY the first byte is the key state, other 3 bytes could be some dirty data, so we should ONLY take the first byte as key state to avoid reporting incorrect state. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Fixes: 688f1dfb69b4 ("Input: keyboard - imx_sc: Add i.MX system controller key support") Link: https://lore.kernel.org/r/1576202909-1661-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-13Input: add safety guards to input_set_keycode()Dmitry Torokhov
If we happen to have a garbage in input device's keycode table with values too big we'll end up doing clear_bit() with offset way outside of our bitmaps, damaging other objects within an input device or even outside of it. Let's add sanity checks to the returned old keycodes. Reported-by: syzbot+c769968809f9359b07aa@syzkaller.appspotmail.com Reported-by: syzbot+76f3a30e88d256644c78@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-13Input: input_event - fix struct padding on sparc64Arnd Bergmann
Going through all uses of timeval, I noticed that we screwed up input_event in the previous attempts to fix it: The time fields now match between kernel and user space, but all following fields are in the wrong place. Add the required padding that is implied by the glibc timeval definition to fix the layout, and use a struct initializer to avoid leaking kernel stack data. Fixes: 141e5dcaa735 ("Input: input_event - fix the CONFIG_SPARC64 mixup") Fixes: 2e746942ebac ("Input: input_event - provide override for sparc64") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20191213204936.3643476-2-arnd@arndb.de Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-13Input: uinput - always report EPOLLOUTDmitry Torokhov
uinput device is always available for writing so we should always report EPOLLOUT and EPOLLWRNORM bits, not only when there is nothing to read from the device. Fixes: d4b675e1b527 ("Input: uinput - fix returning EPOLLOUT from uinput_poll") Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20191209202254.GA107567@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-12Input: elants_i2c - check Remark ID when attempting firmware updateJohnny.Chuang
To avoid flashing incompatible firmware onto a device we should check whether "Remark ID" in firmware matches with the one in the controller. This function is supported by Elan's latest version of boot code, so the driver decides whether to perform the check based on the boot code version. Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw> Link: https://lore.kernel.org/r/00a901d5af3c$193e9cd0$4bbbd670$@emc.com.tw Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-07Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull more input updates from Dmitry Torokhov: - fixups for Synaptics RMI4 driver - a quirk for Goodinx touchscreen on Teclast tablet - a new keycode definition for activating privacy screen feature found on a few "enterprise" laptops - updates to snvs_pwrkey driver - polling uinput device for writing (which is always allowed) now works * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash Input: goodix - add upside-down quirk for Teclast X89 tablet Input: add privacy screen toggle keycode Input: uinput - fix returning EPOLLOUT from uinput_poll Input: snvs_pwrkey - remove gratuitous NULL initializers Input: snvs_pwrkey - send key events for i.MX6 S, DL and Q
2019-12-06Merge branch 'next' into for-linusDmitry Torokhov
Prepare second round of updates for 5.5 merge window.
2019-12-04Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfersHans Verkuil
This increment of rmi_smbus in rmi_smb_read/write_block() causes garbage to be read/written. The first read of SMB_MAX_COUNT bytes is fine, but after that it is nonsense. Trial-and-error showed that by dropping the increment of rmiaddr everything is fine and the F54 function properly works. I tried a hack with rmi_smb_write_block() as well (writing to the same F54 touchpad data area, then reading it back), and that suggests that there too the rmiaddr increment has to be dropped. It makes sense that if it has to be dropped for read, then it has to be dropped for write as well. It looks like the initial work with F54 was done using i2c, not smbus, and it seems nobody ever tested F54 with smbus. The other functions all read/write less than SMB_MAX_COUNT as far as I can tell, so this issue was never noticed with non-F54 functions. With this change I can read out the touchpad data correctly on my Lenovo X1 Carbon 6th Gen laptop. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Link: https://lore.kernel.org/r/8dd22e21-4933-8e9c-a696-d281872c8de7@xs4all.nl Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-04Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflashLucas Stach
F34 is a bit special as it reinitializes the device and related driver structs during the firmware update. This clears the fn_irq_mask which will then prevent F34 from receiving further interrupts, leading to timeouts during the firmware update. Make sure to reinitialize the IRQ enables at the appropriate times. The issue is in F34 code, but the commit in the fixes tag exposed the issue, as before this commit things would work by accident. Fixes: 363c53875aef (Input: synaptics-rmi4 - avoid processing unknown IRQs) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Link: https://lore.kernel.org/r/20191129133514.23224-1-l.stach@pengutronix.de Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-04Input: goodix - add upside-down quirk for Teclast X89 tabletHans de Goede
The touchscreen on the Teclast X89 is mounted upside down in relation to the display orientation (the touchscreen itself is mounted upright, but the display is mounted upside-down). Add a quirk for this so that we send coordinates which match the display orientation. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Link: https://lore.kernel.org/r/20191202085636.6650-1-hdegoede@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-04Input: uinput - fix returning EPOLLOUT from uinput_pollMarcel Holtmann
Always return EPOLLOUT from uinput_poll to allow polling /dev/uinput for writable state. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Link: https://lore.kernel.org/r/20191204025014.5189-1-marcel@holtmann.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-04Input: snvs_pwrkey - remove gratuitous NULL initializersDmitry Torokhov
Gratuitous NULL initializers rarely help and often prevent compiler from warning about using uninitialized variable. Let's remove them. Reviewed-by: Anson Huang <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/20191125211407.GA97812@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-12-03Merge tag 'tag-chrome-platform-for-v5.5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform changes from Benson Leung: "CrOS EC / MFD / IIO: - Contains tag-ib-chrome-mfd-iio-input-5.5, which is the first part of a series from Gwendal to refactor sensor code between MFD, CrOS EC, iio and input in order to add a new sensorhub driver and FIFO processing Wilco EC: - Add support for Dell's USB PowerShare policy control, keyboard backlight LED driver, and a new test_event file. - Fixes use after free in wilco_ec's telemetry driver. Misc: - bugfix in cros_usbpd_logger (missing destroy workqueue)" * tag 'tag-chrome-platform-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: wilco_ec: fix use after free issue platform/chrome: cros_ec: Add Kconfig default for cros-ec-sensorhub Revert "Input: cros_ec_keyb: mask out extra flags in event_type" Revert "Input: cros_ec_keyb - add back missing mask for event_type" platform/chrome: cros_ec: handle MKBP more events flag platform/chrome: cros_ec: Do not attempt to register a non-positive IRQ number platform/chrome: cros-ec: Record event timestamp in the hard irq mfd / platform / iio: cros_ec: Register sensor through sensorhub iio / platform: cros_ec: Add cros-ec-sensorhub driver mfd / platform: cros_ec: Add sensor_count and make check_features public platform/chrome: cros_ec: Put docs with the code platform/chrome: cros_usbpd_logger: add missed destroy_workqueue in remove platform/chrome: cros_ec: Fix Kconfig indentation platform/chrome: wilco_ec: Add keyboard backlight LED support platform/chrome: wilco_ec: Add charging config driver platform/chrome: wilco_ec: Add Dell's USB PowerShare Policy control platform/chrome: wilco_ec: Add debugfs test_event file
2019-11-25Input: snvs_pwrkey - send key events for i.MX6 S, DL and QRobin van der Gracht
The first generation i.MX6 processors does not send an interrupt when the power key is pressed. It sends a power down request interrupt if the key is released before a hard shutdown (5 second press). This should allow software to bring down the SoC safely. For this driver to work as a regular power key with the older SoCs, we need to send a keypress AND release when we get the power down request irq. Signed-off-by: Robin van der Gracht <robin@protonic.nl> Link: https://lore.kernel.org/r/20191125161210.8275-1-robin@protonic.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-25Merge branch 'next' into for-linusDmitry Torokhov
Prepare input updates for 5.5 merge window.
2019-11-22Input: synaptics-rmi4 - fix various V4L2 compliance problems in F54Hans Verkuil
The v4l2-compliance utility reported several V4L2 API compliance issues: - the sequence counter wasn't filled in - the sequence counter wasn't reset to 0 at the start of streaming - the returned field value wasn't set to V4L2_FIELD_NONE - the timestamp wasn't set - the payload size was undefined if an error was returned - min_buffers_needed doesn't need to be initialized Fix these issues. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Lucas Stach <l.stach@pengutronix.de Link: https://lore.kernel.org/r/20191119105118.54285-3-hverkuil-cisco@xs4all.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-22Input: synaptics - switch another X1 Carbon 6 to RMI/SMbusHans Verkuil
Some Lenovo X1 Carbon Gen 6 laptops report LEN0091. Add this to the smbus_pnp_ids list. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191119105118.54285-2-hverkuil-cisco@xs4all.nl Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>