diff options
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 3 | ||||
-rw-r--r-- | include/linux/hid.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 1d3b8a394d46..1dc341a04d04 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -972,6 +972,9 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
972 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); | 972 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); |
973 | hid->product = le16_to_cpu(dev->descriptor.idProduct); | 973 | hid->product = le16_to_cpu(dev->descriptor.idProduct); |
974 | hid->name[0] = 0; | 974 | hid->name[0] = 0; |
975 | if (intf->cur_altsetting->desc.bInterfaceProtocol == | ||
976 | USB_INTERFACE_PROTOCOL_MOUSE) | ||
977 | hid->type = HID_TYPE_USBMOUSE; | ||
975 | 978 | ||
976 | if (dev->manufacturer) | 979 | if (dev->manufacturer) |
977 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); | 980 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index f13bca2dd53b..5355ca4b939e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -417,6 +417,11 @@ struct hid_input { | |||
417 | struct input_dev *input; | 417 | struct input_dev *input; |
418 | }; | 418 | }; |
419 | 419 | ||
420 | enum hid_type { | ||
421 | HID_TYPE_OTHER = 0, | ||
422 | HID_TYPE_USBMOUSE | ||
423 | }; | ||
424 | |||
420 | struct hid_driver; | 425 | struct hid_driver; |
421 | struct hid_ll_driver; | 426 | struct hid_ll_driver; |
422 | 427 | ||
@@ -431,6 +436,7 @@ struct hid_device { /* device report descriptor */ | |||
431 | __u32 vendor; /* Vendor ID */ | 436 | __u32 vendor; /* Vendor ID */ |
432 | __u32 product; /* Product ID */ | 437 | __u32 product; /* Product ID */ |
433 | __u32 version; /* HID version */ | 438 | __u32 version; /* HID version */ |
439 | enum hid_type type; /* device type (mouse, kbd, ...) */ | ||
434 | unsigned country; /* HID country */ | 440 | unsigned country; /* HID country */ |
435 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | 441 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; |
436 | 442 | ||