summaryrefslogtreecommitdiff
path: root/drivers/input
AgeCommit message (Collapse)Author
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>
2019-11-22Input: fix Kconfig indentationKrzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/1574306373-29581-1-git-send-email-krzk@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-22Revert "Input: synaptics - enable RMI mode for X1 Extreme 2nd Generation"Lyude Paul
This reverts commit 68b9c5066e39af41d3448abfc887c77ce22dd64d. Ugh, I really dropped the ball on this one :\. So as it turns out RMI4 works perfectly fine on the X1 Extreme Gen 2 except for one thing I didn't notice because I usually use the trackpoint: clicking with the touchpad. Somehow this is broken, in fact we don't even seem to indicate BTN_LEFT as a valid event type for the RMI4 touchpad. And, I don't even see any RMI4 events coming from the touchpad when I press down on it. This only seems to work for PS/2 mode. Since that means we have a regression, and PS/2 mode seems to work fine for the time being - revert this for now. We'll have to do a more thorough investigation on this. Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://lore.kernel.org/r/20191119234534.10725-1-lyude@redhat.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-21Revert "Input: cros_ec_keyb: mask out extra flags in event_type"Gwendal Grignou
This reverts commit d096aa3eb6045a6a475a0239f3471c59eedf3d61. This patch is not needed anymore since we clear EC_MKBP_HAS_MORE_EVENTS flag before calling the notifiers in patch "9d9518f5b52a (platform: chrome: cros_ec: handle MKBP more events flag)" Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-11-21Revert "Input: cros_ec_keyb - add back missing mask for event_type"Gwendal Grignou
This reverts commit 62c3801619e16b68a37ea899b76572145dfe41c9. This patch is not needed anymore since we clear EC_MKBP_HAS_MORE_EVENTS flag before calling the notifiers in patch "9d9518f5b52a (platform: chrome: cros_ec: handle MKBP more events flag)" Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-11-15Input: synaptics - enable RMI mode for X1 Extreme 2nd GenerationLyude Paul
Just got one of these for debugging some unrelated issues, and noticed that Lenovo seems to have gone back to using RMI4 over smbus with Synaptics touchpads on some of their new systems, particularly this one. So, let's enable RMI mode for the X1 Extreme 2nd Generation. Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://lore.kernel.org/r/20191115221814.31903-1-lyude@redhat.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-15Input: imx_sc_key - correct SCU message structure to avoid stack corruptionAnson Huang
The SCU message's data field used for receiving response data from SCU should be 32-bit width, as SCU will send back 32-bit width data. This solves kernel panic when CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG is enabled. [ 1.950768] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted [ 1.980607] Workqueue: events imx_sc_check_for_events [ 1.985657] Call trace: [ 1.988104] dump_backtrace+0x0/0x140 [ 1.991768] show_stack+0x14/0x20 [ 1.995090] dump_stack+0xb4/0xf8 [ 1.998407] panic+0x158/0x324 [ 2.001463] print_tainted+0x0/0xa8 [ 2.004950] imx_sc_check_for_events+0x18c/0x190 [ 2.009569] process_one_work+0x198/0x320 [ 2.013579] worker_thread+0x48/0x420 [ 2.017252] kthread+0xf0/0x120 [ 2.020394] ret_from_fork+0x10/0x18 [ 2.023977] SMP: stopping secondary CPUs [ 2.027901] Kernel Offset: disabled [ 2.031391] CPU features: 0x0002,2100600c [ 2.035401] Memory Limit: none 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/1573730499-2224-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-15Input: synaptics-rmi4 - destroy F54 poller workqueue when removingChuhong Yuan
The driver forgets to destroy workqueue in remove() similarly to what is done when probe() fails. Add a call to destroy_workqueue() to fix it. Since unregistration will wait for the work to finish, we do not need to cancel/flush the work instance in remove(). Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191114023405.31477-1-hslester96@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-15Input: ff-memless - kill timer in destroy()Oliver Neukum
No timer must be left running when the device goes away. Signed-off-by: Oliver Neukum <oneukum@suse.com> Reported-and-tested-by: syzbot+b6c55daa701fc389e286@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1573726121.17351.3.camel@suse.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-12Input: cyttsp4_core - fix use after free bugPan Bian
The device md->input is used after it is released. Setting the device data to NULL is unnecessary as the device is never used again. Instead, md->input should be assigned NULL to avoid accessing the freed memory accidently. Besides, checking md->si against NULL is superfluous as it points to a variable address, which cannot be NULL. Signed-off-by: Pan Bian <bianpan2016@163.com> Link: https://lore.kernel.org/r/1572936379-6423-1-git-send-email-bianpan2016@163.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-12Input: synaptics-rmi4 - clear IRQ enables for F54Lucas Stach
The driver for F54 just polls the status and doesn't even have a IRQ handler registered. Make sure to disable all F54 IRQs, so we don't crash the kernel on a nonexistent handler. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Link: https://lore.kernel.org/r/20191105114402.6009-1-l.stach@pengutronix.de Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-12Input: ili210x - optionally show calibrate sysfs attributeSven Van Asbroeck
Only show the 'calibrate' sysfs attribute on chip flavours which support calibration by writing to a calibration register. Do this by adding a flag to the chip operations structure. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Link: https://lore.kernel.org/r/20191112210148.3535-2-TheSven73@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-12Input: ili210x - add resolution to chip operations structureSven Van Asbroeck
Optionally allow the touch screen resolution to be set by adding it to the chip operations structure. If it is omitted (left zero), the resolution defaults to 64K. Which is the previously hard-coded value. Set the ili2117 resolution to 2048, as indicated in its datasheet. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Link: https://lore.kernel.org/r/20191112210148.3535-1-TheSven73@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-12Input: ili210x - do not retrieve/print chip firmware versionSven Van Asbroeck
The driver's method to retrieve the firmware version on ili2117/ ili2118 chip flavours is incorrect. The firmware version register address and layout are wrong. The firmware version is not actually used anywhere inside or outside this driver. There is a dev_dbg() print, but that is only visible when the developer explicitly compiles in debug support. Don't make the code more complicated to preserve a feature that no-one is using. Remove all code associated with chip firmware version. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Link: https://lore.kernel.org/r/20191112164429.11225-1-TheSven73@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: mms114 - use device_get_match_dataStephan Gerhold
device_get_match_data is available now, so we can replace the call to of_device_get_match_data and remove the FIXME comment. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Andi Shyti <andi@etezian.org> Link: https://lore.kernel.org/r/20191007203343.101466-2-stephan@gerhold.net Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Merge branch 'ili2xxx-touchscreen' into nextDmitry Torokhov
Bring in improvements to ili2xxx driver, including support for 2117A/2118A controllers.
2019-11-11Input: ili210x - remove unneeded suspend and resume handlersDmitry Torokhov
When I2C client is instantiated with I2C_CLIENT_WAKE flag (either via "wakeup-source" device property, or via board info flag), it will mark the main IRQ line as wakeup IRQ, which will ensure that it will be enabled for wakeup when system transitions to suspend state. Since our suspend/resume handlers were only managing IRQ wakeup state, they are no longer needed, and can be removed. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - do not unconditionally mark touchscreen as wakeup sourceDmitry Torokhov
I2C devices that are supposed to be wakeup sources should be instantiated with I2C_CLIENT_WAKE flag (which can be either set by in board info, or retrieved from "wakeup-source" property); individual drivers should not be marking devices as wakeup sources unconditionally. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - define and use chip operations structureDmitry Torokhov
Instead of doing if/else if/else on the chip's model number let's define chip operations structure and use it to perform indirect calls. With number of protocols supported by the driver growing, this makes it better maintainable. This change includes fixes to checks whether the driver should continue polling the controller by Sven Van Asbroeck <thesven73@gmail.com>. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - do not set parent device explicitlyDmitry Torokhov
We are using devm_input_allocate_device() that set's up the parent for us, no need to do it ourselves. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - handle errors from input_mt_init_slots()Dmitry Torokhov
input_mt_init_slots() may fail and we need to handle such failures. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - switch to using threaded IRQDmitry Torokhov
Let's switch the driver to using threaded IRQ so that we do not need to manage the interrupt and work separately, and we do not acknowledge interrupt until we finished handling it completely. Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Tested-by: Marek Vasut <marex@denx.de> # ILI2117 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ili210x - add ILI2117 supportMarek Vasut
Add support for ILI2117 touch controller. This controller is similar to the ILI210x and ILI251x, except for the following differences: - Reading out of touch data must happen at most 300 mS after the interrupt line was asserted. No command must be sent, the data are returned upon pure I2C read of 43 bytes long. - Supports 10 simultaneous touch inputs. - Touch data format is slightly different. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Rob Herring <robh@kernel.org> # for DT binding Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-11Input: ar1021 - fix typo in preprocessor macro nameFlavio Suligoi
Fix spelling mistake. Signed-off-by: Flavio Suligoi <f.suligoi@asem.it> Link: https://lore.kernel.org/r/1573211947-660-1-git-send-email-f.suligoi@asem.it Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-04Input: synaptics-rmi4 - simplify data read in rmi_f54_workLucas Stach
The body of the for loop is only ever run once as the second standard_report element is never changed from its initial zero init, so the loop condition is never satisfies after the first run. Equally the start member of the first element is never changed from 0, so the index offset is always a constant 0. Remove this needless obfuscation of the code and write it in a straight forward manner. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Link: https://lore.kernel.org/r/20191104114454.10500-3-l.stach@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-04Input: synaptics-rmi4 - remove unused result_bits maskAndrew Duggan
The result_bits mask is no longer used by the driver and should be removed. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Link: https://lore.kernel.org/r/20191025002527.3189-4-aduggan@synaptics.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-04Input: synaptics-rmi4 - do not consume more data than we have (F11, F12)Andrew Duggan
Currently, rmi_f11_attention() and rmi_f12_attention() functions update the attn_data data pointer and size based on the size of the expected size of the attention data. However, if the actual valid data in the attn buffer is less then the expected value then the updated data pointer will point to memory beyond the end of the attn buffer. Using the calculated valid_bytes instead will prevent this from happening. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191025002527.3189-3-aduggan@synaptics.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-04Input: synaptics-rmi4 - disable the relative position IRQ in the F12 driverAndrew Duggan
This patch fixes an issue seen on HID touchpads which report finger positions using RMI4 Function 12. The issue manifests itself as spurious button presses as described in: https://www.spinics.net/lists/linux-input/msg58618.html Commit 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain") switched the RMI4 driver to using an irq_domain to handle RMI4 function interrupts. Functions with more then one interrupt now have each interrupt mapped to their own IRQ and IRQ handler. The result of this change is that the F12 IRQ handler was now getting called twice. Once for the absolute data interrupt and once for the relative data interrupt. For HID devices, calling rmi_f12_attention() a second time causes the attn_data data pointer and size to be set incorrectly. When the touchpad button is pressed, F30 will generate an interrupt and attempt to read the F30 data from the invalid attn_data data pointer and report incorrect button events. This patch disables the F12 relative interrupt which prevents rmi_f12_attention() from being called twice. Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reported-by: Simon Wood <simon@mungewell.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191025002527.3189-2-aduggan@synaptics.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-11-04Input: synaptics-rmi4 - fix video buffer sizeLucas Stach
The video buffer used by the queue is a vb2_v4l2_buffer, not a plain vb2_buffer. Using the wrong type causes the allocation of the buffer storage to be too small, causing a out of bounds write when __init_vb2_v4l2_buffer initializes the buffer. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 diagnostics") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191104114454.10500-1-l.stach@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: kxtj9 - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts kxtj9 driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. note that with regular input devices handling polling, there is no longer a benefit in having separate INPUT_KXTJ9_POLLED_MODE config option. Link: https://lore.kernel.org/r/20191017204217.106453-23-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: kxtj9 - switch to using managed resourcesDmitry Torokhov
Using devm API allows to clean up error handling and drop the remove() method. Link: https://lore.kernel.org/r/20191017204217.106453-22-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: bma150 - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts bma150 driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191017204217.106453-21-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: bma150 - use managed resources helpersJonathan Bakker
The driver can be cleaned up by using managed resource helpers. Signed-off-by: Jonathan Bakker <xc-racer2@live.ca> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> [dtor: do not explicitly set parent of input device since we are using devm] Link: https://lore.kernel.org/r/20191017204217.106453-20-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: mma8450 - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts mma8450 driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191017204217.106453-19-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: gpio_decoder - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts gpio_decoder driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191017204217.106453-18-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: rb532_button - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts rb532_button driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191017204217.106453-17-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: rb532_button - switch to using managed resourcesDmitry Torokhov
Using devm API allows us to clean up error handling paths and drop the remove() method. Link: https://lore.kernel.org/r/20191017204217.106453-16-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: sgi_btns - switch to using polled mode of input devicesDmitry Torokhov
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts sgi_btns driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191017204217.106453-15-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: sgi_btns - switch to using managed resourcesDmitry Torokhov
Switching to devm API allows to clean up error handling paths and drop the remove() method. Link: https://lore.kernel.org/r/20191017204217.106453-14-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>