From: Mika Westerberg Date: Tue, 19 Feb 2013 09:22:33 +0000 (+0200) Subject: HID: make sensor autodetection independent of underlying bus X-Git-Tag: firefly_0821_release~3680^2~642^2~3^3~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6399f335c2c5fb9c244bbb2b8a437498d260bed7;p=firefly-linux-kernel-4.4.55.git HID: make sensor autodetection independent of underlying bus 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index ff75cabf7393..fea20c650f3f 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; }