From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Jiri Kosina <jikos@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices
Date: Wed, 30 Sep 2015 11:45:57 +0300 [thread overview]
Message-ID: <20150930084557.GE1551@lahna.fi.intel.com> (raw)
In-Reply-To: <20150929090431.GA30386@mail.corp.redhat.com>
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);
next prev parent reply other threads:[~2015-09-30 8:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-28 14:47 [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices Mika Westerberg
2015-09-29 9:04 ` Benjamin Tissoires
2015-09-30 8:45 ` Mika Westerberg [this message]
2015-10-06 14:07 ` Jiri Kosina
2015-10-07 12:33 ` [PATCH v2] " Mika Westerberg
2015-10-07 13:34 ` Benjamin Tissoires
2015-10-07 15:56 ` Seth Forshee
2015-10-08 1:12 ` Andrew Duggan
2015-10-08 9:40 ` Mika Westerberg
2015-10-09 1:10 ` Andrew Duggan
2015-10-09 8:53 ` Mika Westerberg
2015-10-09 13:39 ` Benjamin Tissoires
2015-10-11 22:51 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150930084557.GE1551@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).