[kernel/f20] Add patches to fix elantech touchscreens (rhbz 1149509)

Josh Boyer jwboyer at fedoraproject.org
Sat Oct 11 13:56:41 UTC 2014


commit 1bd9528fb32e4de02a142869247f60a1cdc5d6c5
Author: Josh Boyer <jwboyer at fedoraproject.org>
Date:   Sat Oct 11 08:28:21 2014 -0400

    Add patches to fix elantech touchscreens (rhbz 1149509)

 HID-rmi-check-sanity-of-the-incoming-report.patch  |  107 ++++++++++++++++++++
 HID-usbhid-add-always-poll-quirk.patch             |   98 ++++++++++++++++++
 ...always-poll-quirk-for-Elan-Touchscreen-00.patch |   37 +++++++
 ...always-poll-quirk-for-Elan-Touchscreen-01.patch |   39 +++++++
 ...enable-always-poll-quirk-for-Elan-Touchsc.patch |   52 ++++++++++
 USB-core-add-device-qualifier-quirk.patch          |   52 ++++++++++
 ...device-qualifier-quirk-for-another-Elan-t.patch |   30 ++++++
 ...enable-device-qualifier-quirk-for-Elan-To.patch |   46 +++++++++
 ...enable-device-qualifier-quirk-for-another.patch |   32 ++++++
 kernel.spec                                        |   23 ++++
 10 files changed, 516 insertions(+), 0 deletions(-)
---
diff --git a/HID-rmi-check-sanity-of-the-incoming-report.patch b/HID-rmi-check-sanity-of-the-incoming-report.patch
new file mode 100644
index 0000000..82c316a
--- /dev/null
+++ b/HID-rmi-check-sanity-of-the-incoming-report.patch
@@ -0,0 +1,107 @@
+From: Benjamin Tissoires <benjamin.tissoires at redhat.com>
+Date: Wed, 10 Sep 2014 18:02:37 -0700
+Subject: [PATCH] HID: rmi: check sanity of the incoming report
+
+In the Dell XPS 13 9333, it appears that sometimes the bus get confused
+and corrupts the incoming data. It fills the input report with the
+sentinel value "ff". Synaptics told us that such behavior does not comes
+from the touchpad itself, so we filter out such reports here.
+
+Unfortunately, we can not simply discard the incoming data because they
+may contain useful information. Most of the time, the misbehavior is
+quite near the end of the report, so we can still use the valid part of
+it.
+
+Fixes:
+https://bugzilla.redhat.com/show_bug.cgi?id=1123584
+
+Signed-off-by: Benjamin Tissoires <benjamin.tissoires at redhat.com>
+Signed-off-by: Andrew Duggan <aduggan at synaptics.com>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/hid/hid-rmi.c | 44 ++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 38 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
+index 8389e8109218..3cccff73b9b9 100644
+--- a/drivers/hid/hid-rmi.c
++++ b/drivers/hid/hid-rmi.c
+@@ -320,10 +320,7 @@ static int rmi_f11_input_event(struct hid_device *hdev, u8 irq, u8 *data,
+ 	int offset;
+ 	int i;
+ 
+-	if (size < hdata->f11.report_size)
+-		return 0;
+-
+-	if (!(irq & hdata->f11.irq_mask))
++	if (!(irq & hdata->f11.irq_mask) || size <= 0)
+ 		return 0;
+ 
+ 	offset = (hdata->max_fingers >> 2) + 1;
+@@ -332,9 +329,19 @@ static int rmi_f11_input_event(struct hid_device *hdev, u8 irq, u8 *data,
+ 		int fs_bit_position = (i & 0x3) << 1;
+ 		int finger_state = (data[fs_byte_position] >> fs_bit_position) &
+ 					0x03;
++		int position = offset + 5 * i;
++
++		if (position + 5 > size) {
++			/* partial report, go on with what we received */
++			printk_once(KERN_WARNING
++				"%s %s: Detected incomplete finger report. Finger reports may occasionally get dropped on this platform.\n",
++				 dev_driver_string(&hdev->dev),
++				 dev_name(&hdev->dev));
++			hid_dbg(hdev, "Incomplete finger report\n");
++			break;
++		}
+ 
+-		rmi_f11_process_touch(hdata, i, finger_state,
+-				&data[offset + 5 * i]);
++		rmi_f11_process_touch(hdata, i, finger_state, &data[position]);
+ 	}
+ 	input_mt_sync_frame(hdata->input);
+ 	input_sync(hdata->input);
+@@ -352,6 +359,11 @@ static int rmi_f30_input_event(struct hid_device *hdev, u8 irq, u8 *data,
+ 	if (!(irq & hdata->f30.irq_mask))
+ 		return 0;
+ 
++	if (size < (int)hdata->f30.report_size) {
++		hid_warn(hdev, "Click Button pressed, but the click data is missing\n");
++		return 0;
++	}
++
+ 	for (i = 0; i < hdata->gpio_led_count; i++) {
+ 		if (test_bit(i, &hdata->button_mask)) {
+ 			value = (data[i / 8] >> (i & 0x07)) & BIT(0);
+@@ -412,9 +424,29 @@ static int rmi_read_data_event(struct hid_device *hdev, u8 *data, int size)
+ 	return 1;
+ }
+ 
++static int rmi_check_sanity(struct hid_device *hdev, u8 *data, int size)
++{
++	int valid_size = size;
++	/*
++	 * On the Dell XPS 13 9333, the bus sometimes get confused and fills
++	 * the report with a sentinel value "ff". Synaptics told us that such
++	 * behavior does not comes from the touchpad itself, so we filter out
++	 * such reports here.
++	 */
++
++	while ((data[valid_size - 1] == 0xff) && valid_size > 0)
++		valid_size--;
++
++	return valid_size;
++}
++
+ static int rmi_raw_event(struct hid_device *hdev,
+ 		struct hid_report *report, u8 *data, int size)
+ {
++	size = rmi_check_sanity(hdev, data, size);
++	if (size < 2)
++		return 0;
++
+ 	switch (data[0]) {
+ 	case RMI_READ_DATA_REPORT_ID:
+ 		return rmi_read_data_event(hdev, data, size);
+-- 
+1.9.3
+
diff --git a/HID-usbhid-add-always-poll-quirk.patch b/HID-usbhid-add-always-poll-quirk.patch
new file mode 100644
index 0000000..2406197
--- /dev/null
+++ b/HID-usbhid-add-always-poll-quirk.patch
@@ -0,0 +1,98 @@
+From: Johan Hovold <johan at kernel.org>
+Date: Fri, 5 Sep 2014 18:08:47 +0200
+Subject: [PATCH] HID: usbhid: add always-poll quirk
+
+Add quirk to make sure that a device is always polled for input events
+even if it hasn't been opened.
+
+This is needed for devices that disconnects from the bus unless the
+interrupt endpoint has been polled at least once or when not responding
+to an input event (e.g. after having shut down X).
+
+Signed-off-by: Johan Hovold <johan at kernel.org>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/hid/usbhid/hid-core.c | 26 +++++++++++++++++++++++---
+ include/linux/hid.h           |  1 +
+ 2 files changed, 24 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
+index 79cf503e37bf..ddd547ad6d7e 100644
+--- a/drivers/hid/usbhid/hid-core.c
++++ b/drivers/hid/usbhid/hid-core.c
+@@ -82,7 +82,7 @@ static int hid_start_in(struct hid_device *hid)
+ 	struct usbhid_device *usbhid = hid->driver_data;
+ 
+ 	spin_lock_irqsave(&usbhid->lock, flags);
+-	if (hid->open > 0 &&
++	if ((hid->open > 0 || hid->quirks & HID_QUIRK_ALWAYS_POLL) &&
+ 			!test_bit(HID_DISCONNECTED, &usbhid->iofl) &&
+ 			!test_bit(HID_SUSPENDED, &usbhid->iofl) &&
+ 			!test_and_set_bit(HID_IN_RUNNING, &usbhid->iofl)) {
+@@ -292,6 +292,8 @@ static void hid_irq_in(struct urb *urb)
+ 	case 0:			/* success */
+ 		usbhid_mark_busy(usbhid);
+ 		usbhid->retry_delay = 0;
++		if ((hid->quirks & HID_QUIRK_ALWAYS_POLL) && !hid->open)
++			break;
+ 		hid_input_report(urb->context, HID_INPUT_REPORT,
+ 				 urb->transfer_buffer,
+ 				 urb->actual_length, 1);
+@@ -735,8 +737,10 @@ void usbhid_close(struct hid_device *hid)
+ 	if (!--hid->open) {
+ 		spin_unlock_irq(&usbhid->lock);
+ 		hid_cancel_delayed_stuff(usbhid);
+-		usb_kill_urb(usbhid->urbin);
+-		usbhid->intf->needs_remote_wakeup = 0;
++		if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL)) {
++			usb_kill_urb(usbhid->urbin);
++			usbhid->intf->needs_remote_wakeup = 0;
++		}
+ 	} else {
+ 		spin_unlock_irq(&usbhid->lock);
+ 	}
+@@ -1134,6 +1138,19 @@ static int usbhid_start(struct hid_device *hid)
+ 
+ 	set_bit(HID_STARTED, &usbhid->iofl);
+ 
++	if (hid->quirks & HID_QUIRK_ALWAYS_POLL) {
++		ret = usb_autopm_get_interface(usbhid->intf);
++		if (ret)
++			goto fail;
++		usbhid->intf->needs_remote_wakeup = 1;
++		ret = hid_start_in(hid);
++		if (ret) {
++			dev_err(&hid->dev,
++				"failed to start in urb: %d\n", ret);
++		}
++		usb_autopm_put_interface(usbhid->intf);
++	}
++
+ 	/* Some keyboards don't work until their LEDs have been set.
+ 	 * Since BIOSes do set the LEDs, it must be safe for any device
+ 	 * that supports the keyboard boot protocol.
+@@ -1166,6 +1183,9 @@ static void usbhid_stop(struct hid_device *hid)
+ 	if (WARN_ON(!usbhid))
+ 		return;
+ 
++	if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
++		usbhid->intf->needs_remote_wakeup = 0;
++
+ 	clear_bit(HID_STARTED, &usbhid->iofl);
+ 	spin_lock_irq(&usbhid->lock);	/* Sync with error and led handlers */
+ 	set_bit(HID_DISCONNECTED, &usbhid->iofl);
+diff --git a/include/linux/hid.h b/include/linux/hid.h
+index f53c4a9cca1d..26ee25fced27 100644
+--- a/include/linux/hid.h
++++ b/include/linux/hid.h
+@@ -287,6 +287,7 @@ struct hid_item {
+ #define HID_QUIRK_HIDINPUT_FORCE		0x00000080
+ #define HID_QUIRK_NO_EMPTY_INPUT		0x00000100
+ #define HID_QUIRK_NO_INIT_INPUT_REPORTS		0x00000200
++#define HID_QUIRK_ALWAYS_POLL			0x00000400
+ #define HID_QUIRK_SKIP_OUTPUT_REPORTS		0x00010000
+ #define HID_QUIRK_SKIP_OUTPUT_REPORT_ID		0x00020000
+ #define HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP	0x00040000
+-- 
+1.9.3
+
diff --git a/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-00.patch b/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-00.patch
new file mode 100644
index 0000000..1ead40b
--- /dev/null
+++ b/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-00.patch
@@ -0,0 +1,37 @@
+From: Adel Gadllah <adel.gadllah at gmail.com>
+Date: Mon, 6 Oct 2014 15:32:01 +0200
+Subject: [PATCH] HID: usbhid: always-poll quirk for Elan Touchscreen 009b
+
+This device needs the quirk as well.
+---
+ drivers/hid/hid-ids.h           | 1 +
+ drivers/hid/usbhid/hid-quirks.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index 0d2e07dd71d8..c293747f8c72 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -298,6 +298,7 @@
+ 
+ #define USB_VENDOR_ID_ELAN		0x04f3
+ #define USB_DEVICE_ID_ELAN_TOUCHSCREEN	0x0089
++#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B	0x009b
+ 
+ #define USB_VENDOR_ID_ELECOM		0x056e
+ #define USB_DEVICE_ID_ELECOM_BM084	0x0061
+diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
+index ca18136ead15..2cdc1ecbf8e4 100644
+--- a/drivers/hid/usbhid/hid-quirks.c
++++ b/drivers/hid/usbhid/hid-quirks.c
+@@ -71,6 +71,7 @@ static const struct hid_blacklist {
+ 	{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL },
++	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B, HID_QUIRK_ALWAYS_POLL },
+ 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
+ 	{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
+-- 
+1.9.3
+
diff --git a/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-01.patch b/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-01.patch
new file mode 100644
index 0000000..1f78072
--- /dev/null
+++ b/HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-01.patch
@@ -0,0 +1,39 @@
+From: Adel Gadllah <adel.gadllah at gmail.com>
+Date: Tue, 7 Oct 2014 18:45:09 +0200
+Subject: [PATCH] HID: usbhid: always-poll quirk for Elan Touchscreen 016f
+
+This device needs the quirk as well.
+
+Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
+---
+ drivers/hid/hid-ids.h           | 1 +
+ drivers/hid/usbhid/hid-quirks.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index c293747f8c72..81bc10e0bba2 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -299,6 +299,7 @@
+ #define USB_VENDOR_ID_ELAN		0x04f3
+ #define USB_DEVICE_ID_ELAN_TOUCHSCREEN	0x0089
+ #define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B	0x009b
++#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F	0x016f
+ 
+ #define USB_VENDOR_ID_ELECOM		0x056e
+ #define USB_DEVICE_ID_ELECOM_BM084	0x0061
+diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
+index 2cdc1ecbf8e4..39a265df2909 100644
+--- a/drivers/hid/usbhid/hid-quirks.c
++++ b/drivers/hid/usbhid/hid-quirks.c
+@@ -72,6 +72,7 @@ static const struct hid_blacklist {
+ 	{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL },
+ 	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B, HID_QUIRK_ALWAYS_POLL },
++	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F, HID_QUIRK_ALWAYS_POLL },
+ 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
+ 	{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
+-- 
+1.9.3
+
diff --git a/HID-usbhid-enable-always-poll-quirk-for-Elan-Touchsc.patch b/HID-usbhid-enable-always-poll-quirk-for-Elan-Touchsc.patch
new file mode 100644
index 0000000..ff2d25b
--- /dev/null
+++ b/HID-usbhid-enable-always-poll-quirk-for-Elan-Touchsc.patch
@@ -0,0 +1,52 @@
+From: Johan Hovold <johan at kernel.org>
+Date: Fri, 5 Sep 2014 18:08:48 +0200
+Subject: [PATCH] HID: usbhid: enable always-poll quirk for Elan Touchscreen
+
+Enable the always-poll quirk for Elan Touchscreens found on some recent
+Samsung laptops.
+
+Without this quirk the device keeps disconnecting from the bus (and is
+re-enumerated) unless opened (and kept open, should an input event
+occur).
+
+Note that while the device can be run-time suspended, the autosuspend
+timeout must be high enough to allow the device to be polled at least
+once before being suspended. Specifically, using autosuspend_delay_ms=0
+will still cause the device to disconnect on input events.
+
+Signed-off-by: Johan Hovold <johan at kernel.org>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/hid/hid-ids.h           | 3 +++
+ drivers/hid/usbhid/hid-quirks.c | 1 +
+ 2 files changed, 4 insertions(+)
+
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index 25cd674d6064..0d2e07dd71d8 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -296,6 +296,9 @@
+ #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7	0x73f7
+ #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001	0xa001
+ 
++#define USB_VENDOR_ID_ELAN		0x04f3
++#define USB_DEVICE_ID_ELAN_TOUCHSCREEN	0x0089
++
+ #define USB_VENDOR_ID_ELECOM		0x056e
+ #define USB_DEVICE_ID_ELECOM_BM084	0x0061
+ 
+diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
+index 15225f3eaed1..ca18136ead15 100644
+--- a/drivers/hid/usbhid/hid-quirks.c
++++ b/drivers/hid/usbhid/hid-quirks.c
+@@ -70,6 +70,7 @@ static const struct hid_blacklist {
+ 	{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
++	{ USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL },
+ 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+ 	{ USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
+ 	{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
+-- 
+1.9.3
+
diff --git a/USB-core-add-device-qualifier-quirk.patch b/USB-core-add-device-qualifier-quirk.patch
new file mode 100644
index 0000000..dad1e5e
--- /dev/null
+++ b/USB-core-add-device-qualifier-quirk.patch
@@ -0,0 +1,52 @@
+From d3641b4838204c1257bd575f12ba9dc24a4bc707 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan at kernel.org>
+Date: Mon, 25 Aug 2014 17:51:26 +0200
+Subject: [PATCH] USB: core: add device-qualifier quirk
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add new quirk for devices that cannot handle requests for the
+device_qualifier descriptor.
+
+A USB-2.0 compliant device must respond to requests for the
+device_qualifier descriptor (even if it's with a request error), but at
+least one device is known to misbehave after such a request.
+
+Suggested-by: Bjørn Mork <bjorn at mork.no>
+Signed-off-by: Johan Hovold <johan at kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/usb/core/hub.c     | 3 +++
+ include/linux/usb/quirks.h | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
+index 50e854509f55..8f9d142aaf4a 100644
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -4522,6 +4522,9 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1)
+ 	struct usb_qualifier_descriptor	*qual;
+ 	int				status;
+ 
++	if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER)
++		return;
++
+ 	qual = kmalloc (sizeof *qual, GFP_KERNEL);
+ 	if (qual == NULL)
+ 		return;
+diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
+index 52f944dfe2fd..4681e0fb1fac 100644
+--- a/include/linux/usb/quirks.h
++++ b/include/linux/usb/quirks.h
+@@ -30,4 +30,7 @@
+    descriptor */
+ #define USB_QUIRK_DELAY_INIT		0x00000040
+ 
++/* device can't handle device_qualifier descriptor requests */
++#define USB_QUIRK_DEVICE_QUALIFIER	0x00000100
++
+ #endif /* __LINUX_USB_QUIRKS_H */
+-- 
+1.9.3
+
diff --git a/USB-quirks-device-qualifier-quirk-for-another-Elan-t.patch b/USB-quirks-device-qualifier-quirk-for-another-Elan-t.patch
new file mode 100644
index 0000000..8bad312
--- /dev/null
+++ b/USB-quirks-device-qualifier-quirk-for-another-Elan-t.patch
@@ -0,0 +1,30 @@
+From: Adel Gadllah <adel.gadllah at gmail.com>
+Date: Tue, 7 Oct 2014 18:42:28 +0200
+Subject: [PATCH] USB: quirks: device-qualifier quirk for another Elan
+ touchscreen
+
+Yet another device affected by this.
+
+Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
+---
+ drivers/usb/core/quirks.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
+index cac60d9b091b..e71bad25294c 100644
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -98,6 +98,10 @@ static const struct usb_device_id usb_quirk_list[] = {
+ 			USB_QUIRK_DEVICE_QUALIFIER },
+ 
+ 	/* Elan Touchscreen */
++	{ USB_DEVICE(0x04f3, 0x016f), .driver_info =
++			USB_QUIRK_DEVICE_QUALIFIER },
++
++	/* Elan Touchscreen */
+ 	{ USB_DEVICE(0x04f3, 0x009b), .driver_info =
+ 			USB_QUIRK_DEVICE_QUALIFIER },
+ 
+-- 
+1.9.3
+
diff --git a/USB-quirks-enable-device-qualifier-quirk-for-Elan-To.patch b/USB-quirks-enable-device-qualifier-quirk-for-Elan-To.patch
new file mode 100644
index 0000000..a344aba
--- /dev/null
+++ b/USB-quirks-enable-device-qualifier-quirk-for-Elan-To.patch
@@ -0,0 +1,46 @@
+From: Johan Hovold <johan at kernel.org>
+Date: Mon, 25 Aug 2014 17:51:27 +0200
+Subject: [PATCH] USB: quirks: enable device-qualifier quirk for Elan
+ Touchscreen
+
+Enable device-qualifier quirk for Elan Touchscreen, which often fails to
+handle requests for the device_descriptor.
+
+Note that the device sometimes do respond properly with a Request Error
+(three times as USB core retries), but usually fails to respond at all.
+When this happens any further descriptor requests also fails, for
+example:
+
+[ 1528.688934] usb 2-7: new full-speed USB device number 4 using xhci_hcd
+[ 1530.945588] usb 2-7: unable to read config index 0 descriptor/start: -71
+[ 1530.945592] usb 2-7: can't read configurations, error -71
+
+This has been observed repeating for over a minute before eventual
+successful enumeration.
+
+Reported-by: Drew Von Spreecken <drewvs at gmail.com>
+Reported-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+Signed-off-by: Johan Hovold <johan at kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/usb/core/quirks.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
+index bae636e2a1a3..a342a783d496 100644
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -93,6 +93,10 @@ static const struct usb_device_id usb_quirk_list[] = {
+ 	{ USB_DEVICE(0x04e8, 0x6601), .driver_info =
+ 			USB_QUIRK_CONFIG_INTF_STRINGS },
+ 
++	/* Elan Touchscreen */
++	{ USB_DEVICE(0x04f3, 0x0089), .driver_info =
++			USB_QUIRK_DEVICE_QUALIFIER },
++
+ 	/* Roland SC-8820 */
+ 	{ USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
+ 
+-- 
+1.9.3
+
diff --git a/USB-quirks-enable-device-qualifier-quirk-for-another.patch b/USB-quirks-enable-device-qualifier-quirk-for-another.patch
new file mode 100644
index 0000000..febd6da
--- /dev/null
+++ b/USB-quirks-enable-device-qualifier-quirk-for-another.patch
@@ -0,0 +1,32 @@
+From: Adel Gadllah <adel.gadllah-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
+Date: Sun, 5 Oct 2014 18:32:34 +0200
+Subject: [PATCH] USB: quirks: enable device-qualifier quirk for another Elan
+ touchscreen
+
+Currently this quirk is enabled for the model with the device id 0x0089, it
+is needed for the 0x009b model, which is found on the Fujitsu Lifebook u904
+as well.
+
+Signed-off-by: Adel Gadllah <adel.gadllah-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
+---
+ drivers/usb/core/quirks.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
+index a342a783d496..cac60d9b091b 100644
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -97,6 +97,10 @@ static const struct usb_device_id usb_quirk_list[] = {
+ 	{ USB_DEVICE(0x04f3, 0x0089), .driver_info =
+ 			USB_QUIRK_DEVICE_QUALIFIER },
+ 
++	/* Elan Touchscreen */
++	{ USB_DEVICE(0x04f3, 0x009b), .driver_info =
++			USB_QUIRK_DEVICE_QUALIFIER },
++
+ 	/* Roland SC-8820 */
+ 	{ USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
+ 
+-- 
+1.9.3
+
diff --git a/kernel.spec b/kernel.spec
index aac407b..2701c51 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -723,6 +723,16 @@ Patch26032: mnt-Prevent-pivot_root-from-creating-a-loop-in-the-m.patch
 #rhbz 1149414
 Patch26033: bcache-Make-sure-to-pass-GFP_WAIT-to-mempool_alloc.patch
 
+#rhbz 1149509
+Patch26034: USB-core-add-device-qualifier-quirk.patch
+Patch26035: USB-quirks-enable-device-qualifier-quirk-for-Elan-To.patch
+Patch26036: USB-quirks-enable-device-qualifier-quirk-for-another.patch
+Patch26037: HID-usbhid-add-always-poll-quirk.patch
+Patch26038: HID-usbhid-enable-always-poll-quirk-for-Elan-Touchsc.patch
+Patch26039: HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-00.patch
+Patch26040: USB-quirks-device-qualifier-quirk-for-another-Elan-t.patch
+Patch26041: HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-01.patch
+
 # git clone ssh://git.fedorahosted.org/git/kernel-arm64.git, git diff master...devel
 Patch30000: kernel-arm64.patch
 
@@ -1414,6 +1424,16 @@ ApplyPatch mnt-Prevent-pivot_root-from-creating-a-loop-in-the-m.patch
 #rhbz 1149414
 ApplyPatch bcache-Make-sure-to-pass-GFP_WAIT-to-mempool_alloc.patch
 
+#rhbz 1149509
+ApplyPatch USB-core-add-device-qualifier-quirk.patch
+ApplyPatch USB-quirks-enable-device-qualifier-quirk-for-Elan-To.patch
+ApplyPatch USB-quirks-enable-device-qualifier-quirk-for-another.patch
+ApplyPatch HID-usbhid-add-always-poll-quirk.patch
+ApplyPatch HID-usbhid-enable-always-poll-quirk-for-Elan-Touchsc.patch
+ApplyPatch HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-00.patch
+ApplyPatch USB-quirks-device-qualifier-quirk-for-another-Elan-t.patch
+ApplyPatch HID-usbhid-always-poll-quirk-for-Elan-Touchscreen-01.patch
+
 %if 0%{?aarch64patches}
 ApplyPatch kernel-arm64.patch
 %ifnarch aarch64 # this is stupid, but i want to notice before secondary koji does.
@@ -2232,6 +2252,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Sat Oct 11 2014 Josh Boyer <jwboyer at fedoraproject.org>
+- Add patches to fix elantech touchscreens (rhbz 1149509)
+
 * Fri Oct 10 2014 Josh Boyer <jwboyer at fedoraproject.org>
 - Add patch to fix bcache NULL ptr deref (rhbz 1149414)
 - CVE-2014-7970 VFS: DoS with USER_NS (rhbz 1151095 1151484)


More information about the scm-commits mailing list