HID: extend autodetect to handle I2C sensors as well
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 11 Feb 2013 10:31:17 +0000 (12:31 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 18 Feb 2013 09:23:48 +0000 (10:23 +0100)
Since the advent of HID over I2C protocol, it is possible to have sensor
hubs behind I2C bus as well. We can autodetect this in a same way than USB
sensor hubs.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c

index eb2ee11b6412ac43e9baa08596b881d92c8430e3..fe3a59e2a5ba398eccda7fde9d72c9dea4950437 100644 (file)
@@ -729,7 +729,7 @@ static int hid_scan_report(struct hid_device *hid)
                        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_USB || hid->bus == BUS_I2C))
                        hid->group = HID_GROUP_SENSOR_HUB;
        }