Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
hid-core.c: Adds GTCO CalComp Interwrite IPanel PIDs to blacklist
HID: put usb_interface instead of usb_device into hid->dev to fix udevinfo breakage
HID: add missing RX, RZ and RY enum values to hid-debug output
HID: hid/hid-input.c doesn't need to include linux/usb/input.h
HID: compilation fix when DEBUG_DATA is defined
HID: proper LED-mapping for SpaceNavigator
HID: update MAINTAINERS entry for USB-HID
HID: GEYSER4_ISO needs quirk
HID: fix some ARM builds due to HID brokenness - make USB_HID depend on INPUT

+59 -31
+2 -3
MAINTAINERS
··· 3334 3334 S: Maintained 3335 3335 3336 3336 USB HID/HIDBP DRIVERS 3337 - P: Vojtech Pavlik 3338 - M: vojtech@suse.cz 3339 - L: linux-usb-users@lists.sourceforge.net 3337 + P: Jiri Kosina 3338 + M: jkosina@suse.cz 3340 3339 L: linux-usb-devel@lists.sourceforge.net 3341 3340 S: Maintained 3342 3341
+5 -1
drivers/hid/hid-core.c
··· 880 880 unsigned size = field->report_size; 881 881 unsigned n; 882 882 883 + /* make sure the unused bits in the last byte are zeros */ 884 + if (count > 0 && size > 0) 885 + data[(count*size-1)/8] = 0; 886 + 883 887 for (n = 0; n < count; n++) { 884 888 if (field->logical_minimum < 0) /* signed values */ 885 889 implement(data, offset + n * size, size, s32ton(field->value[n], size)); ··· 951 947 } 952 948 953 949 #ifdef DEBUG_DATA 954 - printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", len, report_enum->numbered ? "" : "un"); 950 + printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un"); 955 951 #endif 956 952 957 953 n = 0; /* Normally report number is 0 */
+16 -4
drivers/hid/hid-input.c
··· 30 30 #include <linux/module.h> 31 31 #include <linux/slab.h> 32 32 #include <linux/kernel.h> 33 - #include <linux/usb/input.h> 34 33 35 34 #undef DEBUG 36 35 ··· 363 364 break; 364 365 365 366 case HID_UP_LED: 366 - if (((usage->hid - 1) & 0xffff) >= LED_MAX) 367 - goto ignore; 368 - map_led((usage->hid - 1) & 0xffff); 367 + 368 + switch (usage->hid & 0xffff) { /* HID-Value: */ 369 + case 0x01: map_led (LED_NUML); break; /* "Num Lock" */ 370 + case 0x02: map_led (LED_CAPSL); break; /* "Caps Lock" */ 371 + case 0x03: map_led (LED_SCROLLL); break; /* "Scroll Lock" */ 372 + case 0x04: map_led (LED_COMPOSE); break; /* "Compose" */ 373 + case 0x05: map_led (LED_KANA); break; /* "Kana" */ 374 + case 0x27: map_led (LED_SLEEP); break; /* "Stand-By" */ 375 + case 0x4c: map_led (LED_SUSPEND); break; /* "System Suspend" */ 376 + case 0x09: map_led (LED_MUTE); break; /* "Mute" */ 377 + case 0x4b: map_led (LED_MISC); break; /* "Generic Indicator" */ 378 + case 0x19: map_led (LED_MAIL); break; /* "Message Waiting" */ 379 + case 0x4d: map_led (LED_CHARGING); break; /* "External Power Connected" */ 380 + 381 + default: goto ignore; 382 + } 369 383 break; 370 384 371 385 case HID_UP_DIGITIZER:
+1 -1
drivers/usb/input/Kconfig
··· 7 7 config USB_HID 8 8 tristate "USB Human Interface Device (full HID) support" 9 9 default y 10 - depends on USB 10 + depends on USB && INPUT 11 11 select HID 12 12 ---help--- 13 13 Say Y here if you want full HID support to connect USB keyboards,
+24 -16
drivers/usb/input/hid-core.c
··· 106 106 107 107 if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { 108 108 dev_dbg(&usbhid->intf->dev, "clear halt\n"); 109 - rc = usb_clear_halt(to_usb_device(hid->dev), usbhid->urbin->pipe); 109 + rc = usb_clear_halt(hid_to_usb_dev(hid), usbhid->urbin->pipe); 110 110 clear_bit(HID_CLEAR_HALT, &usbhid->iofl); 111 111 hid_start_in(hid); 112 112 } 113 113 114 114 else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { 115 115 dev_dbg(&usbhid->intf->dev, "resetting device\n"); 116 - rc = rc_lock = usb_lock_device_for_reset(to_usb_device(hid->dev), usbhid->intf); 116 + rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf); 117 117 if (rc_lock >= 0) { 118 - rc = usb_reset_composite_device(to_usb_device(hid->dev), usbhid->intf); 118 + rc = usb_reset_composite_device(hid_to_usb_dev(hid), usbhid->intf); 119 119 if (rc_lock) 120 - usb_unlock_device(to_usb_device(hid->dev)); 120 + usb_unlock_device(hid_to_usb_dev(hid)); 121 121 } 122 122 clear_bit(HID_RESET_PENDING, &usbhid->iofl); 123 123 } ··· 129 129 break; 130 130 default: 131 131 err("can't reset device, %s-%s/input%d, status %d", 132 - to_usb_device(hid->dev)->bus->bus_name, 133 - to_usb_device(hid->dev)->devpath, 132 + hid_to_usb_dev(hid)->bus->bus_name, 133 + hid_to_usb_dev(hid)->devpath, 134 134 usbhid->ifnum, rc); 135 135 /* FALLTHROUGH */ 136 136 case -EHOSTUNREACH: ··· 217 217 clear_bit(HID_IN_RUNNING, &usbhid->iofl); 218 218 if (status != -EPERM) { 219 219 err("can't resubmit intr, %s-%s/input%d, status %d", 220 - to_usb_device(hid->dev)->bus->bus_name, 221 - to_usb_device(hid->dev)->devpath, 220 + hid_to_usb_dev(hid)->bus->bus_name, 221 + hid_to_usb_dev(hid)->devpath, 222 222 usbhid->ifnum, status); 223 223 hid_io_error(hid); 224 224 } ··· 251 251 252 252 hid_output_report(report, usbhid->outbuf); 253 253 usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); 254 - usbhid->urbout->dev = to_usb_device(hid->dev); 254 + usbhid->urbout->dev = hid_to_usb_dev(hid); 255 255 256 256 dbg("submitting out urb"); 257 257 ··· 276 276 len = ((report->size - 1) >> 3) + 1 + (report->id > 0); 277 277 if (dir == USB_DIR_OUT) { 278 278 hid_output_report(report, usbhid->ctrlbuf); 279 - usbhid->urbctrl->pipe = usb_sndctrlpipe(to_usb_device(hid->dev), 0); 279 + usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0); 280 280 usbhid->urbctrl->transfer_buffer_length = len; 281 281 } else { 282 282 int maxpacket, padlen; 283 283 284 - usbhid->urbctrl->pipe = usb_rcvctrlpipe(to_usb_device(hid->dev), 0); 285 - maxpacket = usb_maxpacket(to_usb_device(hid->dev), usbhid->urbctrl->pipe, 0); 284 + usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0); 285 + maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0); 286 286 if (maxpacket > 0) { 287 287 padlen = (len + maxpacket - 1) / maxpacket; 288 288 padlen *= maxpacket; ··· 292 292 padlen = 0; 293 293 usbhid->urbctrl->transfer_buffer_length = padlen; 294 294 } 295 - usbhid->urbctrl->dev = to_usb_device(hid->dev); 295 + usbhid->urbctrl->dev = hid_to_usb_dev(hid); 296 296 297 297 usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; 298 298 usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; ··· 582 582 } 583 583 584 584 #define USB_VENDOR_ID_GTCO 0x078c 585 + #define USB_VENDOR_ID_GTCO_IPANEL_1 0x08ca 586 + #define USB_VENDOR_ID_GTCO_IPANEL_2 0x5543 585 587 #define USB_DEVICE_ID_GTCO_90 0x0090 586 588 #define USB_DEVICE_ID_GTCO_100 0x0100 587 589 #define USB_DEVICE_ID_GTCO_101 0x0101 ··· 629 627 #define USB_DEVICE_ID_GTCO_1004 0x1004 630 628 #define USB_DEVICE_ID_GTCO_1005 0x1005 631 629 #define USB_DEVICE_ID_GTCO_1006 0x1006 630 + #define USB_DEVICE_ID_GTCO_10 0x0010 631 + #define USB_DEVICE_ID_GTCO_8 0x0008 632 + #define USB_DEVICE_ID_GTCO_d 0x000d 632 633 633 634 #define USB_VENDOR_ID_WACOM 0x056a 634 635 ··· 880 875 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, 881 876 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, 882 877 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, 878 + { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, 879 + { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, 880 + { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, 883 881 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 884 882 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, 885 883 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, ··· 959 951 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, 960 952 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, 961 953 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, 962 - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, 954 + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, 963 955 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, 964 956 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, 965 957 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, ··· 1195 1187 1196 1188 hid->version = le16_to_cpu(hdesc->bcdHID); 1197 1189 hid->country = hdesc->bCountryCode; 1198 - hid->dev = &dev->dev; 1190 + hid->dev = &intf->dev; 1199 1191 usbhid->intf = intf; 1200 1192 usbhid->ifnum = interface->desc.bInterfaceNumber; 1201 1193 ··· 1290 1282 usb_free_urb(usbhid->urbctrl); 1291 1283 usb_free_urb(usbhid->urbout); 1292 1284 1293 - hid_free_buffers(to_usb_device(hid->dev), hid); 1285 + hid_free_buffers(hid_to_usb_dev(hid), hid); 1294 1286 hid_free_device(hid); 1295 1287 } 1296 1288
+3 -2
drivers/usb/input/hid-ff.c
··· 33 33 #include <linux/usb.h> 34 34 35 35 #include <linux/hid.h> 36 + #include "usbhid.h" 36 37 37 38 /* 38 39 * This table contains pointers to initializers. To add support for new ··· 71 70 int hid_ff_init(struct hid_device* hid) 72 71 { 73 72 struct hid_ff_initializer *init; 74 - int vendor = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idVendor); 75 - int product = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idProduct); 73 + int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor); 74 + int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct); 76 75 77 76 for (init = inits; init->idVendor; init++) 78 77 if (init->idVendor == vendor && init->idProduct == product)
+1 -1
drivers/usb/input/hiddev.c
··· 384 384 struct hiddev_list *list = file->private_data; 385 385 struct hiddev *hiddev = list->hiddev; 386 386 struct hid_device *hid = hiddev->hid; 387 - struct usb_device *dev = to_usb_device(hid->dev); 387 + struct usb_device *dev = hid_to_usb_dev(hid); 388 388 struct hiddev_collection_info cinfo; 389 389 struct hiddev_report_info rinfo; 390 390 struct hiddev_field_info finfo;
+3
drivers/usb/input/usbhid.h
··· 80 80 81 81 }; 82 82 83 + #define hid_to_usb_dev(hid_dev) \ 84 + container_of(hid_dev->dev->parent, struct usb_device, dev) 85 + 83 86 #endif 84 87
+4 -3
include/linux/hid-debug.h
··· 700 700 701 701 static char *relatives[REL_MAX + 1] = { 702 702 [REL_X] = "X", [REL_Y] = "Y", 703 - [REL_Z] = "Z", [REL_HWHEEL] = "HWheel", 704 - [REL_DIAL] = "Dial", [REL_WHEEL] = "Wheel", 705 - [REL_MISC] = "Misc", 703 + [REL_Z] = "Z", [REL_RX] = "Rx", 704 + [REL_RY] = "Ry", [REL_RZ] = "Rz", 705 + [REL_HWHEEL] = "HWheel", [REL_DIAL] = "Dial", 706 + [REL_WHEEL] = "Wheel", [REL_MISC] = "Misc", 706 707 }; 707 708 708 709 static char *absolutes[ABS_MAX + 1] = {