Merge branch 'for-4.15/wacom' into for-linus
[sfrench/cifs-2.6.git] / drivers / hid / wacom_sys.c
index e82a696a1d07ca97df04371c00dc5dc95fbafec9..ee71ad9b6cc1693e14a585848ca9ad3289f06454 100644 (file)
@@ -196,6 +196,13 @@ static void wacom_feature_mapping(struct hid_device *hdev,
                kfree(data);
                break;
        }
+
+       if (hdev->vendor == USB_VENDOR_ID_WACOM &&
+           hdev->product == 0x4200 /* Dell Canvas 27 */ &&
+           field->application == HID_UP_MSVENDOR) {
+               wacom->wacom_wac.mode_report = field->report->id;
+               wacom->wacom_wac.mode_value = 2;
+       }
 }
 
 /*
@@ -668,8 +675,10 @@ static struct wacom_hdev_data *wacom_get_hdev_data(struct hid_device *hdev)
 
        /* Try to find an already-probed interface from the same device */
        list_for_each_entry(data, &wacom_udev_list, list) {
-               if (compare_device_paths(hdev, data->dev, '/'))
+               if (compare_device_paths(hdev, data->dev, '/')) {
+                       kref_get(&data->kref);
                        return data;
+               }
        }
 
        /* Fallback to finding devices that appear to be "siblings" */
@@ -766,6 +775,9 @@ static int wacom_led_control(struct wacom *wacom)
        if (!wacom->led.groups)
                return -ENOTSUPP;
 
+       if (wacom->wacom_wac.features.type == REMOTE)
+               return -ENOTSUPP;
+
        if (wacom->wacom_wac.pid) { /* wireless connected */
                report_id = WAC_CMD_WL_LED_CONTROL;
                buf_size = 13;