aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 12:23:23 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 12:23:23 -0500
commit0bf98542a07ee1341830dcc4be63df85645f76b9 (patch)
tree9945a92ea183d5d5c2989f5f12bc56d27920f3d2 /drivers/usb
parentb4a2c87dada12010239b4d5f8f9bc0eb964a614f (diff)
parentd8c8a393166d6283003fb111d0b4a40931c0eda4 (diff)
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
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/input/Kconfig2
-rw-r--r--drivers/usb/input/hid-core.c40
-rw-r--r--drivers/usb/input/hid-ff.c5
-rw-r--r--drivers/usb/input/hiddev.c2
-rw-r--r--drivers/usb/input/usbhid.h3
5 files changed, 32 insertions, 20 deletions
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
index 258a5d09d3dc..c7d887540d8d 100644
--- a/drivers/usb/input/Kconfig
+++ b/drivers/usb/input/Kconfig
@@ -7,7 +7,7 @@ comment "USB Input Devices"
7config USB_HID 7config USB_HID
8 tristate "USB Human Interface Device (full HID) support" 8 tristate "USB Human Interface Device (full HID) support"
9 default y 9 default y
10 depends on USB 10 depends on USB && INPUT
11 select HID 11 select HID
12 ---help--- 12 ---help---
13 Say Y here if you want full HID support to connect USB keyboards, 13 Say Y here if you want full HID support to connect USB keyboards,
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 89fa6885709b..6e739efee6f7 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -106,18 +106,18 @@ static void hid_reset(struct work_struct *work)
106 106
107 if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { 107 if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) {
108 dev_dbg(&usbhid->intf->dev, "clear halt\n"); 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 clear_bit(HID_CLEAR_HALT, &usbhid->iofl); 110 clear_bit(HID_CLEAR_HALT, &usbhid->iofl);
111 hid_start_in(hid); 111 hid_start_in(hid);
112 } 112 }
113 113
114 else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { 114 else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) {
115 dev_dbg(&usbhid->intf->dev, "resetting device\n"); 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 if (rc_lock >= 0) { 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 if (rc_lock) 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 clear_bit(HID_RESET_PENDING, &usbhid->iofl); 122 clear_bit(HID_RESET_PENDING, &usbhid->iofl);
123 } 123 }
@@ -129,8 +129,8 @@ static void hid_reset(struct work_struct *work)
129 break; 129 break;
130 default: 130 default:
131 err("can't reset device, %s-%s/input%d, status %d", 131 err("can't reset device, %s-%s/input%d, status %d",
132 to_usb_device(hid->dev)->bus->bus_name, 132 hid_to_usb_dev(hid)->bus->bus_name,
133 to_usb_device(hid->dev)->devpath, 133 hid_to_usb_dev(hid)->devpath,
134 usbhid->ifnum, rc); 134 usbhid->ifnum, rc);
135 /* FALLTHROUGH */ 135 /* FALLTHROUGH */
136 case -EHOSTUNREACH: 136 case -EHOSTUNREACH:
@@ -217,8 +217,8 @@ static void hid_irq_in(struct urb *urb)
217 clear_bit(HID_IN_RUNNING, &usbhid->iofl); 217 clear_bit(HID_IN_RUNNING, &usbhid->iofl);
218 if (status != -EPERM) { 218 if (status != -EPERM) {
219 err("can't resubmit intr, %s-%s/input%d, status %d", 219 err("can't resubmit intr, %s-%s/input%d, status %d",
220 to_usb_device(hid->dev)->bus->bus_name, 220 hid_to_usb_dev(hid)->bus->bus_name,
221 to_usb_device(hid->dev)->devpath, 221 hid_to_usb_dev(hid)->devpath,
222 usbhid->ifnum, status); 222 usbhid->ifnum, status);
223 hid_io_error(hid); 223 hid_io_error(hid);
224 } 224 }
@@ -251,7 +251,7 @@ static int hid_submit_out(struct hid_device *hid)
251 251
252 hid_output_report(report, usbhid->outbuf); 252 hid_output_report(report, usbhid->outbuf);
253 usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); 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 dbg("submitting out urb"); 256 dbg("submitting out urb");
257 257
@@ -276,13 +276,13 @@ static int hid_submit_ctrl(struct hid_device *hid)
276 len = ((report->size - 1) >> 3) + 1 + (report->id > 0); 276 len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
277 if (dir == USB_DIR_OUT) { 277 if (dir == USB_DIR_OUT) {
278 hid_output_report(report, usbhid->ctrlbuf); 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 usbhid->urbctrl->transfer_buffer_length = len; 280 usbhid->urbctrl->transfer_buffer_length = len;
281 } else { 281 } else {
282 int maxpacket, padlen; 282 int maxpacket, padlen;
283 283
284 usbhid->urbctrl->pipe = usb_rcvctrlpipe(to_usb_device(hid->dev), 0); 284 usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0);
285 maxpacket = usb_maxpacket(to_usb_device(hid->dev), usbhid->urbctrl->pipe, 0); 285 maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0);
286 if (maxpacket > 0) { 286 if (maxpacket > 0) {
287 padlen = (len + maxpacket - 1) / maxpacket; 287 padlen = (len + maxpacket - 1) / maxpacket;
288 padlen *= maxpacket; 288 padlen *= maxpacket;
@@ -292,7 +292,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
292 padlen = 0; 292 padlen = 0;
293 usbhid->urbctrl->transfer_buffer_length = padlen; 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 usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; 297 usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir;
298 usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; 298 usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT;
@@ -582,6 +582,8 @@ void usbhid_init_reports(struct hid_device *hid)
582} 582}
583 583
584#define USB_VENDOR_ID_GTCO 0x078c 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#define USB_DEVICE_ID_GTCO_90 0x0090 587#define USB_DEVICE_ID_GTCO_90 0x0090
586#define USB_DEVICE_ID_GTCO_100 0x0100 588#define USB_DEVICE_ID_GTCO_100 0x0100
587#define USB_DEVICE_ID_GTCO_101 0x0101 589#define USB_DEVICE_ID_GTCO_101 0x0101
@@ -627,6 +629,9 @@ void usbhid_init_reports(struct hid_device *hid)
627#define USB_DEVICE_ID_GTCO_1004 0x1004 629#define USB_DEVICE_ID_GTCO_1004 0x1004
628#define USB_DEVICE_ID_GTCO_1005 0x1005 630#define USB_DEVICE_ID_GTCO_1005 0x1005
629#define USB_DEVICE_ID_GTCO_1006 0x1006 631#define USB_DEVICE_ID_GTCO_1006 0x1006
632#define USB_DEVICE_ID_GTCO_10 0x0010
633#define USB_DEVICE_ID_GTCO_8 0x0008
634#define USB_DEVICE_ID_GTCO_d 0x000d
630 635
631#define USB_VENDOR_ID_WACOM 0x056a 636#define USB_VENDOR_ID_WACOM 0x056a
632 637
@@ -875,6 +880,9 @@ static const struct hid_blacklist {
875 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, 880 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE },
876 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, 881 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE },
877 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, 882 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE },
883 { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE },
884 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE },
885 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE },
878 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 886 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
879 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, 887 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
880 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, 888 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
@@ -951,7 +959,7 @@ static const struct hid_blacklist {
951 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, 959 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
952 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, 960 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN },
953 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN }, 961 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN },
954 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN }, 962 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD},
955 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN }, 963 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN },
956 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, 964 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN },
957 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN }, 965 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN },
@@ -1187,7 +1195,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1187 1195
1188 hid->version = le16_to_cpu(hdesc->bcdHID); 1196 hid->version = le16_to_cpu(hdesc->bcdHID);
1189 hid->country = hdesc->bCountryCode; 1197 hid->country = hdesc->bCountryCode;
1190 hid->dev = &dev->dev; 1198 hid->dev = &intf->dev;
1191 usbhid->intf = intf; 1199 usbhid->intf = intf;
1192 usbhid->ifnum = interface->desc.bInterfaceNumber; 1200 usbhid->ifnum = interface->desc.bInterfaceNumber;
1193 1201
@@ -1282,7 +1290,7 @@ static void hid_disconnect(struct usb_interface *intf)
1282 usb_free_urb(usbhid->urbctrl); 1290 usb_free_urb(usbhid->urbctrl);
1283 usb_free_urb(usbhid->urbout); 1291 usb_free_urb(usbhid->urbout);
1284 1292
1285 hid_free_buffers(to_usb_device(hid->dev), hid); 1293 hid_free_buffers(hid_to_usb_dev(hid), hid);
1286 hid_free_device(hid); 1294 hid_free_device(hid);
1287} 1295}
1288 1296
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c
index f8f660ee3fac..59ed65e7a621 100644
--- a/drivers/usb/input/hid-ff.c
+++ b/drivers/usb/input/hid-ff.c
@@ -33,6 +33,7 @@
33#include <linux/usb.h> 33#include <linux/usb.h>
34 34
35#include <linux/hid.h> 35#include <linux/hid.h>
36#include "usbhid.h"
36 37
37/* 38/*
38 * This table contains pointers to initializers. To add support for new 39 * This table contains pointers to initializers. To add support for new
@@ -70,8 +71,8 @@ static struct hid_ff_initializer inits[] = {
70int hid_ff_init(struct hid_device* hid) 71int hid_ff_init(struct hid_device* hid)
71{ 72{
72 struct hid_ff_initializer *init; 73 struct hid_ff_initializer *init;
73 int vendor = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idVendor); 74 int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor);
74 int product = le16_to_cpu(to_usb_device(hid->dev)->descriptor.idProduct); 75 int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct);
75 76
76 for (init = inits; init->idVendor; init++) 77 for (init = inits; init->idVendor; init++)
77 if (init->idVendor == vendor && init->idProduct == product) 78 if (init->idVendor == vendor && init->idProduct == product)
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 114d6c9f64b1..a8b3d66cd498 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -384,7 +384,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
384 struct hiddev_list *list = file->private_data; 384 struct hiddev_list *list = file->private_data;
385 struct hiddev *hiddev = list->hiddev; 385 struct hiddev *hiddev = list->hiddev;
386 struct hid_device *hid = hiddev->hid; 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 struct hiddev_collection_info cinfo; 388 struct hiddev_collection_info cinfo;
389 struct hiddev_report_info rinfo; 389 struct hiddev_report_info rinfo;
390 struct hiddev_field_info finfo; 390 struct hiddev_field_info finfo;
diff --git a/drivers/usb/input/usbhid.h b/drivers/usb/input/usbhid.h
index 830107e5251f..0023f96d4294 100644
--- a/drivers/usb/input/usbhid.h
+++ b/drivers/usb/input/usbhid.h
@@ -80,5 +80,8 @@ struct usbhid_device {
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#endif 86#endif
84 87