aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-07-25Input: synaptics - enable RMI mode for HP Spectre X360Dmitry Torokhov1-0/+1
The 2016 kabylake HP Spectre X360 (model number 13-w013dx) works much better with psmouse.synaptics_intertouch=1 kernel parameter, so let's enable RMI4 mode automatically. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204115 Reported-by: Nate Graham <pointedstick@zoho.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-24Input: elantech - annotate fall-through case in elantech_use_host_notify()Dmitry Torokhov1-0/+1
This avoids a warning when building with -Wimplicit-fallthrough. Fixes: 883a2a80f79c ("Input: elantech - enable SMBus on new (2018+) systems") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-23Input: elantech - enable SMBus on new (2018+) systemsKai-Heng Feng1-29/+25
There are some new HP laptops with Elantech touchpad that don't support multitouch. Currently we use ETP_NEW_IC_SMBUS_HOST_NOTIFY() to check if SMBus is supported, but in addition to firmware version, the bus type also informs us whether the IC can support SMBus. To avoid breaking old ICs, we will only enable SMbus support based the bus type on systems manufactured after 2018. Lastly, let's consolidate all checks into elantech_use_host_notify() and use it to determine whether to use PS/2 or SMBus. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-23Input: applespi - fix trivial typo in struct descriptionNikolas Nyby1-4/+4
This fixes a typo in the keyboard_protocol description. coodinate -> coordinate. Signed-off-by: Nikolas Nyby <nikolas@gnu.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-23Input: applespi - select CRC16 moduleArnd Bergmann1-0/+1
In some rare randconfig builds, CRC16 is disabled, which leads to a link error: drivers/input/keyboard/applespi.o: In function `applespi_send_cmd_msg': applespi.c:(.text+0x449f): undefined reference to `crc16' drivers/input/keyboard/applespi.o: In function `applespi_verify_crc': applespi.c:(.text+0x7538): undefined reference to `crc16' This symbol is meant to be selected for each user in Kconfig, so do that here as well. Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-21Input: applespi - fix warnings detected by sparseRonald Tschalär1-7/+11
This makes sure that we convert from on-wire to CPU endianness in applespi_debug_update_dimensions() and also marks as "static" as it is not needed to be visible outside of the driver. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Ronald Tschalär <ronald@innovation.ch> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-20Merge branch 'next' into for-linusDmitry Torokhov377-2611/+2576
Prepare second round of input updates for 5.3 merge window.
2019-07-19Input: alps - fix a mismatch between a condition check and its commentHui Wang1-1/+1
In the function alps_is_cs19_trackpoint(), we check if the param[1] is in the 0x20~0x2f range, but the code we wrote for this checking is not correct: (param[1] & 0x20) does not mean param[1] is in the range of 0x20~0x2f, it also means the param[1] is in the range of 0x30~0x3f, 0x60~0x6f... Now fix it with a new condition checking ((param[1] & 0xf0) == 0x20). Fixes: 7e4935ccc323 ("Input: alps - don't handle ALPS cs19 trackpoint-only device") Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-19Input: psmouse - fix build error of multiple definitionYueHaibing1-1/+2
trackpoint_detect() should be static inline while CONFIG_MOUSE_PS2_TRACKPOINT is not set, otherwise, we build fails: drivers/input/mouse/alps.o: In function `trackpoint_detect': alps.c:(.text+0x8e00): multiple definition of `trackpoint_detect' drivers/input/mouse/psmouse-base.o:psmouse-base.c:(.text+0x1b50): first defined here Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 55e3d9224b60 ("Input: psmouse - allow disabing certain protocol extensions") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-19Input: applespi - remove set but not used variables 'sts'Mao Wenan1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/input/keyboard/applespi.c: In function applespi_set_bl_level: drivers/input/keyboard/applespi.c:902:6: warning: variable sts set but not used [-Wunused-but-set-variable] Fixes: b426ac0452093d ("Input: add Apple SPI keyboard and trackpad driver") Signed-off-by: Mao Wenan <maowenan@huawei.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-19Input: add Apple SPI keyboard and trackpad driverRonald Tschalär5-0/+2117
The keyboard and trackpad on recent MacBook's (since 8,1) and MacBookPro's (13,* and 14,*) are attached to an SPI controller instead of USB, as previously. The higher level protocol is not publicly documented and hence has been reverse engineered. As a consequence there are still a number of unknown fields and commands. However, the known parts have been working well and received extensive testing and use. In order for this driver to work, the proper SPI drivers need to be loaded too; for MB8,1 these are spi_pxa2xx_platform and spi_pxa2xx_pci; for all others they are spi_pxa2xx_platform and intel_lpss_pci. Link: https://bugzilla.kernel.org/show_bug.cgi?id=99891 Link: https://bugzilla.kernel.org/show_bug.cgi?id=108331 Signed-off-by: Ronald Tschalär <ronald@innovation.ch> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Input: alps - don't handle ALPS cs19 trackpoint-only deviceHui Wang1-0/+32
On a latest Lenovo laptop, the trackpoint and 3 buttons below it don't work at all, when we move the trackpoint or press those 3 buttons, the kernel will print out: "Rejected trackstick packet from non DualPoint device" This device is identified as an alps touchpad but the packet has trackpoint format, so the alps.c drops the packet and prints out the message above. According to XiaoXiao's explanation, this device is named cs19 and is trackpoint-only device, its firmware is only for trackpoint, it is independent of touchpad and is a device completely different from DualPoint ones. To drive this device with mininal changes to the existing driver, we just let the alps driver not handle this device, then the trackpoint.c will be the driver of this device if the trackpoint driver is enabled. (if not, this device will fallback to a bare PS/2 device) With the trackpoint.c, this trackpoint and 3 buttons all work well, they have all features that the trackpoint should have, like scrolling-screen, drag-and-drop and frame-selection. Signed-off-by: XiaoXiao Liu <sliuuxiaonxiao@gmail.com> Signed-off-by: Hui Wang <hui.wang@canonical.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Input: hyperv-keyboard - remove dependencies on PAGE_SIZE for ring bufferMaya Nakamura1-2/+2
Define the ring buffer size as a constant expression because it should not depend on the guest page size. Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Input: adp5589 - initialize GPIO controller parent deviceLars-Peter Clausen1-0/+1
While not strictly required for normal operation setting the GPIO parent device allows the GPIO framework to generate more verbose debug output for the GPIO chip. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Input: iforce - remove empty multiline commentsTim Schumacher6-18/+0
Those are remnants of the SPDX identifier migration, which haven't been removed properly. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Merge tag 'v5.2' into nextDmitry Torokhov374-2597/+422
Sync up with mainline to resolve conflicts in iforce driver.
2019-07-15Input: synaptics - fix misuse of strlcpyJoe Perches1-1/+1
Probable cut&paste typo - use the correct field size. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-13Input: auo-pixcir-ts - switch to using devm_add_action_or_reset()Fuqian Huang1-2/+1
devm_add_action_or_reset() is introduced as a helper function which internally calls devm_add_action(). If devm_add_action() fails then it will execute the action mentioned and return the error code. This reduce source code size (avoid writing the action twice) and reduce the likelyhood of bugs. Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-13Input: gtco - bounds check collection indent levelGrant Hernandez1-3/+17
The GTCO tablet input driver configures itself from an HID report sent via USB during the initial enumeration process. Some debugging messages are generated during the parsing. A debugging message indentation counter is not bounds checked, leading to the ability for a specially crafted HID report to cause '-' and null bytes be written past the end of the indentation array. As long as the kernel has CONFIG_DYNAMIC_DEBUG enabled, this code will not be optimized out. This was discovered during code review after a previous syzkaller bug was found in this driver. Signed-off-by: Grant Hernandez <granthernandez@google.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-11Input: mtk-pmic-keys - add of_node_put() before returnNishka Dasgupta1-2/+7
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in three places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-11Input: sun4i-lradc-keys - add of_node_put() before returnNishka Dasgupta1-0/+3
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in three places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-11Input: synaptics - whitelist Lenovo T580 SMBus intertouchNick Black1-0/+1
Adds the Lenovo T580 to the SMBus intertouch list for Synaptics touchpads. I've tested with this for a week now, and it seems a great improvement. It's also nice to have the complaint gone from dmesg. Signed-off-by: Nick Black <dankamongmen@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-10Merge branch 'next' into for-linusDmitry Torokhov34-789/+1138
Prepare input updates for 5.3 merge window.
2019-07-06Input: gpio_keys_polled - allow specifying name of input deviceEnrico Weigelt, metux IT consult1-1/+3
Instead of hardcoding the input name to the driver name ('gpio-keys-polled'), allow specifying the name of the device via "label" property. If the property is not present (nor name is set in board-supplied platform data), we'll default to the old name. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-05Input: edt-ft5x06 - simplify event reporting codeDmitry Torokhov1-9/+4
Now that input_mt_report_slot_state() returns true if slot is active we no longer need a temporary for the slot state. Tested-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-05Input: max77650-onkey - add MODULE_ALIAS()Bartosz Golaszewski1-0/+1
Define a MODULE_ALIAS() in the input sub-driver for max77650 so that the appropriate module gets loaded together with the core mfd driver. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-05Input: atmel_mxt_ts - fix leak in mxt_update_cfg()Ian Ray1-1/+2
Fix leak (whose magnitude is the configuration file size) when the CRCs match in mxt_update_cfg(). Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-01Input: synaptics - enable SMBUS on T480 thinkpad trackpadCole Rogers1-0/+1
Thinkpad t480 laptops had some touchpad features disabled, resulting in the loss of pinch to activities in GNOME, on wayland, and other touch gestures being slower. This patch adds the touchpad of the t480 to the smbus_pnp_ids whitelist to enable the extra features. In my testing this does not break suspend (on fedora, with wayland, and GNOME, using the rc-6 kernel), while also fixing the feature on a T480. Signed-off-by: Cole Rogers <colerogers@disroot.org> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-01Input: atmel_mxt_ts - fix -Wunused-const-variableNathan Huckleberry1-10/+10
Clang produces the following warning drivers/input/touchscreen/atmel_mxt_ts.c:259:42: warning: unused variable 'mxt_video_fops' [-Wunused-const-variable] static const struct v4l2_file_operations mxt_video_fops = { Since mxt_video_fops is only used inside an ifdef. It should be moved inside the ifdef. Link: https://github.com/ClangBuiltLinux/linux/issues/527 Signed-off-by: Nathan Huckleberry <nhuck@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-30Input: joydev - extend absolute mouse detectionAlexander Tsoy1-2/+22
Extend event signature matching to catch more input devices emulated by BMC firmwares, QEMU and VMware. Signed-off-by: Alexander Tsoy <alexander@tsoy.me> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-30Input: elan_i2c - export the device id whitelistJeffrey Hugo1-49/+1
Elan_i2c and hid-quirks work in conjunction to decide which devices each driver will handle. Elan_i2c has a whitelist of devices that should be consumed by hid-quirks so that there is one master list of devices to handoff between the drivers. Put the ids in a header file so that hid-quirks can consume it instead of duplicating the list. Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-30Input: edt-ft5x06 - use get_unaligned_be16()Dmitry Torokhov1-2/+3
Instead of doing conversion by hand, let's use the proper accessors. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-29Merge branch 'iforce' into nextDmitry Torokhov8-410/+424
Bring in improvements to driver for I-Force devices.
2019-06-22Input: iforce - add the Saitek R440 Force WheelTim Schumacher2-0/+2
This is added based on the fact that this is an iforce-based device and that the Windows driver for the R440 works for the Logitech WingMan Formula Force after replacing the device/vendor IDs. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use unaligned accessors, where appropriateDmitry Torokhov2-7/+12
Instead of open-coding conversion from/to little-endian, let's use proper accessors. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - drop couple of temps from transport codeDmitry Torokhov2-10/+4
Transport initialization code now deals mostly with transport-specific data, so we can drop couple of temporary variables. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - drop bus type from iforce structureDmitry Torokhov3-7/+0
It is not needed anymore as behavior is controlled by the transport operations set up for given device. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use DMA-safe buffores for USB transfersDmitry Torokhov3-15/+25
USB transport has to use cache line-aligned buffers for transfers to avoid DMA issues; serio doe snot have such restrictions. Let's move "data_in" buffer from main driver structure into transport modules and make sure USB requirements are respected. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - allow callers supply data buffer when fetching device IDsDmitry Torokhov4-30/+47
We want to move buffer handling into transport layers as the properties of buffers (DMA-safety, alignment, etc) are different for different transports. To allow this, let's allow caller to specify their own buffers for the results of iforce_get_id_packet() and let transport drivers to figure what buffers they need to use for transfers. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - only call iforce_process_packet() if initializedDmitry Torokhov2-4/+1
It is excessive to check if device is fully initialized in iforce_process_packet(), as for USB-conected devices we do not start collecting reports until the device is fully initialized. Let's change serio transport code to not call iforce_process_packet() until device initialization is done. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - signal command completion from transport codeDmitry Torokhov2-5/+6
Signalling command completion from iforce_process_packet() does not make sense, as not all transport use the same data path for both commands and motion data form the device, that is why USB code already has to signal command completion iforce_usb_out(). Let's move signalling completion into individual transport modules. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - do not combine arguments for iforce_process_packet()Dmitry Torokhov4-11/+13
Current code combines packet type and data length into single argument to iforce_process_packet() and then has to untangle it. It is much clearer to simply use separate arguments. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - factor out hat handling when parsing packetsDmitry Torokhov1-44/+57
This makes code clearer a bit. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - update formatting of switch statementsDmitry Torokhov3-100/+100
According to our coding style case labels in switch statements should be aligned with the switch keyword. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use DMA-safe buffer when getting IDs from USBDmitry Torokhov1-46/+22
When working with USB devices we need to use DMA-safe buffers, and iforce->edata is not one. Let's rework the code to allocate temporary buffer (iforce_get_id() is called only during initialization so there is no reason to have permanent buffer) and use it. While at it, let's utilize usb_control_msg() API which simplifies code. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - split into core and transport modulesDmitry Torokhov7-43/+25
Now that we have moved enough transport details into separate source files we can change them into transport modules so that they are only loaded when needed. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - move transport data into transport modulesDmitry Torokhov3-104/+144
This moves transport-specific data from main iforce structure into transport modules. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - add bus type and parent arguments to iforce_init_device()Dmitry Torokhov4-18/+8
Note that the parent device for the USB-connected controllers is now USB interface instead of USB device. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - introduce start and stop io transport opsDmitry Torokhov4-23/+34
Add start_io() and stop_io() transport methods so that core does not have to know the details. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - move command completion handling to serio codeDmitry Torokhov2-8/+11
Continue teasing apart protocol-specific bits from core into transport modules. This time move RS232-specific command completion handling from core to iforce-serio module. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>