diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-30 20:02:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-30 20:02:08 -0500 |
commit | 4222721ebb50a8640860eeca0caeb63fe1cce935 (patch) | |
tree | d67acdb4315e611fadc64975fd1467b2389d412d | |
parent | 41c57a87183a7c458d86f78966d69d4bf18ea0b7 (diff) | |
parent | 76398f9667e8369023ed5f4847fb59e9da8b6968 (diff) |
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid:
HID: fix pb_fnmode and move it to generic HID
HID: fix hid-input mapping for Firefly Mini Remote Control
USB HID: fix hid_blacklist clash for 0x08ca/0x0010
HID: fix memleaking of collection
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-input.c | 13 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 12 | ||||
-rw-r--r-- | include/linux/hid.h | 1 |
4 files changed, 11 insertions, 16 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b8cf50fcd64d..49f18f5b2514 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -543,6 +543,7 @@ void hid_free_device(struct hid_device *device) | |||
543 | } | 543 | } |
544 | 544 | ||
545 | kfree(device->rdesc); | 545 | kfree(device->rdesc); |
546 | kfree(device->collection); | ||
546 | kfree(device); | 547 | kfree(device); |
547 | } | 548 | } |
548 | EXPORT_SYMBOL_GPL(hid_free_device); | 549 | EXPORT_SYMBOL_GPL(hid_free_device); |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 9cf591a1bda3..c7a6833f6821 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -35,6 +35,11 @@ | |||
35 | 35 | ||
36 | #include <linux/hid.h> | 36 | #include <linux/hid.h> |
37 | 37 | ||
38 | static int hid_pb_fnmode = 1; | ||
39 | module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); | ||
40 | MODULE_PARM_DESC(pb_fnmode, | ||
41 | "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); | ||
42 | |||
38 | #define unk KEY_UNKNOWN | 43 | #define unk KEY_UNKNOWN |
39 | 44 | ||
40 | static const unsigned char hid_keyboard[256] = { | 45 | static const unsigned char hid_keyboard[256] = { |
@@ -154,7 +159,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | |||
154 | return 1; | 159 | return 1; |
155 | } | 160 | } |
156 | 161 | ||
157 | if (hid->pb_fnmode) { | 162 | if (hid_pb_fnmode) { |
158 | int do_translate; | 163 | int do_translate; |
159 | 164 | ||
160 | trans = find_translation(powerbook_fn_keys, usage->code); | 165 | trans = find_translation(powerbook_fn_keys, usage->code); |
@@ -163,8 +168,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, | |||
163 | do_translate = 1; | 168 | do_translate = 1; |
164 | else if (trans->flags & POWERBOOK_FLAG_FKEY) | 169 | else if (trans->flags & POWERBOOK_FLAG_FKEY) |
165 | do_translate = | 170 | do_translate = |
166 | (hid->pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || | 171 | (hid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || |
167 | (hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); | 172 | (hid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); |
168 | else | 173 | else |
169 | do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); | 174 | do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); |
170 | 175 | ||
@@ -431,6 +436,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
431 | case 0x040: map_key_clear(KEY_MENU); break; | 436 | case 0x040: map_key_clear(KEY_MENU); break; |
432 | case 0x045: map_key_clear(KEY_RADIO); break; | 437 | case 0x045: map_key_clear(KEY_RADIO); break; |
433 | 438 | ||
439 | case 0x083: map_key_clear(KEY_LAST); break; | ||
434 | case 0x088: map_key_clear(KEY_PC); break; | 440 | case 0x088: map_key_clear(KEY_PC); break; |
435 | case 0x089: map_key_clear(KEY_TV); break; | 441 | case 0x089: map_key_clear(KEY_TV); break; |
436 | case 0x08a: map_key_clear(KEY_WWW); break; | 442 | case 0x08a: map_key_clear(KEY_WWW); break; |
@@ -448,6 +454,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
448 | case 0x096: map_key_clear(KEY_TAPE); break; | 454 | case 0x096: map_key_clear(KEY_TAPE); break; |
449 | case 0x097: map_key_clear(KEY_TV2); break; | 455 | case 0x097: map_key_clear(KEY_TV2); break; |
450 | case 0x098: map_key_clear(KEY_SAT); break; | 456 | case 0x098: map_key_clear(KEY_SAT); break; |
457 | case 0x09a: map_key_clear(KEY_PVR); break; | ||
451 | 458 | ||
452 | case 0x09c: map_key_clear(KEY_CHANNELUP); break; | 459 | case 0x09c: map_key_clear(KEY_CHANNELUP); break; |
453 | case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; | 460 | case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index ea3636d96e1b..c6c9e72e5fd9 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -56,11 +56,6 @@ static unsigned int hid_mousepoll_interval; | |||
56 | module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); | 56 | module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); |
57 | MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); | 57 | MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); |
58 | 58 | ||
59 | static int usbhid_pb_fnmode = 1; | ||
60 | module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); | ||
61 | MODULE_PARM_DESC(pb_fnmode, | ||
62 | "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); | ||
63 | |||
64 | /* | 59 | /* |
65 | * Input submission and I/O error handler. | 60 | * Input submission and I/O error handler. |
66 | */ | 61 | */ |
@@ -582,7 +577,6 @@ void usbhid_init_reports(struct hid_device *hid) | |||
582 | } | 577 | } |
583 | 578 | ||
584 | #define USB_VENDOR_ID_GTCO 0x078c | 579 | #define USB_VENDOR_ID_GTCO 0x078c |
585 | #define USB_VENDOR_ID_GTCO_IPANEL_1 0x08ca | ||
586 | #define USB_VENDOR_ID_GTCO_IPANEL_2 0x5543 | 580 | #define USB_VENDOR_ID_GTCO_IPANEL_2 0x5543 |
587 | #define USB_DEVICE_ID_GTCO_90 0x0090 | 581 | #define USB_DEVICE_ID_GTCO_90 0x0090 |
588 | #define USB_DEVICE_ID_GTCO_100 0x0100 | 582 | #define USB_DEVICE_ID_GTCO_100 0x0100 |
@@ -629,7 +623,6 @@ void usbhid_init_reports(struct hid_device *hid) | |||
629 | #define USB_DEVICE_ID_GTCO_1004 0x1004 | 623 | #define USB_DEVICE_ID_GTCO_1004 0x1004 |
630 | #define USB_DEVICE_ID_GTCO_1005 0x1005 | 624 | #define USB_DEVICE_ID_GTCO_1005 0x1005 |
631 | #define USB_DEVICE_ID_GTCO_1006 0x1006 | 625 | #define USB_DEVICE_ID_GTCO_1006 0x1006 |
632 | #define USB_DEVICE_ID_GTCO_10 0x0010 | ||
633 | #define USB_DEVICE_ID_GTCO_8 0x0008 | 626 | #define USB_DEVICE_ID_GTCO_8 0x0008 |
634 | #define USB_DEVICE_ID_GTCO_d 0x000d | 627 | #define USB_DEVICE_ID_GTCO_d 0x000d |
635 | 628 | ||
@@ -883,7 +876,6 @@ static const struct hid_blacklist { | |||
883 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, | 876 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, |
884 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, | 877 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, |
885 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, | 878 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, |
886 | { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, | ||
887 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, | 879 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, |
888 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, | 880 | { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, |
889 | { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, | 881 | { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, |
@@ -1249,10 +1241,6 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1249 | hid->hiddev_hid_event = hiddev_hid_event; | 1241 | hid->hiddev_hid_event = hiddev_hid_event; |
1250 | hid->hiddev_report_event = hiddev_report_event; | 1242 | hid->hiddev_report_event = hiddev_report_event; |
1251 | #endif | 1243 | #endif |
1252 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | ||
1253 | hid->pb_fnmode = usbhid_pb_fnmode; | ||
1254 | #endif | ||
1255 | |||
1256 | return hid; | 1244 | return hid; |
1257 | 1245 | ||
1258 | fail: | 1246 | fail: |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 770120add15a..342b4e639acb 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -438,7 +438,6 @@ struct hid_device { /* device report descriptor */ | |||
438 | struct hid_usage *, __s32); | 438 | struct hid_usage *, __s32); |
439 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 439 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
440 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | 440 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK |
441 | unsigned int pb_fnmode; | ||
442 | unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; | 441 | unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; |
443 | unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; | 442 | unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; |
444 | #endif | 443 | #endif |