aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-11-19HID: multitouch: Add pointstick support for Cirque TouchpadKai-Heng Feng1-0/+6
Cirque Touchpad/Pointstick combo is similar to Alps devices, it requires MT_CLS_WIN_8_DUAL to expose its pointstick as a mouse. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-09-04HID: multitouch: simplify the application retrievalBenjamin Tissoires1-40/+32
Now that the application is simply stored in struct hid_input, we can overwrite it in mt_input_mapping() for the faulty egalax and have a simpler suffix processing in mt_input_configured() Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-09-04HID: core: fix grouping by applicationBenjamin Tissoires1-0/+3
commit f07b3c1da92d ("HID: generic: create one input report per application type") was effectively the same as MULTI_INPUT: hidinput->report was never set, so hidinput_match_application() always returned null. Fix that by testing against the real application. Note that this breaks some old eGalax touchscreens that expect MULTI_INPUT instead of HID_QUIRK_INPUT_PER_APP. Enable this quirk for backward compatibility on all non-Win8 touchscreens. link: https://bugzilla.kernel.org/show_bug.cgi?id=200847 link: https://bugzilla.kernel.org/show_bug.cgi?id=200849 link: https://bugs.archlinux.org/task/59699 link: https://github.com/NixOS/nixpkgs/issues/45165 Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-09-04HID: multitouch: fix Elan panels with 2 input modes declarationBenjamin Tissoires1-2/+14
When implementing commit 7f81c8db5489 ("HID: multitouch: simplify the settings of the various features"), I wrongly removed a test that made sure we never try to set the second InputMode feature to something else than 0. This broke badly some recent Elan panels that now forget to send the click button in some area of the touchpad. Link: https://bugzilla.kernel.org/show_bug.cgi?id=200899 Fixes: 7f81c8db5489 ("HID: multitouch: simplify the settings of the various features") Cc: stable@vger.kernel.org # v4.18+ Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: handle palm for touchscreensDmitry Torokhov1-1/+51
Usually, there is no palm rejection for touchscreens. You don't rest your palm on the touchscreen while interacting with it. However, some wacom devices do so because you can rest your palm while interacting with the stylus. Unfortunately, the spec for touchscreens[1] is less precise than the one for touchpads[2]. This leads to a situation where it's 'legitimate' for a touchscreen to provide both tipswitch off and confidence off in the same report. Work around that by keeping the slot active for one frame where we report MT_TOOL_PALM, and then synthesizing the release event in a separate frame. frame Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [rebased and new commit message] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: touchscreens also use confidence reportsDmitry Torokhov1-1/+2
According to [1] the confidence is used not only by touchpad devices, but also by touchscreens. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchscreen-required-hid-top-level-collections Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [rebased] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: report MT_TOOL_PALM for non-confident touchesDmitry Torokhov1-5/+14
According to Microsoft specification [1] for Precision Touchpads (and Touchscreens) the devices use "confidence" reports to signal accidental touches, or contacts that are "too large to be a finger". Instead of simply marking contact inactive in this case (which causes issues if contact was originally proper and we lost confidence in it later, as this results in accidental clicks, drags, etc), let's report such contacts as MT_TOOL_PALM and let userspace decide what to do. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> [splitted and rebased] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: input: enable Totem on the Dell Canvas 27Benjamin Tissoires1-14/+34
The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height. The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time (the FW only supports one). We can tell that MT_TOOL_DIAL will be reported by setting the min/max of ABS_MT_TOOL_TYPE to MT_TOOL_DIAL. This tool is aimed at being used by the system and not the applications, so the user space processing should not go through the regular touch inputs. We set INPUT_PROP_DIRECT which applies ID_INPUT_TOUCHSCREEN to this new type of devices, but we will counter this for the time being with the special udev hwdb entry mentioned above. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1511846 Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: remove one copy of valuesBenjamin Tissoires1-281/+264
The current way of handling multitouch data is not very straightforward: - in mt_event() we do nothing - in mt_report() we: - do some gym to fetch the scantime and the contact count - then iterate over the input fields where we copy the data to a temporary place - when we see the last field in a slot, we then use this data to emit the input data A more streamlined way is to first get all of the address in the report of all fields, and then just pick the fields we are interested in in mt_report() Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: ditch mt_report_idBenjamin Tissoires1-32/+94
Now that the driver can handle more than one multitouch collection in a single HID device, ditch the last bit that contains us to use only one mt collection. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: store a per application quirks valueBenjamin Tissoires1-32/+32
If a device has more than one multitouch collection, there is a chance we need per tool quirks. This is the case for the Totem on the Dell Canvas. Note that thesysfs attribute quirks can now get out of sync, but there should not be much users of it as it's debugging only. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: Store per collection multitouch dataBenjamin Tissoires1-150/+230
Currently, hid-multitouch can only handle one multitouch collection at a time. This is an issue for the Dell Canvas, as the Totem (a dial tool) is also using a multitouch-like collection. Factor out the multitouch collection data in their own struct. Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-07-17HID: multitouch: make sure the static list of class is not changedBenjamin Tissoires1-2/+2
const is a magic keyword here :) Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-05-30HID: multitouch: fix calculation of last slot field in multi-touch reportsBen Chan1-1/+4
According to [1] and also seemingly agreed by [2], the Scan Time usage (0x0D 0x56) is a report level usage, not a contact level usage. However, the hid-multitouch driver currently includes HID_DG_SCANTIME when calculating `td->last_slot_field', which may lead to mt_complete_slot() being prematurely called in certain cases (e.g. when each touch input report includes more than one contact and the Scan Time usage appears before any contact logical collection). This patch fixes the issue by skipping mt_store_field() on HID_DG_SCANTIME, similar to how HID_DG_CONTACTCOUNT and HID_DG_CONTACTMAX are handled. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections#windows-precision-touchpad-input-reports [2] https://patchwork.kernel.org/patch/1742181/ Fixes: 29cc309d8bf19 ("HID: hid-multitouch: forward MSC_TIMESTAMP") Signed-off-by: Ben Chan <benchan@chromium.org> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-05-16HID: multitouch: fix types returned from mt_need_to_apply_feature()Jiri Kosina1-3/+3
Some exit paths from mt_need_to_apply_feature() returned int instead of bool; fix that up. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: multitouch: implement precision touchpad latency and switchesBenjamin Tissoires1-5/+29
The Win 8.1 precision touchpad spec introduce new modes for touchpads that can come in handy[1]. Implement the settings of these modes, so we are not taken off-guard if a firmware decides to enforce them. [1] https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-precision-touchpad-required-hid-top-level-collections Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: multitouch: simplify the settings of the various featuresBenjamin Tissoires1-71/+60
The Win8 spec also declare other features we want to support: latency and surface and button switches. Though it doesn't seem we need to activate those by default, we have been proved in the past that manufacturers rely on the Windows driver behavior so we better mimic it to prevent further issues. The current way of setting the features is cumbersome. It avoids iterating over the list of features, but the way we store/retrieve the data just doesn't scale with more than two values. So iterate over the features when we decide to switch on the device and make it simpler to extend. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: multitouch: make use of HID_QUIRK_INPUT_PER_APPBenjamin Tissoires1-39/+33
We now have HID_QUIRK_INPUT_PER_APPLICATION that splits the devices into several devices. This helps us as we can now rely on hid-input to set the names for us. Also, this helps removing some magical numbers '0' when calling .input_configured(). The only thing to take care of is that the field .report in struct hid_input is now null. We need to iterate over the full list of reports attached to a hid_input. This is required for some Advanced Silicon touchscreen to correctly apply the HID_QUIRK_INPUT_PER_APPLICATION as they have 2 reports associated with the hidinput node. One contains the Input data, the other one contains the Output data. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-05Merge branch 'for-4.17/upstream' into for-linusJiri Kosina1-1/+1
Pull a few small generic code cleanups.
2018-04-05Merge branch 'for-4.17/multitouch' into for-linusJiri Kosina1-37/+24
Pull Razer Blade Stealth support improvement and a few generic cleanups
2018-03-23HID: core: reset the quirks before calling probe againBenjamin Tissoires1-7/+0
Given that now the quirk handling is done in hid-quirk.c, we can actually reset the quirks before calling .probe(), so that the drivers do not need to keep track of initial quirks. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23HID: multitouch: do not set HID_QUIRK_NO_INIT_REPORTSBenjamin Tissoires1-17/+1
It is set by default now, so there is no point setting it in the driver Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUTBenjamin Tissoires1-1/+0
There is no real point of registering an empty input node. This should be default, but given some drivers need the blank input node to set it up during input_configured, we need to postpone the check for hidinput_has_been_populated(). Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23HID: multitouch: remove dead zones of Razer Blade StealthBenjamin Tissoires1-0/+13
The Razer Blade Stealth detects palms too aggressively and this creates a dead zone around the touchpad. Users like being able to use their entire touchpad, so we should probably not filter out the "palm" events from the device and report them as regular touches, leaving the palm detection up to the upper stack Link: https://bugs.freedesktop.org/show_bug.cgi?id=105409 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23HID: multitouch: export a quirk for the button handling of touchpadsBenjamin Tissoires1-12/+10
Instead of using the class name, we better have a specific quirk for it so other classes can make use of it. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06HID: hid-multitouch: Use true and false for boolean valuesGustavo A. R. Silva1-1/+1
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16HID: Fix hid_report_len usageAaron Ma1-2/+3
Follow the change of return type u32 of hid_report_len, fix all the types of variables those get the return value of hid_report_len to u32, and all other code already uses u32. Cc: stable@vger.kernel.org Signed-off-by: Aaron Ma <aaron.ma@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-12-01HID: hid-multitouch: support fine-grain orientation reportingWei-Ning Huang1-4/+48
The current hid-multitouch driver only allow the report of two orientations, vertical and horizontal. We use the Azimuth orientation usage 0x3F under the Digitizer usage page to report orientation if the device supports it. Changelog: v1 -> v2: - Fix commit message. - Remove resolution reporting for ABS_MT_ORIENTATION. v2 -> v3: - Fix commit message. v3 -> v4: - Fix ABS_MT_ORIENTATION ABS param range. - Don't set ABS_MT_ORIENTATION in ABS_DG_HEIGHT when it is already set by ABS_DG_AZIMUTH. v4 -> v5: - Improve multi-touch-protocol.rst documentation. Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> Signed-off-by: Wei-Ning Huang <wnhuang@google.com> Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-by: Henrik Rydberg <rydberg@bitmath.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-22HID: multitouch: Combine all left-button events in a frameHans de Goede1-0/+20
According to the Win8 Precision Touchpad spec, inside the HID_UP_BUTTON usage-page usage 1 is for a clickpad getting clicked, 2 for an external left button and 3 for an external right button. Since Linux uses BTN_LEFT for a clickpad being clicked we end up mapping both usage 1 and 2 to BTN_LEFT and if a single report contains both then we ended up always reporting the value of both in a single SYN, e.g. : BTN_LEFT 1, BTN_LEFT 0, SYN. This happens for example with Hantick HTT5288 i2c mt touchpads. This commit fixes this by not immediately reporting left button when we parse the report, but instead storing or-ing together the values and reporting the result from mt_sync_frame() when we've a complete frame. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-22HID: multitouch: Only look at non touch fields in first packet of a frameHans de Goede1-2/+15
Devices in "single finger hybrid mode" will send one report per finger, on some devices only the first report of such a multi-packet frame will contain a value for BTN_LEFT, in subsequent reports (if multiple fingers are down) the value is always 0, causing hid-mt to report BTN_LEFT going 1 - 0 - 1 - 0 when pressing a clickpad and putting down a second finger. This happens for example on USB 0603:0002 mt touchpads. This commit fixes this by only reporting non touch fields for the first packet of a (possibly) multi-packet frame. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-22HID: multitouch: Properly deal with Win8 PTP reports with 0 touchesHans de Goede1-2/+30
The Windows Precision Touchpad spec "Figure 4 Button Only Down and Up" and "Table 9 Report Sequence for Button Only Down and Up" indicate that the first packet of a (possibly hybrid mode multi-packet) frame may contain a contact-count of 0 if only a button is pressed and no fingers are detected. This means that a value of 0 for contact-count is a valid value and should be used as expected contact count when it is the first packet (num_received == 0), as extra check to make sure that this is the first packet of a buttons only frame, we also check that the timestamp is different. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-22HID: multitouch: Fix alphabetic sorting of mt_devices table.Hans de Goede1-8/+8
Fix alphabetic sorting of mt_devices hid_device_id table. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-15Merge branch 'for-4.15/use-timer-setup' into for-linusJiri Kosina1-4/+6
- usbhid: conversion to timer_setup() and from_timer() from Kees Cook Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-11-15Merge branch 'for-4.15/multitouch' into for-linusJiri Kosina1-0/+42
- make sure that we forward MSC_TIMESTAMP in accordance to the specification, from Nicolas Boichat Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-11HID: usbhid: Convert timers to use timer_setup()Kees Cook1-4/+6
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() (introduced by 686fef928bba ("timer: Prepare to change timer callback argument type")) to pass the timer pointer explicitly. Adds pointer back to hid_device for multitouch. [jkosina@suse.cz: extend changelog a little bit as asked for by Benjamin] Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-05HID: hid-multitouch: forward MSC_TIMESTAMPNicolas Boichat1-0/+42
Computes and forwards the device timestamp according to the specification. Many devices use a 16-bit timestamp field, with a resolution of 100us, therefore rolling around very frequently (every 6.5 seconds). To make sure there is no ambiguity, the timestamp reported to the input stack reset to 0 whenever the time between 2 received events is greater than MAX_TIMESTAMP_INTERVAL (1 second). Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-02Revert "HID: multitouch: Support ALPS PTP stick with pid 0x120A"Kai-Heng Feng1-4/+0
This reverts commit fcaa4a07d2a4b541e91da7a55d8b3331f96d1865. As noted by Masaki [1], 0x120A + trackpoint will not be used in mass production machines, so remove the ID accordingly. [1] http://www.spinics.net/lists/linux-input/msg53222.html Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-09-06HID: multitouch: Support ALPS PTP stick with pid 0x120AShrirang Bagul1-0/+4
This patch adds ALPS PTP sticks with pid/device id 0x120A to the list of devices supported by hid-multitouch. Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-09-06HID: multitouch: support buttons and trackpoint on Lenovo X1 Tab Gen2Pavel Tatashin1-0/+6
On the 2nd generation Lenovo Tablet only clickpad is working; the trackpoint and three mouse buttons do not work. hid_multitouch must export all inputs in order to get trackpoint and buttons to function. Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-09-06HID: multitouch: Fix system-control buttons not workingHans de Goede1-0/+1
Some laptops have system-control buttons (e.g. KEY_SLEEP) on the same interface as a hid-multitouch touch-pad. This commit fixes these buttons not working. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-09-05Merge branch 'for-4.14/multitouch' into for-linusJiri Kosina1-1/+47
- support for media keys on Asus T304UA from João Paulo Rechi Vita - support for Microsoft Win8 Wireless Radio Controls extensions from João Paulo Rechi Vita Conflicts: drivers/hid/hid-ids.h Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-08-03HID: multitouch: constify attribute_group structures.Arvind Yadav1-1/+1
attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-08-03HID: multitouch: use proper symbolic constant for 0xff310076 applicationJiri Kosina1-1/+1
0xff310076 application has been defined by 957b8dffa4e3d1 ("HID: multitouch: Support Asus T304UA media keys") as a vendor-specific application with symbolic constant HID_VD_ASUS_CUSTOM_MEDIA_KEYS, so let's make use of it. Fixes: 957b8dffa4e ("HID: multitouch: Support Asus T304UA media keys") Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-08-03HID: multitouch: Support Asus T304UA media keysJoão Paulo Rechi Vita1-1/+43
The Asus T304UA convertible sports a magnetic detachable keyboard with touchpad, which is connected over USB. Most of the keyboard hotkeys are exposed through the same USB interface as the touchpad, defined in the report descriptor as follows: 0x06, 0x31, 0xFF, // Usage Page (Vendor Defined 0xFF31) 0x09, 0x76, // Usage (0x76) 0xA1, 0x01, // Collection (Application) 0x05, 0xFF, // Usage Page (Reserved 0xFF) 0x85, 0x5A, // Report ID (90) 0x19, 0x00, // Usage Minimum (0x00) 0x2A, 0xFF, 0x00, // Usage Maximum (0xFF) 0x15, 0x00, // Logical Minimum (0) 0x26, 0xFF, 0x00, // Logical Maximum (255) 0x75, 0x08, // Report Size (8) 0x95, 0x0F, // Report Count (15) 0xB1, 0x02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) 0x05, 0xFF, // Usage Page (Reserved 0xFF) 0x85, 0x5A, // Report ID (90) 0x19, 0x00, // Usage Minimum (0x00) 0x2A, 0xFF, 0x00, // Usage Maximum (0xFF) 0x15, 0x00, // Logical Minimum (0) 0x26, 0xFF, 0x00, // Logical Maximum (255) 0x75, 0x08, // Report Size (8) 0x95, 0x02, // Report Count (2) 0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) 0xC0, // End Collection This UsagePage is declared as a variable, but we need to treat it as an array to be able to map each Usage we care about to its corresponding input key. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-08-03HID: multitouch: Support HID_GD_WIRELESS_RADIO_CTLSJoão Paulo Rechi Vita1-1/+5
Some keyboard + touchpad devices have the Microsoft Win8 Wireless Radio Controls extensions Usage Page define in the touchpad report descriptor, so we need to support them in this driver. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-13HID: multitouch: do not blindly set EV_KEY or EV_ABS bitsDmitry Torokhov1-12/+4
Now that input core insists on having dev->absinfo when device claims to generate EV_ABS in its dev->evbit, we should not be blindly setting that bit. The code in question might have been needed before input_set_abs_params() started setting EV_ABS in device's evbit, but not anymore, and is now breaking devices such as SMART SPNL-6075 Touchscreen. Fixes: 6ecfe51b4082 ("Input: refuse to register absolute devices ...") Reported-by: Matthias Fend <Matthias.Fend@wolfvision.net> Tested-by: Matthias Fend <Matthias.Fend@wolfvision.net> Cc: stable@vger.kernel.org Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-23HID: multitouch: optimize the sticky fingers timerBenjamin Tissoires1-3/+18
Instead of unconditionally expiring the timer and calling a long mt_release_contacts(), we can check if some slots are used when the timer expires. We can also remove the timer if we happen to receive all the releases. The logic behind the MT_IO_FLAGS_PENDING_SLOTS could be implemented by counting how many slots are active, but using bits feels slightly more efficient. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Arek Burdach <arek.burdach@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-23HID: multitouch: fix rare Win 8 cases when the touch up event gets missingBenjamin Tissoires1-23/+79
Instead of blindly trusting the hardware to send us release, we should consider some events can get lost and release them when we judge time has come. The Windows 8 spec allows to be confident in the fact that the device will continuously report events when a finger touches the surface. This has been tested on the HID recording database I have, and all of those devices behave properly. Also, Arek tested it on his Lenovo Yoga 910, which exports such bug in some situations, when the movements are rather slow. We use an atomic bit here to guard against concurrent accesses to the mt slots because both mt_process_mt_event() and mt_expired_timeout() are called in interrupt context. Signed-off-by: Arek Burdach <arek.burdach@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Arek Burdach <arek.burdach@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-23HID: multitouch: use BIT macroBenjamin Tissoires1-16/+16
(1 << X) is wrong. We should use BIT(X) Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Tested-by: Arek Burdach <arek.burdach@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-21HID: multitouch: Add support for Google Rose TouchpadWei-Ning Huang1-0/+12
Add Google Rose Touchpad USB PID and required quirks. Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>