From patchwork Tue Feb 19 09:22:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 2162311 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3F1753FCF6 for ; Tue, 19 Feb 2013 09:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758357Ab3BSJVK (ORCPT ); Tue, 19 Feb 2013 04:21:10 -0500 Received: from mga09.intel.com ([134.134.136.24]:24617 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754892Ab3BSJVJ (ORCPT ); Tue, 19 Feb 2013 04:21:09 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 19 Feb 2013 01:19:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,693,1355126400"; d="scan'208";a="287560934" Received: from blue.fi.intel.com ([10.237.72.156]) by orsmga002.jf.intel.com with ESMTP; 19 Feb 2013 01:21:06 -0800 Received: by blue.fi.intel.com (Postfix, from userid 1004) id 8A862E0085; Tue, 19 Feb 2013 11:22:33 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Alexander Holler , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, srinivas.pandruvada@intel.com, Mika Westerberg Subject: [PATCH] HID: make sensor autodetection independent of underlying bus Date: Tue, 19 Feb 2013 11:22:33 +0200 Message-Id: <1361265753-17541-1-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <51221AFD.1090108@ahsoftware.de> References: <51221AFD.1090108@ahsoftware.de> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead of limiting HID sensors to USB and I2C busses we can just make everything that has usage page of HID_UP_SENSOR to be included in HID_GROUP_SENSOR_HUB group. This allows the sensor-hub to work over bluetooth (and other transports) as well. Reported-by: Alexander Holler Signed-off-by: Mika Westerberg Reviewed-By: Benjamin Tissoires --- drivers/hid/hid-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index fe3a59e..f89e902 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -728,8 +728,7 @@ static int hid_scan_report(struct hid_device *hid) } else if (page == HID_UP_SENSOR && item.type == HID_ITEM_TYPE_MAIN && item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION && - (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL && - (hid->bus == BUS_USB || hid->bus == BUS_I2C)) + (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL) hid->group = HID_GROUP_SENSOR_HUB; }