aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2013-08-22 08:51:09 -0400
committerJiri Kosina <jkosina@suse.cz>2013-08-27 04:00:00 -0400
commit595e9276ce68791317484ec7f0f9f2e0457c3b34 (patch)
tree58d40392b363a334656995f127b42daf20a377f4
parentf961bd3516e4f699bbacff5d7f5247d6d87c59f0 (diff)
HID: do not init input reports for Win 8 multitouch devices
Some multitouch screens do not like to be polled for input reports. However, the Win8 spec says that all touches should be sent during each report, making the initialization of reports unnecessary. The Win7 spec is less precise, so do not use this for those devices. Add the quirk HID_QUIRK_NO_INIT_INPUT_REPORTS so that we do not have to introduce a quirk for each problematic device. This quirk makes the driver behave the same way the Win 8 does. It actually retrieves the features, but not the inputs. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Tested-by: Srinivas Pandruvada<srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-multitouch.c12
-rw-r--r--drivers/hid/usbhid/hid-core.c11
-rw-r--r--include/linux/hid.h1
3 files changed, 21 insertions, 3 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index c28ef86c7c67..ac28f08c3866 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -951,6 +951,18 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
951 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 951 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
952 hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; 952 hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
953 953
954 /*
955 * Handle special quirks for Windows 8 certified devices.
956 */
957 if (id->group == HID_GROUP_MULTITOUCH_WIN_8)
958 /*
959 * Some multitouch screens do not like to be polled for input
960 * reports. Fortunately, the Win8 spec says that all touches
961 * should be sent during each report, making the initialization
962 * of input reports unnecessary.
963 */
964 hdev->quirks |= HID_QUIRK_NO_INIT_INPUT_REPORTS;
965
954 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); 966 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
955 if (!td) { 967 if (!td) {
956 dev_err(&hdev->dev, "cannot allocate multitouch data\n"); 968 dev_err(&hdev->dev, "cannot allocate multitouch data\n");
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 99418285222c..55ea9c40140e 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -807,12 +807,17 @@ void usbhid_init_reports(struct hid_device *hid)
807{ 807{
808 struct hid_report *report; 808 struct hid_report *report;
809 struct usbhid_device *usbhid = hid->driver_data; 809 struct usbhid_device *usbhid = hid->driver_data;
810 struct hid_report_enum *report_enum;
810 int err, ret; 811 int err, ret;
811 812
812 list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list) 813 if (!(hid->quirks & HID_QUIRK_NO_INIT_INPUT_REPORTS)) {
813 usbhid_submit_report(hid, report, USB_DIR_IN); 814 report_enum = &hid->report_enum[HID_INPUT_REPORT];
815 list_for_each_entry(report, &report_enum->report_list, list)
816 usbhid_submit_report(hid, report, USB_DIR_IN);
817 }
814 818
815 list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list) 819 report_enum = &hid->report_enum[HID_FEATURE_REPORT];
820 list_for_each_entry(report, &report_enum->report_list, list)
816 usbhid_submit_report(hid, report, USB_DIR_IN); 821 usbhid_submit_report(hid, report, USB_DIR_IN);
817 822
818 err = 0; 823 err = 0;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index cef1e9b86cc4..bc132d2a20aa 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -283,6 +283,7 @@ struct hid_item {
283#define HID_QUIRK_MULTI_INPUT 0x00000040 283#define HID_QUIRK_MULTI_INPUT 0x00000040
284#define HID_QUIRK_HIDINPUT_FORCE 0x00000080 284#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
285#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 285#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100
286#define HID_QUIRK_NO_INIT_INPUT_REPORTS 0x00000200
286#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 287#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
287#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 288#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
288#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 289#define HID_QUIRK_NO_INIT_REPORTS 0x20000000