From patchwork Thu Jul 17 23:14:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Duggan X-Patchwork-Id: 4579181 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 80D20C0514 for ; Thu, 17 Jul 2014 23:22:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4CF3201BA for ; Thu, 17 Jul 2014 23:22:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5D0F2011B for ; Thu, 17 Jul 2014 23:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758071AbaGQXWi (ORCPT ); Thu, 17 Jul 2014 19:22:38 -0400 Received: from us-mx2.synaptics.com ([192.147.44.131]:32990 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758706AbaGQXWg (ORCPT ); Thu, 17 Jul 2014 19:22:36 -0400 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 17 Jul 2014 16:23:28 -0700 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Thu, 17 Jul 2014 16:31:03 -0700 X-PGP-Universal: processed; by securemail.synaptics.com on Thu, 17 Jul 2014 16:31:03 -0700 Received: from noble.synaptics-inc.local (10.2.20.38) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 17 Jul 2014 16:22:22 -0700 From: Andrew Duggan To: , CC: Andrew Duggan , Jiri Kosina , Benjamin Tissoires Subject: [PATCH] HID: rmi: only bind the hid-rmi driver to the mouse interface of composite USB devices Date: Thu, 17 Jul 2014 16:14:45 -0700 Message-ID: <1405638885-8014-2-git-send-email-aduggan@synaptics.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405638885-8014-1-git-send-email-aduggan@synaptics.com> References: <1405638885-8014-1-git-send-email-aduggan@synaptics.com> MIME-Version: 1.0 X-Originating-IP: [10.2.20.38] 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, RP_MATCHES_RCVD, 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 On composite HID devices there may be multiple HID devices on separate interfaces, but hid-rmi should only bind to the mouse interface. One example is the Dell Venue 11 Pro's keyboard dock which contains a composite USB device with a HID touchpad and HID keyboard on separate intefaces. Since the USB Vendor ID is Synaptic's, hid-core is currently trying to bind hid-rmi to all\of the HID devices. This patch ensures that hid-rmi only binds to the mouse interface. related bug: https://bugzilla.kernel.org/show_bug.cgi?id=80091 Signed-off-by: Andrew Duggan Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8ed66fd..f10e768 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -783,7 +783,9 @@ static int hid_scan_report(struct hid_device *hid) * Vendor specific handlings */ if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) && - (hid->group == HID_GROUP_GENERIC)) + (hid->group == HID_GROUP_GENERIC) && + /* only bind to the mouse interface of composite USB devices */ + (hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE)) /* hid-rmi should take care of them, not hid-generic */ hid->group = HID_GROUP_RMI;