From f7dd766a581edd25e38310380db63779fcfb6d46 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 22 Oct 2008 14:45:11 +0200 Subject: [PATCH] --- yaml --- r: 117852 b: refs/heads/master c: a73a63701f8f23e70674b3c5e367a0a726c18468 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/hid/usbhid/hid-core.c | 3 +++ trunk/include/linux/hid.h | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5d7ed24a2ab1..68b04fe2a242 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac2d98998c32fcdc8d8919b7a4536a7945fd0422 +refs/heads/master: a73a63701f8f23e70674b3c5e367a0a726c18468 diff --git a/trunk/drivers/hid/usbhid/hid-core.c b/trunk/drivers/hid/usbhid/hid-core.c index 1d3b8a394d46..1dc341a04d04 100644 --- a/trunk/drivers/hid/usbhid/hid-core.c +++ b/trunk/drivers/hid/usbhid/hid-core.c @@ -972,6 +972,9 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) hid->vendor = le16_to_cpu(dev->descriptor.idVendor); hid->product = le16_to_cpu(dev->descriptor.idProduct); hid->name[0] = 0; + if (intf->cur_altsetting->desc.bInterfaceProtocol == + USB_INTERFACE_PROTOCOL_MOUSE) + hid->type = HID_TYPE_USBMOUSE; if (dev->manufacturer) strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); diff --git a/trunk/include/linux/hid.h b/trunk/include/linux/hid.h index f13bca2dd53b..5355ca4b939e 100644 --- a/trunk/include/linux/hid.h +++ b/trunk/include/linux/hid.h @@ -417,6 +417,11 @@ struct hid_input { struct input_dev *input; }; +enum hid_type { + HID_TYPE_OTHER = 0, + HID_TYPE_USBMOUSE +}; + struct hid_driver; struct hid_ll_driver; @@ -431,6 +436,7 @@ struct hid_device { /* device report descriptor */ __u32 vendor; /* Vendor ID */ __u32 product; /* Product ID */ __u32 version; /* HID version */ + enum hid_type type; /* device type (mouse, kbd, ...) */ unsigned country; /* HID country */ struct hid_report_enum report_enum[HID_REPORT_TYPES];