]> Git Repo - linux.git/blobdiff - drivers/hid/hid-input.c
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / drivers / hid / hid-input.c
index a481eaf39e887bad41d89bf251c0dc4a8f2a2096..d6fab579848743555c53534ad933419ad69318a9 100644 (file)
@@ -325,6 +325,9 @@ static const struct hid_device_id hid_battery_quirks[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM,
                USB_DEVICE_ID_ELECOM_BM084),
          HID_BATTERY_QUIRK_IGNORE },
+       { HID_USB_DEVICE(USB_VENDOR_ID_SYMBOL,
+               USB_DEVICE_ID_SYMBOL_SCANNER_3),
+         HID_BATTERY_QUIRK_IGNORE },
        {}
 };
 
@@ -758,6 +761,11 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                break;
 
        case HID_UP_DIGITIZER:
+               if ((field->application & 0xff) == 0x01) /* Digitizer */
+                       __set_bit(INPUT_PROP_POINTER, input->propbit);
+               else if ((field->application & 0xff) == 0x02) /* Pen */
+                       __set_bit(INPUT_PROP_DIRECT, input->propbit);
+
                switch (usage->hid & 0xff) {
                case 0x00: /* Undefined */
                        goto ignore;
@@ -1516,6 +1524,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
        struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL);
        struct input_dev *input_dev = input_allocate_device();
        const char *suffix = NULL;
+       size_t suffix_len, name_len;
 
        if (!hidinput || !input_dev)
                goto fail;
@@ -1559,10 +1568,15 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid,
        }
 
        if (suffix) {
-               hidinput->name = kasprintf(GFP_KERNEL, "%s %s",
-                                          hid->name, suffix);
-               if (!hidinput->name)
-                       goto fail;
+               name_len = strlen(hid->name);
+               suffix_len = strlen(suffix);
+               if ((name_len < suffix_len) ||
+                   strcmp(hid->name + name_len - suffix_len, suffix)) {
+                       hidinput->name = kasprintf(GFP_KERNEL, "%s %s",
+                                                  hid->name, suffix);
+                       if (!hidinput->name)
+                               goto fail;
+               }
        }
 
        input_set_drvdata(input_dev, hid);
This page took 0.033378 seconds and 4 git commands to generate.