From patchwork Wed Sep 30 08:45:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 7293541 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E83AD9F32B for ; Wed, 30 Sep 2015 08:46:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 224312053C for ; Wed, 30 Sep 2015 08:46:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A99E20547 for ; Wed, 30 Sep 2015 08:46:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750953AbbI3IqE (ORCPT ); Wed, 30 Sep 2015 04:46:04 -0400 Received: from mga14.intel.com ([192.55.52.115]:39427 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbbI3IqB (ORCPT ); Wed, 30 Sep 2015 04:46:01 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Sep 2015 01:46:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,611,1437462000"; d="scan'208";a="800338434" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.200]) by fmsmga001.fm.intel.com with SMTP; 30 Sep 2015 01:45:58 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 30 Sep 2015 11:45:57 +0300 Date: Wed, 30 Sep 2015 11:45:57 +0300 From: Mika Westerberg To: Benjamin Tissoires Cc: Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices Message-ID: <20150930084557.GE1551@lahna.fi.intel.com> References: <1443451630-144023-1-git-send-email-mika.westerberg@linux.intel.com> <20150929090431.GA30386@mail.corp.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150929090431.GA30386@mail.corp.redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);