Add patch to support clickpads (rhbz 1201532)

This commit is contained in:
Josh Boyer 2015-03-13 09:47:10 -04:00
parent bbf3f54706
commit 62a6befde2
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,50 @@
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date: Fri, 6 Mar 2015 11:14:42 -0500
Subject: [PATCH] HID: multitouch: add support of clickpads
Touchpads that have only one button are called clickpads and should
be advertised as such by the kernel.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Jason Ekstrand <jason@jlekstrand.net>
---
drivers/hid/hid-multitouch.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index f65e78b46999..ef06dc30b9b1 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -116,6 +116,7 @@ struct mt_device {
__u8 touches_by_report; /* how many touches are present in one report:
* 1 means we should use a serial protocol
* > 1 means hybrid (multitouch) protocol */
+ __u8 buttons_count; /* number of physical buttons per touchpad */
bool serial_maybe; /* need to check for serial protocol */
bool curvalid; /* is the current contact valid? */
unsigned mt_flags; /* flags to pass to input-mt */
@@ -379,6 +380,10 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
td->inputmode_value = MT_INPUTMODE_TOUCHPAD;
}
+ /* count the buttons on touchpads */
+ if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON)
+ td->buttons_count++;
+
if (usage->usage_index)
prev_usage = &field->usage[usage->usage_index - 1];
@@ -728,6 +733,10 @@ static void mt_touch_input_configured(struct hid_device *hdev,
if (cls->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP)
td->mt_flags |= INPUT_MT_DROP_UNUSED;
+ /* check for clickpads */
+ if ((td->mt_flags & INPUT_MT_POINTER) && (td->buttons_count == 1))
+ __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+
input_mt_init_slots(input, td->maxcontacts, td->mt_flags);
td->mt_flags = 0;
--
2.1.0

View File

@ -655,6 +655,9 @@ Patch26165: xen-pciback-limit-guest-control-of-command-register.patch
#CVE-2014-8159 rhbz 1181166 1200950
Patch26167: IB-core-Prevent-integer-overflow-in-ib_umem_get-addr.patch
#rhbz 1201532
Patch26168: HID-multitouch-add-support-of-clickpads.patch
# git clone ssh://git.fedorahosted.org/git/kernel-arm64.git, git diff master...devel
Patch30000: kernel-arm64.patch
@ -1414,6 +1417,9 @@ ApplyPatch xen-pciback-limit-guest-control-of-command-register.patch
#CVE-2014-8159 rhbz 1181166 1200950
ApplyPatch IB-core-Prevent-integer-overflow-in-ib_umem_get-addr.patch
#rhbz 1201532
ApplyPatch HID-multitouch-add-support-of-clickpads.patch
%if 0%{?aarch64patches}
ApplyPatch kernel-arm64.patch
%ifnarch aarch64 # this is stupid, but i want to notice before secondary koji does.
@ -2273,6 +2279,7 @@ fi
%changelog
* Fri Mar 13 2015 Josh Boyer <jwboyer@fedoraproject.org> - 4.0.0-0.rc3.git2.1
- Linux v4.0-rc3-148-gc202baf017ae
- Add patch to support clickpads (rhbz 1201532)
* Thu Mar 12 2015 Josh Boyer <jwboyer@fedoraproject.org>
- CVE-2014-8159 infiniband: uverbs: unprotected physical memory access (rhbz 1181166 1200950)