Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1235902
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices |
| Date | 2015-09-30 10:50 +0200 |
| Message-ID | <qelfj-8h1-5@gated-at.bofh.it> (permalink) |
| References | <qdHUB-2nN-11@gated-at.bofh.it> <qdZ58-1ZA-7@gated-at.bofh.it> |
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
On Tue, Sep 29, 2015 at 05:04:31AM -0400, Benjamin Tissoires wrote:
> > +static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
> > +{
> > + int ret, size = hid_report_len(report);
> > + u8 *buf;
> > +
> > + /*
> > + * Only fetch the feature report if initial reports are not already
> > + * been retrieved. Currently this is only done for Windows 8 touch
> > + * devices.
> > + */
> > + if (!(hdev->quirks & HID_QUIRK_NO_INIT_REPORTS))
> > + return;
>
> Some Win 7 panels have this quirk set too because they do not support
> either querying random feature or input reports.
>
> I think this test is safe given that this is, I think, what the Windows
> driver does (I remember that it queries for the features it needs).
> However I am not 100% sure if this will not break one low quality
> touchscreen.
>
> I would be in favor of applying the patch in its current shape, but if
> Jiri thinks we need a little bit more caution here, we would need to add
> a test regarding the Win8 capability here.
What about adding following on top of this patch? It checks the device
in question belongs to "win8 class".
I can send a new version of the patch if this seems reasonable.
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index d9ca2b96ab68..72c55a3f650f 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -311,6 +311,7 @@ static struct attribute_group mt_attribute_group = {
static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
{
+ struct mt_device *td = hid_get_drvdata(hdev);
int ret, size = hid_report_len(report);
u8 *buf;
@@ -319,7 +320,8 @@ static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
* been retrieved. Currently this is only done for Windows 8 touch
* devices.
*/
- if (!(hdev->quirks & HID_QUIRK_NO_INIT_REPORTS))
+ if (!(hdev->quirks & HID_QUIRK_NO_INIT_REPORTS) ||
+ td->mtclass.name != MT_CLS_WIN_8)
return;
buf = hid_alloc_report_buf(report, GFP_KERNEL);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices Mika Westerberg <mika.westerberg@linux.intel.com> - 2015-09-28 16:50 +0200
Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2015-09-29 11:10 +0200
Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices Mika Westerberg <mika.westerberg@linux.intel.com> - 2015-09-30 10:50 +0200
csiph-web