From 8d780a4b9f73e2ce9f9a28a5ab8f2ba43d4068d6 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Fri, 13 Mar 2015 09:47:10 -0400 Subject: [PATCH] Add patch to support clickpads (rhbz 1201532) --- HID-multitouch-add-support-of-clickpads.patch | 50 +++++++++++++++++++ kernel.spec | 9 ++++ 2 files changed, 59 insertions(+) create mode 100644 HID-multitouch-add-support-of-clickpads.patch diff --git a/HID-multitouch-add-support-of-clickpads.patch b/HID-multitouch-add-support-of-clickpads.patch new file mode 100644 index 000000000..97765c490 --- /dev/null +++ b/HID-multitouch-add-support-of-clickpads.patch @@ -0,0 +1,50 @@ +From: Benjamin Tissoires +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 +Tested-by: Jason Ekstrand +--- + 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 51e25b9407f2..a8e738191625 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -115,6 +115,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 */ +@@ -372,6 +373,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]; + +@@ -721,6 +726,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 + diff --git a/kernel.spec b/kernel.spec index 558c4bf69..6ba9c862d 100644 --- a/kernel.spec +++ b/kernel.spec @@ -790,6 +790,9 @@ Patch26166: drm-radeon-dp-Set-EDP_CONFIGURATION_SET-for-bridge-c.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 + # END OF PATCH DEFINITIONS %endif @@ -1543,6 +1546,9 @@ ApplyPatch drm-radeon-dp-Set-EDP_CONFIGURATION_SET-for-bridge-c.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. @@ -2361,6 +2367,9 @@ fi # ||----w | # || || %changelog +* Fri Mar 13 2015 Josh Boyer +- Add patch to support clickpads (rhbz 1201532) + * Thu Mar 12 2015 Josh Boyer - CVE-2014-8159 infiniband: uverbs: unprotected physical memory access (rhbz 1181166 1200950)