From patchwork Wed Jul 23 16:31:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolai Kondrashov X-Patchwork-Id: 4612031 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D2D219F2B8 for ; Wed, 23 Jul 2014 16:32:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41C3D201BB for ; Wed, 23 Jul 2014 16:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 544B3201BC for ; Wed, 23 Jul 2014 16:32:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758092AbaGWQcQ (ORCPT ); Wed, 23 Jul 2014 12:32:16 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:59454 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758143AbaGWQcO (ORCPT ); Wed, 23 Jul 2014 12:32:14 -0400 Received: by mail-we0-f174.google.com with SMTP id x48so1489733wes.33 for ; Wed, 23 Jul 2014 09:32:13 -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=jooVg4dGd9pbsQwsd4ClvRQ81am5a0H3GKTdLs7/pu8=; b=a2TAGvyW1/vyyzdbu1a1hTge3eBJHoDbicD1zi1PsJeYdO6XvPThM4nRsKHHZm8ds+ JLUM/A9oKI5YMQZF3WO6wa5mTWvCL1iXEe8LE0jBH1gff7VmIaGBbV/95yoYTjxV/m34 41/hnojvudAeIc+fi2EAMtuggHS26070amZ3pW93Jru6ZCKHays1n+OEGA1Cb4K7RK3P 3TtpjnYOTEDzofhjU/sa7nEmXmQpUi2z7dxzgwFjGD3b/nPsDhtDQY3jkzjvzskqFFrt VnDhEu9LPc5ldWONCLE3bPFfjGoWMi+7TBVWgZeuhswWUwo3MN2xsF5bUhMcEXwjJY8c ShHQ== X-Received: by 10.180.94.5 with SMTP id cy5mr4547983wib.11.1406133133544; Wed, 23 Jul 2014 09:32:13 -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 10sm7540763wjx.26.2014.07.23.09.32.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Jul 2014 09:32:12 -0700 (PDT) From: Nikolai Kondrashov To: Jiri Kosina Cc: linux-input@vger.kernel.org, DIGImend-devel , Nikolai Kondrashov Subject: [PATCH 2/4] hid: huion: Don't ignore other interfaces Date: Wed, 23 Jul 2014 19:31:55 +0300 Message-Id: <1406133117-29243-3-git-send-email-spbnick@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1406133117-29243-1-git-send-email-spbnick@gmail.com> References: <53CFC950.90703@gmail.com> <1406133117-29243-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 --- drivers/hid/hid-huion.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c index 25d01cd..46c425b 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,8 +140,13 @@ err: static int huion_raw_event(struct hid_device *hdev, struct hid_report *report, u8 *data, int size) { - /* If this is a pen input report then invert the in-range bit */ - if (report->type == HID_INPUT_REPORT && report->id == 0x07 && size >= 2) + struct usb_interface *intf = to_usb_interface(hdev->dev.parent); + + /* If this is a pen 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; return 0;