diff mbox

HID: make sensor autodetection independent of underlying bus

Message ID 1361265753-17541-1-git-send-email-mika.westerberg@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Mika Westerberg Feb. 19, 2013, 9:22 a.m. UTC
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 <holler@ahsoftware.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/hid/hid-core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Benjamin Tissoires Feb. 21, 2013, 10:42 a.m. UTC | #1
On Tue, Feb 19, 2013 at 10:22 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> 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 <holler@ahsoftware.de>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Reviewed-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

> ---
>  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;
>         }
>
> --
> 1.7.10.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina Feb. 25, 2013, 12:43 p.m. UTC | #2
On Thu, 21 Feb 2013, Benjamin Tissoires wrote:

> > 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 <holler@ahsoftware.de>
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Reviewed-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Applied.
diff mbox

Patch

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;
 	}