wacom_sys.c (f83baa0cb6cfc92ebaf7f9d3a99d7e34f2e77a8a) wacom_sys.c (720ac467204a70308bd687927ed475afb904e11b)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * drivers/input/tablet/wacom_sys.c
4 *
5 * USB Wacom tablet support - system specific code
6 */
7
8/*

--- 712 unchanged lines hidden (view full) ---

721 features->tilt_fuzz = 1;
722
723 /*
724 * The wireless device HID is basic and layout conflicts with
725 * other tablets (monitor and touch interface can look like pen).
726 * Skip the query for this type and modify defaults based on
727 * interface number.
728 */
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * drivers/input/tablet/wacom_sys.c
4 *
5 * USB Wacom tablet support - system specific code
6 */
7
8/*

--- 712 unchanged lines hidden (view full) ---

721 features->tilt_fuzz = 1;
722
723 /*
724 * The wireless device HID is basic and layout conflicts with
725 * other tablets (monitor and touch interface can look like pen).
726 * Skip the query for this type and modify defaults based on
727 * interface number.
728 */
729 if (features->type == WIRELESS) {
729 if (features->type == WIRELESS && intf) {
730 if (intf->cur_altsetting->desc.bInterfaceNumber == 0)
731 features->device_type = WACOM_DEVICETYPE_WL_MONITOR;
732 else
733 features->device_type = WACOM_DEVICETYPE_NONE;
734 return;
735 }
736
737 wacom_parse_hid(hdev, features);

--- 1708 unchanged lines hidden (view full) ---

2446
2447 /*
2448 * Regardless if this is a disconnect or a new tablet,
2449 * remove any existing input and battery devices.
2450 */
2451
2452 wacom_destroy_battery(wacom);
2453
730 if (intf->cur_altsetting->desc.bInterfaceNumber == 0)
731 features->device_type = WACOM_DEVICETYPE_WL_MONITOR;
732 else
733 features->device_type = WACOM_DEVICETYPE_NONE;
734 return;
735 }
736
737 wacom_parse_hid(hdev, features);

--- 1708 unchanged lines hidden (view full) ---

2446
2447 /*
2448 * Regardless if this is a disconnect or a new tablet,
2449 * remove any existing input and battery devices.
2450 */
2451
2452 wacom_destroy_battery(wacom);
2453
2454 if (!usbdev)
2455 return;
2456
2454 /* Stylus interface */
2455 hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
2456 wacom1 = hid_get_drvdata(hdev1);
2457 wacom_wac1 = &(wacom1->wacom_wac);
2458 wacom_release_resources(wacom1);
2459
2460 /* Touch interface */
2461 hdev2 = usb_get_intfdata(usbdev->config->interface[2]);

--- 263 unchanged lines hidden (view full) ---

2725 }
2726
2727 return;
2728}
2729
2730static int wacom_probe(struct hid_device *hdev,
2731 const struct hid_device_id *id)
2732{
2457 /* Stylus interface */
2458 hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
2459 wacom1 = hid_get_drvdata(hdev1);
2460 wacom_wac1 = &(wacom1->wacom_wac);
2461 wacom_release_resources(wacom1);
2462
2463 /* Touch interface */
2464 hdev2 = usb_get_intfdata(usbdev->config->interface[2]);

--- 263 unchanged lines hidden (view full) ---

2728 }
2729
2730 return;
2731}
2732
2733static int wacom_probe(struct hid_device *hdev,
2734 const struct hid_device_id *id)
2735{
2733 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
2734 struct usb_device *dev = interface_to_usbdev(intf);
2735 struct wacom *wacom;
2736 struct wacom_wac *wacom_wac;
2737 struct wacom_features *features;
2738 int error;
2739
2740 if (!id->driver_data)
2741 return -EINVAL;
2742

--- 18 unchanged lines hidden (view full) ---

2761
2762 error = wacom_devm_kfifo_alloc(wacom);
2763 if (error)
2764 return error;
2765
2766 wacom_wac->hid_data.inputmode = -1;
2767 wacom_wac->mode_report = -1;
2768
2736 struct wacom *wacom;
2737 struct wacom_wac *wacom_wac;
2738 struct wacom_features *features;
2739 int error;
2740
2741 if (!id->driver_data)
2742 return -EINVAL;
2743

--- 18 unchanged lines hidden (view full) ---

2762
2763 error = wacom_devm_kfifo_alloc(wacom);
2764 if (error)
2765 return error;
2766
2767 wacom_wac->hid_data.inputmode = -1;
2768 wacom_wac->mode_report = -1;
2769
2769 wacom->usbdev = dev;
2770 wacom->intf = intf;
2770 if (hid_is_usb(hdev)) {
2771 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
2772 struct usb_device *dev = interface_to_usbdev(intf);
2773
2774 wacom->usbdev = dev;
2775 wacom->intf = intf;
2776 }
2777
2771 mutex_init(&wacom->lock);
2772 INIT_DELAYED_WORK(&wacom->init_work, wacom_init_work);
2773 INIT_WORK(&wacom->wireless_work, wacom_wireless_work);
2774 INIT_WORK(&wacom->battery_work, wacom_battery_work);
2775 INIT_WORK(&wacom->remote_work, wacom_remote_work);
2776 INIT_WORK(&wacom->mode_change_work, wacom_mode_change_work);
2777
2778 /* ask for the report descriptor to be loaded by HID */

--- 88 unchanged lines hidden ---
2778 mutex_init(&wacom->lock);
2779 INIT_DELAYED_WORK(&wacom->init_work, wacom_init_work);
2780 INIT_WORK(&wacom->wireless_work, wacom_wireless_work);
2781 INIT_WORK(&wacom->battery_work, wacom_battery_work);
2782 INIT_WORK(&wacom->remote_work, wacom_remote_work);
2783 INIT_WORK(&wacom->mode_change_work, wacom_mode_change_work);
2784
2785 /* ask for the report descriptor to be loaded by HID */

--- 88 unchanged lines hidden ---