From patchwork Thu Apr 27 13:57:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 9702905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 385F3601D3 for ; Thu, 27 Apr 2017 14:04:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27A4328645 for ; Thu, 27 Apr 2017 14:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C4E92864A; Thu, 27 Apr 2017 14:04:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A4C328645 for ; Thu, 27 Apr 2017 14:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033648AbdD0OE1 (ORCPT ); Thu, 27 Apr 2017 10:04:27 -0400 Received: from mga07.intel.com ([134.134.136.100]:57761 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033461AbdD0OEY (ORCPT ); Thu, 27 Apr 2017 10:04:24 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 27 Apr 2017 07:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,384,1488873600"; d="scan'208";a="961765420" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.56]) by orsmga003.jf.intel.com with ESMTP; 27 Apr 2017 07:04:20 -0700 From: Jarkko Nikula To: linux-input@vger.kernel.org Cc: Jiri Kosina , Benjamin Tissoires , Srinivas Pandruvada , Jarkko Nikula Subject: [PATCH] HID: Support i2c-hid multitouch compatible Wacom touchscreens Date: Thu, 27 Apr 2017 16:57:57 +0300 Message-Id: <20170427135757.29947-1-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.11.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Vendor specific handling in hid_scan_report() overrides the hid->group to HID_GROUP_WACOM for all devices with vendor ID equal to USB_VENDOR_ID_WACOM. However there is an i2c-hid multitouch compatible Wacom touschreen which is parsed as generic HID_GROUP_MULTITOUCH_WIN_8 device but hid-multitouch doesn't probe because of this overriding. Support this touschreen by overring the group only when the bus is different than I2C. Signed-off-by: Jarkko Nikula --- I'm not an HID expert and I don't know is there any existing Wacom tablets using the I2C bus. There are USB and Bluetooth tablets so that's the reason I'm checking id->bus != BUS_I2C when overring the group. I've done only basic testing that device is registered as an hid-multitouch device and "hexdump /dev/input/eventX" produces a bunch of hexadecimals when touschscreen is touched. --- drivers/hid/hid-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d162f0dc76e3..cfb0b7262de7 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -816,7 +816,8 @@ static int hid_scan_report(struct hid_device *hid) */ switch (hid->vendor) { case USB_VENDOR_ID_WACOM: - hid->group = HID_GROUP_WACOM; + if (hid->bus != BUS_I2C) + hid->group = HID_GROUP_WACOM; break; case USB_VENDOR_ID_SYNAPTICS: if (hid->group == HID_GROUP_GENERIC)