Re: [PATCH 2/2] HID: multitouch: enable the Surface 3 Type Cover to report multitouch data

From: Benjamin Tissoires
Date: Fri May 13 2016 - 10:49:56 EST


On May 13 2016 or thereabouts, Andy Shevchenko wrote:
> On Thu, 2016-05-12 at 16:12 +0200, Benjamin Tissoires wrote:
> > There is no reasons to filter out keyboard and consumer control
> > collections
> > in hid-multitouch.
> > With the previous hid-input fix, there is now a full support of the
> > Type
> > Cover and we can remove all specific bits from hid-core and hid-
> > microsoft.
> >
> > hid-multitouch will automatically set HID_QUIRK_NO_INIT_REPORTS so we
> > can
> > also remove it from the list of ushbid quirks.
> >
> > Signed-off-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
> > ---
> >
> > Andy, would you mind checking if this series is sufficient to enable
> > the
> > TypeCover of the Surface Book?
>
> Tested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> Noticed little difference that there is no event for the device anymore,
> just /dev/usb/hiddev0. Would it work properly under X?

Not sure what you mean.
I get 3 input nodes:
Microsoft Surface Type Cover Keyboard
Microsoft Surface Type Cover Consumer Control
Microsoft Surface Type Cover Touchpad

Each on this input device is properly assigned an event node and X works
with them.

If there is no /dev/input/eventX created for your cover, then this is
not normal and needs to be investigated.

Cheers,
Benjamin

>
> >
> > Cheers,
> > Benjamin
> >
> > Âdrivers/hid/hid-core.cÂÂÂÂÂÂÂÂÂÂ| 2 --
> > Âdrivers/hid/hid-ids.hÂÂÂÂÂÂÂÂÂÂÂ| 1 -
> > Âdrivers/hid/hid-microsoft.cÂÂÂÂÂ| 2 --
> > Âdrivers/hid/hid-multitouch.cÂÂÂÂ| 4 +++-
> > Âdrivers/hid/usbhid/hid-quirks.c | 1 -
> > Â5 files changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> > index 8ea3a26..f055a68 100644
> > --- a/drivers/hid/hid-core.c
> > +++ b/drivers/hid/hid-core.c
> > @@ -727,7 +727,6 @@ static void hid_scan_collection(struct hid_parser
> > *parser, unsigned type)
> > Â ÂÂÂÂ(hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3 ||
> > Â ÂÂÂÂÂhid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2 ||
> > Â ÂÂÂÂÂhid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP ||
> > - ÂÂÂÂÂhid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 ||
> > Â ÂÂÂÂÂhid->product == USB_DEVICE_ID_MS_POWER_COVER) &&
> > Â ÂÂÂÂhid->group == HID_GROUP_MULTITOUCH)
> > Â hid->group = HID_GROUP_GENERIC;
> > @@ -1976,7 +1975,6 @@ static const struct hid_device_id
> > hid_have_special_driver[] = {
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3) },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2) },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP) },
> > - { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_3) },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_DIGITAL_MEDIA_7K) },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) },
> > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> > index 3eec09a1..99e9852 100644
> > --- a/drivers/hid/hid-ids.h
> > +++ b/drivers/hid/hid-ids.h
> > @@ -703,7 +703,6 @@
> > Â#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_3ÂÂÂÂ0x07dc
> > Â#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2ÂÂ0x07e2
> > Â#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP 0x07dd
> > -#define USB_DEVICE_ID_MS_TYPE_COVER_3ÂÂÂÂ0x07de
> > Â#define USB_DEVICE_ID_MS_POWER_COVERÂÂÂÂÂ0x07da
> > Â
> > Â#define USB_VENDOR_ID_MOJO 0x8282
> > diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
> > index e924d55..cf6920b 100644
> > --- a/drivers/hid/hid-microsoft.c
> > +++ b/drivers/hid/hid-microsoft.c
> > @@ -288,8 +288,6 @@ static const struct hid_device_id ms_devices[] = {
> > Â .driver_data = MS_HIDINPUT },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP),
> > Â .driver_data = MS_HIDINPUT },
> > - { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_3),
> > - .driver_data = MS_HIDINPUT },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_POWER_COVER),
> > Â .driver_data = MS_HIDINPUT },
> > Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_COMFORT_KEYBOARD),
> > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-
> > multitouch.c
> > index c741f5e..ac35731 100644
> > --- a/drivers/hid/hid-multitouch.c
> > +++ b/drivers/hid/hid-multitouch.c
> > @@ -835,7 +835,9 @@ static int mt_input_mapping(struct hid_device
> > *hdev, struct hid_input *hi,
> > Â if (!td->mtclass.export_all_inputs &&
> > Â ÂÂÂÂfield->application != HID_DG_TOUCHSCREEN &&
> > Â ÂÂÂÂfield->application != HID_DG_PEN &&
> > - ÂÂÂÂfield->application != HID_DG_TOUCHPAD)
> > + ÂÂÂÂfield->application != HID_DG_TOUCHPAD &&
> > + ÂÂÂÂfield->application != HID_GD_KEYBOARD &&
> > + ÂÂÂÂfield->application != HID_CP_CONSUMER_CONTROL)
> > Â return -1;
> > Â
> > Â /*
> > diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-
> > quirks.c
> > index b4b8c6a..baf2bad 100644
> > --- a/drivers/hid/usbhid/hid-quirks.c
> > +++ b/drivers/hid/usbhid/hid-quirks.c
> > @@ -98,7 +98,6 @@ static const struct hid_blacklist {
> > Â { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3,
> > HID_QUIRK_NO_INIT_REPORTS },
> > Â { USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2, HID_QUIRK_NO_INIT_REPORTS },
> > Â { USB_VENDOR_ID_MICROSOFT,
> > USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP, HID_QUIRK_NO_INIT_REPORTS },
> > - { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3,
> > HID_QUIRK_NO_INIT_REPORTS },
> > Â { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER,
> > HID_QUIRK_NO_INIT_REPORTS },
> > Â { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL,
> > HID_QUIRK_NO_INIT_REPORTS },
> > Â { USB_VENDOR_ID_NEXIO,
> > USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS },
>
> --
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Intel Finland Oy
>