aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-multitouch.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-22HID: multitouch: add support for the Smart Tech panelBenjamin Tissoires1-6/+28
This panel is not very friendly to us: it exposes multiple multitouch collections, some of them being of logical application stylus. Usually, a device has only one report per application, and that is what I assumed in commit 8dfe14b3b47f ("HID: multitouch: ditch mt_report_id") To avoid breaking all working device, add a new class and a new quirk for that situation. Reported-and-tested-by: Matthias Fend <Matthias.Fend@wolfvision.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-08-22HID: multitouch: do not filter mice nodesBenjamin Tissoires1-1/+2
It was a good idea at the time to not create a mouse node for the multitouch touchscreens, but: - touchscreens following the Win 8 protocol should not have this disturbing mouse node anymore, or if they have, it should be used for something else (like a joystick attached to the screen) - touchpads have it, and they should not use it unless there is a bug, but when the laptop has a trackstick, the data are reported through this mouse node. So instead of whitelisting all of the devices that have a need for the mouse node, just export it. hid-input.c will append a suffix to it ('Mouse'), so users will eventually see if something goes wrong. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-06-28Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hidLinus Torvalds1-0/+4
Pull HID fixes from Jiri Kosina: - fix for one corner case in HID++ protocol with respect to handling very long reports, from Hans de Goede - power management fix in Intel-ISH driver, from Hyungwoo Yang - use-after-free fix in Intel-ISH driver, from Dan Carpenter - a couple of new device IDs/quirks from Kai-Heng Feng, Kyle Godbey and Oleksandr Natalenko * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: intel-ish-hid: fix wrong driver_data usage HID: multitouch: Add pointstick support for ALPS Touchpad HID: logitech-dj: Fix forwarding of very long HID++ reports HID: uclogic: Add support for Huion HS64 tablet HID: chicony: add another quirk for PixArt mouse HID: intel-ish-hid: Fix a use after free in load_fw_from_host()
2019-06-26HID: multitouch: Add pointstick support for ALPS TouchpadKai-Heng Feng1-0/+4
There's a new ALPS touchpad/pointstick combo device that requires MT_CLS_WIN_8_DUAL to make its pointsitck work as a mouse. The device can be found on HP ZBook 17 G5. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-06-13Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hidLinus Torvalds1-0/+7
Pull HID fixes from Jiri Kosina: - regression fixes (reverts) for module loading changes that turned out to be incompatible with some userspace, from Benjamin Tissoires - regression fix for special Logitech unifiying receiver 0xc52f, from Hans de Goede - a few device ID additions to logitech driver, from Hans de Goede - fix for Bluetooth support on 2nd-gen Wacom Intuos Pro, from Jason Gerecke * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: logitech-dj: Fix 064d:c52f receiver support Revert "HID: core: Call request_module before doing device_add" Revert "HID: core: Do not call request_module() in async context" Revert "HID: Increase maximum report size allowed by hid_field_extract()" HID: a4tech: fix horizontal scrolling HID: hyperv: Add a module description line HID: logitech-hidpp: Add support for the S510 remote control HID: multitouch: handle faulty Elo touch device HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact HID: wacom: Don't report anything prior to the tool entering range HID: wacom: Don't set tool type until we're in range HID: rmi: Use SET_REPORT request on control endpoint for Acer Switch 3 and 5 HID: logitech-hidpp: add support for the MX5500 keyboard HID: logitech-dj: add support for the Logitech MX5500's Bluetooth Mini-Receiver HID: i2c-hid: add iBall Aer3 to descriptor override
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22HID: multitouch: handle faulty Elo touch deviceBenjamin Tissoires1-0/+7
Since kernel v5.0, one single win8 touchscreen device failed. And it turns out this is because it reports 2 InRange usage per touch. It's a first, and I *really* wonder how this was allowed by Microsoft in the first place. But IIRC, Breno told me this happened *after* a firmware upgrade... Anyway, better be safe for those crappy devices, and make sure we have a full slot before jumping to the next. This won't prevent all crappy devices to fail here, but at least we will have a safeguard as long as the contact ID and the X and Y coordinates are placed in the report after the grabage. Fixes: 01eaac7e5713 ("HID: multitouch: remove one copy of values") CC: stable@vger.kernel.org # v5.0+ Reported-and-tested-by: Breno Leitao <leitao@debian.org> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-14HID: multitouch: Lenovo X1 Tablet Gen3 trackpoint and buttonsMikael Wikström1-0/+6
Add support for the trackpoint and three mouse buttons on the type cover of the Lenovo X1 Tablet Gen3. This is the same as with the 2nd generation Lenovo X1 Tablet. Signed-off-by: Mikael Wikström <leakim.wikstrom@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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>