summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-lenovo.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: lenovo: Add support for IBM/Lenovo Scrollpoint micepgzh2018-04-251-0/+36
| | | | | | | | | | | | | | The IBM/Lenovo Scrollpoint mice feature a trackpoint-like stick instead of a scrolling wheel capable of 2-D (vertical+horizontal) scrolling. hid-generic does only expose 1-D (vertical) scrolling functionality for these mice. This patch adds support for horizontal scrolling for the IBM/Lenovo Scrollpoint mice to hid-lenovo. [jkosina@suse.cz: remove change versioning from git changelog] Signed-off-by: Peter Ganzhorn <peter.ganzhorn@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Peter De Wachter <pdewacht@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Don't use stack variables for DMA buffersJosh Boyer2016-03-291-3/+13
| | | | | | | | | | | | | | | The lenovo_send_cmd_cptkbd function uses a stack variable to submit commands via hid_hw_raw_request. Eventually this gets to the usb_hcd_map_urb_for_dma function, which causes a warning to be thrown if the CONFIG_DMA_API_DEBUG option is enabled. Fix this by allocating a temporary buffer instead. [jkosina@suse.cz: no need to NULL-initialize buf, spotted by Benjamin] Reported-by: lejeczek <peljasz@yahoo.co.uk> Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: use to_hid_device()Geliang Tang2015-12-281-18/+18
| | | | | | | Use to_hid_device() instead of container_of(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: hid-input: allow input_configured callback return errorsDmitry Torokhov2015-11-051-1/+3
| | | | | | | | | | | | | | | | When configuring input device via input_configured callback we may encounter errors (for example input_mt_init_slots() may fail). Instead of continuing with half-initialized input device let's allow driver indicate failures. Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com> Signed-off-by: Arve Hjønnevåg <arve@android.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> Acked-by: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Hide middle-button press until releaseJamie Lentin2015-08-121-0/+50
| | | | | | | | | Don't relay a middle button press to userspace until release, and then only if there was no scroll events inbetween. This is closer to what Xorg's wheel emulation does, and avoids spurious middle-click pastes. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Add missing return-value checkJamie Lentin2015-08-121-1/+4
| | | | | Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Use constants for axes namesJamie Lentin2015-08-121-2/+2
| | | | | Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
*-. Merge branches 'for-4.2/i2c-hid', 'for-4.2/lenovo', 'for-4.2/plantronics', ↵Jiri Kosina2015-06-221-0/+50
|\ \ | | | | | | | | | | | | | | | | | | 'for-4.2/rmi', 'for-4.2/sensor-hub', 'for-4.2/sjoy', 'for-4.2/sony' and 'for-4.2/wacom' into for-linus Conflicts: drivers/hid/wacom_wac.c
| | * HID: lenovo: add support for Lenovo ThinkPad Keyboard Pro unitBenjamin Tissoires2015-05-071-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This dock is used with the Thinkpad Helix 2 but suffers from an error in the report descriptor where an usage max is 65535. Add a report fixup for it and make the keyboard working. Tested-by: Jonathan Oppenheim <lejono@gmail.com> Tested-by: John Reid <owlman.lists@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | * HID: lenovo: set INPUT_PROP_POINTING_STICKAndreas Fleig2015-04-231-0/+19
| |/ | | | | | | | | | | | | | | | | | | Set flags INPUT_PROP_POINTER and INPUT_PROP_POINTING_STICK for the trackpoint integrated in Lenovo USB and Bluetooth keyboards. Libinput checks these flags to enable features such as middle-button-scrolling by default. Signed-off-by: Andreas Fleig <andreasfleig@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* / HID: lenovo: Remove sysfs group on failure pathAlexey Khoroshilov2015-05-291-2/+7
|/ | | | | | | | | There is no sysfs_group_remove() on failure path in lenovo_probe_tpkbd(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Use native middle-button mode for compact keyboardsJamie Lentin2014-12-171-0/+37
| | | | | | | | | | | | | | | | | By default the middle button is in a compatibility mode, and generates standard wheel events when dragging with the middle trackpoint button. Unfortunately this is buggy: * The middle button comes up before starting wheel events, causing a middle click on whatever the mouse cursor was sitting on * The USB keyboard always generates the "native" horizontal wheel event, regardless of mode. Instead, enable the "native" mode the Windows driver uses, and add support for the custom events this generates. This fixes the USB keyboard wheel events, and the middle-click up event comes after the wheel events. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Add sensitivity control to compact keyboardsJamie Lentin2014-12-171-1/+41
| | | | | | | | The trackpoint sensitivity can also be controlled, expose this via sysfs. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Don't set EV_REP to avoid repeating mice buttonsJamie Lentin2014-11-111-1/+0
| | | | | | | | | | | On the USB keyboard, the VENDOR hotkeys share the same device as the mouse. Setting EV_REP also affects mouse buttons, so leave it off. The bluetooth keyboard still has autorepeating mouse buttons, as it only has one device and is set by the KEYBOARD pages. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Move USB KEY_FILE to 0x00f9 to prevent scancode clashJamie Lentin2014-11-111-6/+6
| | | | | | | | | The bluetooth keyboard also generates 0x00fa when the middle button is pressed. Move the made-up report out of the way so we don't trigger KEY_FILE when middle button is pressed Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Add support for Compact (BT|USB) keyboardJamie Lentin2014-07-291-0/+208
| | | | | | | | | Add support for both ThinkPad Compact Bluetooth Keyboard with TrackPoint and ThinkPad Compact USB Keyboard with TrackPoint. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Don't call function in condition, show error codesJamie Lentin2014-07-291-4/+4
| | | | | | Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Prepare support for adding other devicesJamie Lentin2014-07-291-8/+45
| | | | | | | | | | | Ensure all tpkbd specifics are within a postfixed function, the main functions for the driver should just switch to the appropriate function depending on product ID. Given this, we can add extra devices by including extra postfixed functions. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: lenovo: Rename hid-lenovo-tpkbd to hid-lenovoJamie Lentin2014-07-291-0/+463
Rename module and all functions within so we can add support for other keyboards in the same file. Rename the _tp postfix to _tpkbd, to signify functions relevant to the TP USB keyboard. Signed-off-by: Jamie Lentin <jm@lentin.co.uk> Reviewed-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Jiri Kosina <jkosina@suse.cz>