diff options
author | Josh Boyer <jwboyer@fedoraproject.org> | 2015-08-04 14:28:47 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@fedoraproject.org> | 2015-08-04 14:28:47 -0400 |
commit | 172dafa8ae50977cca180ae00eb23415fffbce7e (patch) | |
tree | 8c80a173ab35f04482584c9c99655f3d76117634 | |
parent | bc0254236badfc31d1ac64640c4742e8297968a3 (diff) | |
download | kernel-172dafa8ae50977cca180ae00eb23415fffbce7e.tar.gz kernel-172dafa8ae50977cca180ae00eb23415fffbce7e.tar.xz kernel-172dafa8ae50977cca180ae00eb23415fffbce7e.zip |
Patch from Nicholas Kudriavtsev for Acer Switch 12 Fn keys (rhbz 1244511)
-rw-r--r-- | HID-chicony-Add-support-for-Acer-Aspire-Switch-12.patch | 103 | ||||
-rw-r--r-- | kernel.spec | 6 |
2 files changed, 109 insertions, 0 deletions
diff --git a/HID-chicony-Add-support-for-Acer-Aspire-Switch-12.patch b/HID-chicony-Add-support-for-Acer-Aspire-Switch-12.patch new file mode 100644 index 000000000..2baf72e4c --- /dev/null +++ b/HID-chicony-Add-support-for-Acer-Aspire-Switch-12.patch @@ -0,0 +1,103 @@ +From 98f07385212073536f303c07ece455acdd4d267f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=9A=D1=83?= + =?UTF-8?q?=D0=B4=D1=80=D1=8F=D0=B2=D1=86=D0=B5=D0=B2?= + <nkudriavtsev@gmail.com> +Date: Tue, 21 Jul 2015 13:31:52 +0300 +Subject: [PATCH] HID: chicony: Add support for Acer Aspire Switch 12 + +Acer Aspire Switch 12 keyboard Chicony's controller reports too big usage +index on the 1st interface. The patch fixes the report. The work based on +solution from drivers/hid/hid-holtek-mouse.c + +Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=101721 + +Signed-off-by: Nicholas Kudriavtsev <nkudriavtsev@gmail.com> +Signed-off-by: Jiri Kosina <jkosina@suse.com> +--- + drivers/hid/hid-chicony.c | 26 ++++++++++++++++++++++++++ + drivers/hid/hid-core.c | 1 + + drivers/hid/hid-ids.h | 1 + + 3 files changed, 28 insertions(+) + +diff --git a/drivers/hid/hid-chicony.c b/drivers/hid/hid-chicony.c +index b613d5a79684..bc3cec199fee 100644 +--- a/drivers/hid/hid-chicony.c ++++ b/drivers/hid/hid-chicony.c +@@ -20,6 +20,7 @@ + #include <linux/input.h> + #include <linux/hid.h> + #include <linux/module.h> ++#include <linux/usb.h> + + #include "hid-ids.h" + +@@ -57,10 +58,34 @@ static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi, + return 1; + } + ++static __u8 *ch_switch12_report_fixup(struct hid_device *hdev, __u8 *rdesc, ++ unsigned int *rsize) ++{ ++ struct usb_interface *intf = to_usb_interface(hdev->dev.parent); ++ ++ if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { ++ /* Change usage maximum and logical maximum from 0x7fff to ++ * 0x2fff, so they don't exceed HID_MAX_USAGES */ ++ switch (hdev->product) { ++ case USB_DEVICE_ID_CHICONY_ACER_SWITCH12: ++ if (*rsize >= 128 && rdesc[64] == 0xff && rdesc[65] == 0x7f ++ && rdesc[69] == 0xff && rdesc[70] == 0x7f) { ++ hid_info(hdev, "Fixing up report descriptor\n"); ++ rdesc[65] = rdesc[70] = 0x2f; ++ } ++ break; ++ } ++ ++ } ++ return rdesc; ++} ++ ++ + static const struct hid_device_id ch_devices[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) }, + { } + }; + MODULE_DEVICE_TABLE(hid, ch_devices); +@@ -68,6 +93,7 @@ MODULE_DEVICE_TABLE(hid, ch_devices); + static struct hid_driver ch_driver = { + .name = "chicony", + .id_table = ch_devices, ++ .report_fixup = ch_switch12_report_fixup, + .input_mapping = ch_input_mapping, + }; + module_hid_driver(ch_driver); +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index e6fce23b121a..f90ca6574221 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1807,6 +1807,7 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_CP2112) }, + { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) }, +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index b3b225b75d0a..79210ca8eff1 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -233,6 +233,7 @@ + #define USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE 0x1053 + #define USB_DEVICE_ID_CHICONY_WIRELESS2 0x1123 + #define USB_DEVICE_ID_CHICONY_AK1D 0x1125 ++#define USB_DEVICE_ID_CHICONY_ACER_SWITCH12 0x1421 + + #define USB_VENDOR_ID_CHUNGHWAT 0x2247 + #define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001 +-- +2.4.3 + diff --git a/kernel.spec b/kernel.spec index 7a3ec2eb2..aa2249d20 100644 --- a/kernel.spec +++ b/kernel.spec @@ -587,6 +587,9 @@ Patch505: 0001-dm-fix-dm_merge_bvec-regression-on-32-bit-systems.patch # CVE-2015-5697 (rhbz 1249011 1249013) Patch506: md-use-kzalloc-when-bitmap-is-disabled.patch +#rhbz 1244511 +Patch507: HID-chicony-Add-support-for-Acer-Aspire-Switch-12.patch + Patch904: kdbus.patch # END OF PATCH DEFINITIONS @@ -2024,6 +2027,9 @@ fi # # %changelog +* Tue Aug 04 2015 Josh Boyer <jwboyer@fedoraproject.org> +- Patch from Nicholas Kudriavtsev for Acer Switch 12 Fn keys (rhbz 1244511) + * Tue Aug 04 2015 Josh Boyer <jwboyer@fedoraproject.org> - 4.2.0-0.rc5.git1.1 - Linux v4.2-rc5-19-gc2f3ba745d1c |