From patchwork Wed Jul 23 12:42:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolai Kondrashov X-Patchwork-Id: 4610341 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E3D8AC0514 for ; Wed, 23 Jul 2014 12:43:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A17D20172 for ; Wed, 23 Jul 2014 12:43:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39100201BA for ; Wed, 23 Jul 2014 12:43:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbaGWMnY (ORCPT ); Wed, 23 Jul 2014 08:43:24 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:52851 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbaGWMnY (ORCPT ); Wed, 23 Jul 2014 08:43:24 -0400 Received: by mail-we0-f175.google.com with SMTP id t60so1139630wes.20 for ; Wed, 23 Jul 2014 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Umju+vBiUs5UfFfOj3eDB/OoJ/iiYmO3JikqQAZSr/E=; b=MabuDEG05rDt/2S7A7Ry7l2gWYboGnyqYWLoqiK1N7ajjK526H62xxqY+gqFYjJbBx AfT8Ey9va30Xg7kZbGQZlbdCMsfKNirT9CqecfAB5bzpkAZJUD/KoiqHRCT06cDgs6hH BMbFwAe4q+aHos2c9k5ZxSCXqC9NTot4stYWaPEgdR73G5gg3ssKjSTXbrK8e6H0+h4a qdTvLPGa9tfbox9IyZmk0W6JWpNUyv8ODnC1jQijwzwUYUZGOuLlDesYYnU3l6z99lBJ NkRmevNkrBNeUTH8Wh6Ut4MymlpZD+Ul/FdljACAS6z1IQ2GEW5xQru8m/wtSWSDZW1i 3JcA== X-Received: by 10.180.182.131 with SMTP id ee3mr23858422wic.37.1406119403019; Wed, 23 Jul 2014 05:43:23 -0700 (PDT) Received: from gimli.redhat.com (a88-114-29-97.elisa-laajakaista.fi. [88.114.29.97]) by mx.google.com with ESMTPSA id fw4sm8806681wib.19.2014.07.23.05.43.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Jul 2014 05:43:22 -0700 (PDT) From: Nikolai Kondrashov To: Jiri Kosina Cc: linux-input@vger.kernel.org, DIGImend-devel , Nikolai Kondrashov Subject: [PATCH 3/5] hid: huion: Don't ignore other interfaces Date: Wed, 23 Jul 2014 15:42:56 +0300 Message-Id: <1406119378-24551-4-git-send-email-spbnick@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406119378-24551-1-git-send-email-spbnick@gmail.com> References: <1406119378-24551-1-git-send-email-spbnick@gmail.com> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Don't ignore non pen-reporting interfaces as they may be used by some models reusing the same product ID. Signed-off-by: Nikolai Kondrashov Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-huion.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c index db24472..e5f1e22 100644 --- a/drivers/hid/hid-huion.c +++ b/drivers/hid/hid-huion.c @@ -107,17 +107,6 @@ static int huion_tablet_enable(struct hid_device *hdev) static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id) { int ret; - struct usb_interface *intf = to_usb_interface(hdev->dev.parent); - - /* Ignore interfaces 1 (mouse) and 2 (keyboard) for tablet, - * as they are not used - */ - switch (id->product) { - case USB_DEVICE_ID_HUION_TABLET: - if (intf->cur_altsetting->desc.bInterfaceNumber != 0x00) - return -ENODEV; - break; - } ret = hid_parse(hdev); if (ret) { @@ -151,10 +140,13 @@ err: static int huion_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { + struct usb_interface *intf = to_usb_interface(hdev->dev.parent); + switch (hdev->product) { case USB_DEVICE_ID_HUION_TABLET: /* If this is a pen input report */ - if (report->type == HID_INPUT_REPORT && + if (intf->cur_altsetting->desc.bInterfaceNumber == 0 && + report->type == HID_INPUT_REPORT && report->id == 0x07 && size >= 2) /* Invert the in-range bit */ data[1] ^= 0x40;