linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface
@ 2014-05-27  7:29 Reyad Attiyat
  2014-05-28 13:43 ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Reyad Attiyat @ 2014-05-27  7:29 UTC (permalink / raw)
  To: linux-kernel, linux-input, jkosina; +Cc: Reyad Attiyat

Add the Microsoft Surface Pro 2 Type/Touch and default device hardware ID's
Set report quirk for the device in hid-sensor-hub

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
---
 drivers/hid/hid-ids.h        | 3 +++
 drivers/hid/hid-sensor-hub.c | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 34bb220..18e2099 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -633,6 +633,9 @@
 #define USB_DEVICE_ID_MS_PRESENTER_8K_USB	0x0713
 #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K	0x0730
 #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500	0x076c
+#define USB_DEVICE_ID_MS_SURFACE_PRO_2   0x0799
+#define USB_DEVICE_ID_MS_TOUCH_COVER_2   0x07a7
+#define USB_DEVICE_ID_MS_TYPE_COVER_2    0x07a9
 
 #define USB_VENDOR_ID_MOJO		0x8282
 #define USB_DEVICE_ID_RETRO_ADAPTER	0x3201
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index be14b56..eefaaf6 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -711,6 +711,15 @@ static const struct hid_device_id sensor_hub_devices[] = {
 	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_TEXAS_INSTRUMENTS,
 			USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA),
 			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
+	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
+			USB_DEVICE_ID_MS_SURFACE_PRO_2),
+			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
+	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
+			USB_DEVICE_ID_MS_TOUCH_COVER_2),
+			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
+	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
+			USB_DEVICE_ID_MS_TYPE_COVER_2),
+			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
 	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, HID_ANY_ID,
 		     HID_ANY_ID) },
 	{ }
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface
  2014-05-27  7:29 [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface Reyad Attiyat
@ 2014-05-28 13:43 ` Jiri Kosina
  2014-05-28 13:53   ` Benjamin Tissoires
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2014-05-28 13:43 UTC (permalink / raw)
  To: Reyad Attiyat; +Cc: linux-kernel, linux-input, Benjamin Tissoires

On Tue, 27 May 2014, Reyad Attiyat wrote:

> Add the Microsoft Surface Pro 2 Type/Touch and default device hardware ID's
> Set report quirk for the device in hid-sensor-hub
> 
> Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
> ---
>  drivers/hid/hid-ids.h        | 3 +++
>  drivers/hid/hid-sensor-hub.c | 9 +++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 34bb220..18e2099 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -633,6 +633,9 @@
>  #define USB_DEVICE_ID_MS_PRESENTER_8K_USB	0x0713
>  #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K	0x0730
>  #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500	0x076c
> +#define USB_DEVICE_ID_MS_SURFACE_PRO_2   0x0799
> +#define USB_DEVICE_ID_MS_TOUCH_COVER_2   0x07a7
> +#define USB_DEVICE_ID_MS_TYPE_COVER_2    0x07a9
>  
>  #define USB_VENDOR_ID_MOJO		0x8282
>  #define USB_DEVICE_ID_RETRO_ADAPTER	0x3201
> diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
> index be14b56..eefaaf6 100644
> --- a/drivers/hid/hid-sensor-hub.c
> +++ b/drivers/hid/hid-sensor-hub.c
> @@ -711,6 +711,15 @@ static const struct hid_device_id sensor_hub_devices[] = {
>  	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_TEXAS_INSTRUMENTS,
>  			USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA),
>  			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> +			USB_DEVICE_ID_MS_SURFACE_PRO_2),
> +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> +			USB_DEVICE_ID_MS_TOUCH_COVER_2),
> +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> +			USB_DEVICE_ID_MS_TYPE_COVER_2),
> +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
>  	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, HID_ANY_ID,
>  		     HID_ANY_ID) },
>  	{ }

[ Benjamin added to CC]

How does this combine with f3b0cbce01 and e24d0d399b2f in Linus' tree?

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface
  2014-05-28 13:43 ` Jiri Kosina
@ 2014-05-28 13:53   ` Benjamin Tissoires
  2014-05-28 14:29     ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Tissoires @ 2014-05-28 13:53 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Reyad Attiyat, linux-kernel, linux-input

On May 28 2014 or thereabouts, Jiri Kosina wrote:
> On Tue, 27 May 2014, Reyad Attiyat wrote:
> 
> > Add the Microsoft Surface Pro 2 Type/Touch and default device hardware ID's
> > Set report quirk for the device in hid-sensor-hub
> > 
> > Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
> > ---
> >  drivers/hid/hid-ids.h        | 3 +++
> >  drivers/hid/hid-sensor-hub.c | 9 +++++++++
> >  2 files changed, 12 insertions(+)
> > 
> > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> > index 34bb220..18e2099 100644
> > --- a/drivers/hid/hid-ids.h
> > +++ b/drivers/hid/hid-ids.h
> > @@ -633,6 +633,9 @@
> >  #define USB_DEVICE_ID_MS_PRESENTER_8K_USB	0x0713
> >  #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K	0x0730
> >  #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500	0x076c
> > +#define USB_DEVICE_ID_MS_SURFACE_PRO_2   0x0799
> > +#define USB_DEVICE_ID_MS_TOUCH_COVER_2   0x07a7
> > +#define USB_DEVICE_ID_MS_TYPE_COVER_2    0x07a9
> >  
> >  #define USB_VENDOR_ID_MOJO		0x8282
> >  #define USB_DEVICE_ID_RETRO_ADAPTER	0x3201
> > diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
> > index be14b56..eefaaf6 100644
> > --- a/drivers/hid/hid-sensor-hub.c
> > +++ b/drivers/hid/hid-sensor-hub.c
> > @@ -711,6 +711,15 @@ static const struct hid_device_id sensor_hub_devices[] = {
> >  	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_TEXAS_INSTRUMENTS,
> >  			USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA),
> >  			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> > +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> > +			USB_DEVICE_ID_MS_SURFACE_PRO_2),
> > +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> > +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> > +			USB_DEVICE_ID_MS_TOUCH_COVER_2),
> > +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> > +	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, USB_VENDOR_ID_MICROSOFT,
> > +			USB_DEVICE_ID_MS_TYPE_COVER_2),
> > +			.driver_data = HID_SENSOR_HUB_ENUM_QUIRK},
> >  	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, HID_ANY_ID,
> >  		     HID_ANY_ID) },
> >  	{ }
> 
> [ Benjamin added to CC]
> 
> How does this combine with f3b0cbce01 and e24d0d399b2f in Linus' tree?

I guess this should be fine:
f3b0cbce01 has no more impact (there is no USB_DEVICE_ID_MS_*_2
anymore)

e24d0d399b2f will properly add the HID_GROUP_SENSOR_HUB to the sensors
if the report descriptor is properly set.

Given that the group SENSOR_HUB will be set, no other hid driver will
pick them, so this patch just adds the HID_SENSOR_HUB_ENUM_QUIRK to the
actual sensors in the surface 2.

So:

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

Cheers,
Benjamin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface
  2014-05-28 13:53   ` Benjamin Tissoires
@ 2014-05-28 14:29     ` Jiri Kosina
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2014-05-28 14:29 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: Reyad Attiyat, linux-kernel, linux-input

On Wed, 28 May 2014, Benjamin Tissoires wrote:

> I guess this should be fine:
> f3b0cbce01 has no more impact (there is no USB_DEVICE_ID_MS_*_2
> anymore)
> 
> e24d0d399b2f will properly add the HID_GROUP_SENSOR_HUB to the sensors
> if the report descriptor is properly set.
> 
> Given that the group SENSOR_HUB will be set, no other hid driver will
> pick them, so this patch just adds the HID_SENSOR_HUB_ENUM_QUIRK to the
> actual sensors in the surface 2.
> 
> So:
> 
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-28 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27  7:29 [PATCH] HID: hid-sensor-hub: Set report quirk for Microsoft Surface Reyad Attiyat
2014-05-28 13:43 ` Jiri Kosina
2014-05-28 13:53   ` Benjamin Tissoires
2014-05-28 14:29     ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).