]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/hid/hid-core.c
HID: sensor-hub: Restore fixup for Lenovo ThinkPad Helix 2 sensor hub report
[mirror_ubuntu-bionic-kernel.git] / drivers / hid / hid-core.c
index 0c3f608131cff48fdbec637da27135d970534807..bf190f635d2ca7154bca73ce403dd229052b71e8 100644 (file)
@@ -1390,7 +1390,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
         * of implement() working on 8 byte chunks
         */
 
-       int len = hid_report_len(report) + 7;
+       u32 len = hid_report_len(report) + 7;
 
        return kmalloc(len, flags);
 }
@@ -1455,7 +1455,7 @@ void __hid_request(struct hid_device *hid, struct hid_report *report,
 {
        char *buf;
        int ret;
-       int len;
+       u32 len;
 
        buf = hid_alloc_report_buf(report, GFP_KERNEL);
        if (!buf)
@@ -1481,14 +1481,14 @@ out:
 }
 EXPORT_SYMBOL_GPL(__hid_request);
 
-int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
+int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
                int interrupt)
 {
        struct hid_report_enum *report_enum = hid->report_enum + type;
        struct hid_report *report;
        struct hid_driver *hdrv;
        unsigned int a;
-       int rsize, csize = size;
+       u32 rsize, csize = size;
        u8 *cdata = data;
        int ret = 0;
 
@@ -1546,7 +1546,7 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event);
  *
  * This is data entry for lower layers.
  */
-int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt)
+int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int interrupt)
 {
        struct hid_report_enum *report_enum;
        struct hid_driver *hdrv;
@@ -2643,7 +2643,6 @@ static const struct hid_device_id hid_ignore_list[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
        { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0400) },
-       { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0401) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
@@ -2722,6 +2721,9 @@ static const struct hid_device_id hid_ignore_list[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTIME) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYTEMPERATURE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MICROCASSYPH) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERANALYSERCASSY) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CONVERTERCONTROLLERCASSY) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETESTCASSY) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) },
@@ -2913,6 +2915,17 @@ bool hid_ignore(struct hid_device *hdev)
                        strncmp(hdev->name, "www.masterkit.ru MA901", 22) == 0)
                        return true;
                break;
+       case USB_VENDOR_ID_ELAN:
+               /*
+                * Many Elan devices have a product id of 0x0401 and are handled
+                * by the elan_i2c input driver. But the ACPI HID ELAN0800 dev
+                * is not (and cannot be) handled by that driver ->
+                * Ignore all 0x0401 devs except for the ELAN0800 dev.
+                */
+               if (hdev->product == 0x0401 &&
+                   strncmp(hdev->name, "ELAN0800", 8) != 0)
+                       return true;
+               break;
        }
 
        if (hdev->type == HID_TYPE_USBMOUSE &&