Re: [PATCH] HID: multitouch: enable Surface 3 Type Cover Pro to report multitouch data

From: Andy Shevchenko
Date: Thu Jan 19 2017 - 05:40:22 EST


On Thu, 2017-01-19 at 04:55 -0500, Dennis Chen wrote:
> Hi,
>
> This should be the last related patch for the Surface Pro
> TypeÂCovers.

Please, send it via send-email and remove unrelated parts (or split them
to another patch)

>
> Sincerely,
> Dennis Chen
>
> > 8------------------------------------------------------8<
>
> Nearly identical to the previous set of patches related to Microsoft
> Surface Keyboards.
>
> Removes Surface Pro 3 generation TypeCover support from hid-microsoft
> so proper multitouch data can be reported from the touchpad.
>
> Signed-off-by: Dennis Chen <barracks510@xxxxxxxxx>
> ---
> Âdrivers/hid/hid-core.cÂÂÂÂÂÂÂÂÂÂ| 10 ++--------
> Âdrivers/hid/hid-ids.hÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ3 ---
> Âdrivers/hid/hid-microsoft.cÂÂÂÂÂ|ÂÂ6 ------
> Âdrivers/hid/usbhid/hid-quirks.c |ÂÂ7 ++-----
> Â4 files changed, 4 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index d173e7f..52863e7 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -724,10 +724,7 @@ static void hid_scan_collection(struct hid_parser
> *parser, unsigned type)
> Â hid->group = HID_GROUP_SENSOR_HUB;
> Â
> Â if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
> - ÂÂÂÂ(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_POWER_COVER) &&
> + ÂÂÂÂhid->product == USB_DEVICE_ID_MS_POWER_COVER &&
> Â ÂÂÂÂhid->group == HID_GROUP_MULTITOUCH)
> Â hid->group = HID_GROUP_GENERIC;
> Â
> @@ -1982,9 +1979,6 @@ static const struct hid_device_id
> hid_have_special_driver[] = {
> Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) },
> Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
> Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_OFFICE_KB) },
> - { 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_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) },
> @@ -2308,7 +2302,7 @@ __ATTRIBUTE_GROUPS(hid_dev);
> Â
> Âstatic int hid_uevent(struct device *dev, struct kobj_uevent_env
> *env)
> Â{
> - struct hid_device *hdev = to_hid_device(dev);
> + struct hid_device *hdev = to_hid_device(dev);
> Â
> Â if (add_uevent_var(env, "HID_ID=%04X:%08X:%08X",
> Â hdev->bus, hdev->vendor, hdev->product))
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 87486ae..12f00a6 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -722,9 +722,6 @@
> Â#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_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_POWER_COVERÂÂÂÂÂ0x07da
> Â
> Â#define USB_VENDOR_ID_MOJO 0x8282
> diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c
> index d856726..96e7d32 100644
> --- a/drivers/hid/hid-microsoft.c
> +++ b/drivers/hid/hid-microsoft.c
> @@ -274,12 +274,6 @@ static const struct hid_device_id ms_devices[] =
> {
> Â .driver_data = MS_NOGET },
> Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
> Â .driver_data = MS_DUPLICATE_USAGES },
> - { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_TYPE_COVER_PRO_3),
> - .driver_data = MS_HIDINPUT },
> - { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_2),
> - .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_POWER_COVER),
> Â .driver_data = MS_HIDINPUT },
> Â { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT,
> USB_DEVICE_ID_MS_COMFORT_KEYBOARD),
> diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-
> quirks.c
> index f6432c5..80df173 100644
> --- a/drivers/hid/usbhid/hid-quirks.c
> +++ b/drivers/hid/usbhid/hid-quirks.c
> @@ -102,9 +102,6 @@ static const struct hid_blacklist {
> Â { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2,
> HID_QUIRK_NO_INIT_REPORTS },
> Â { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2,
> HID_QUIRK_NO_INIT_REPORTS },
> Â { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2,
> HID_QUIRK_NO_INIT_REPORTS },
> - { 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_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 },
> @@ -293,7 +290,7 @@ static void usbhid_remove_all_dquirks(void)
> Â
> Â}
> Â
> -/**Â
> +/**
> Â * usbhid_quirks_init: apply USB HID quirks specified at module load
> time
> Â */
> Âint usbhid_quirks_init(char **quirks_param)
> @@ -357,7 +354,7 @@ static const struct hid_blacklist
> *usbhid_exists_squirk(const u16 idVendor,
> Â
> Â if (bl_entry != NULL)
> Â dbg_hid("Found squirk 0x%x for USB HID vendor 0x%hx
> prod 0x%hx\n",
> - bl_entry->quirks, bl_entry-
> >idVendor,Â
> + bl_entry->quirks, bl_entry->idVendor,
> Â bl_entry->idProduct);
> Â return bl_entry;
> Â}

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy