diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-10-01 08:37:51 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-10-01 08:37:51 -0400 |
commit | a3cbe10e474ac8c2c30a151a7812e15e4cfa2775 (patch) | |
tree | f245dd77a3dede97a80f8369d984334b56220752 /drivers/hid | |
parent | fa2bd30159499f441125495ba8d9d57f646ea42a (diff) | |
parent | 86e6b77eb7cf9ca2e9c7092b4dfd588f0a3307b6 (diff) |
Merge branch 'upstream' into for-linus
Conflicts:
drivers/hid/usbhid/hid-quirks.c
Diffstat (limited to 'drivers/hid')
31 files changed, 110 insertions, 229 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index bf0617e47b89..2af774ad1060 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -307,7 +307,6 @@ config HID_LOGITECH | |||
307 | config HID_LOGITECH_DJ | 307 | config HID_LOGITECH_DJ |
308 | tristate "Logitech Unifying receivers full support" | 308 | tristate "Logitech Unifying receivers full support" |
309 | depends on HID_LOGITECH | 309 | depends on HID_LOGITECH |
310 | default m | ||
311 | ---help--- | 310 | ---help--- |
312 | Say Y if you want support for Logitech Unifying receivers and devices. | 311 | Say Y if you want support for Logitech Unifying receivers and devices. |
313 | Unifying receivers are capable of pairing up to 6 Logitech compliant | 312 | Unifying receivers are capable of pairing up to 6 Logitech compliant |
diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c index 902d1dfeb1b5..0a239885e67c 100644 --- a/drivers/hid/hid-a4tech.c +++ b/drivers/hid/hid-a4tech.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 585344b6d338..06ebdbb6ea02 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> | 8 | * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-aureal.c b/drivers/hid/hid-aureal.c index ba64b041b8bf..7968187ddf7b 100644 --- a/drivers/hid/hid-aureal.c +++ b/drivers/hid/hid-aureal.c | |||
@@ -9,7 +9,6 @@ | |||
9 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 9 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
10 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 10 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
11 | * Copyright (c) 2006-2007 Jiri Kosina | 11 | * Copyright (c) 2006-2007 Jiri Kosina |
12 | * Copyright (c) 2007 Paul Walmsley | ||
13 | * Copyright (c) 2008 Jiri Slaby | 12 | * Copyright (c) 2008 Jiri Slaby |
14 | */ | 13 | */ |
15 | #include <linux/device.h> | 14 | #include <linux/device.h> |
diff --git a/drivers/hid/hid-belkin.c b/drivers/hid/hid-belkin.c index a1a765a5b08a..a1a5a12c3a6b 100644 --- a/drivers/hid/hid-belkin.c +++ b/drivers/hid/hid-belkin.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-cherry.c b/drivers/hid/hid-cherry.c index 888ece68a47c..af034d3d9256 100644 --- a/drivers/hid/hid-cherry.c +++ b/drivers/hid/hid-cherry.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 9072e0ed1876..2cd6880b6b17 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -126,7 +126,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) | |||
126 | 126 | ||
127 | if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) { | 127 | if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) { |
128 | hid_err(parser->device, "collection stack overflow\n"); | 128 | hid_err(parser->device, "collection stack overflow\n"); |
129 | return -1; | 129 | return -EINVAL; |
130 | } | 130 | } |
131 | 131 | ||
132 | if (parser->device->maxcollection == parser->device->collection_size) { | 132 | if (parser->device->maxcollection == parser->device->collection_size) { |
@@ -134,7 +134,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) | |||
134 | parser->device->collection_size * 2, GFP_KERNEL); | 134 | parser->device->collection_size * 2, GFP_KERNEL); |
135 | if (collection == NULL) { | 135 | if (collection == NULL) { |
136 | hid_err(parser->device, "failed to reallocate collection array\n"); | 136 | hid_err(parser->device, "failed to reallocate collection array\n"); |
137 | return -1; | 137 | return -ENOMEM; |
138 | } | 138 | } |
139 | memcpy(collection, parser->device->collection, | 139 | memcpy(collection, parser->device->collection, |
140 | sizeof(struct hid_collection) * | 140 | sizeof(struct hid_collection) * |
@@ -170,7 +170,7 @@ static int close_collection(struct hid_parser *parser) | |||
170 | { | 170 | { |
171 | if (!parser->collection_stack_ptr) { | 171 | if (!parser->collection_stack_ptr) { |
172 | hid_err(parser->device, "collection stack underflow\n"); | 172 | hid_err(parser->device, "collection stack underflow\n"); |
173 | return -1; | 173 | return -EINVAL; |
174 | } | 174 | } |
175 | parser->collection_stack_ptr--; | 175 | parser->collection_stack_ptr--; |
176 | return 0; | 176 | return 0; |
@@ -374,7 +374,7 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) | |||
374 | 374 | ||
375 | case HID_GLOBAL_ITEM_TAG_REPORT_SIZE: | 375 | case HID_GLOBAL_ITEM_TAG_REPORT_SIZE: |
376 | parser->global.report_size = item_udata(item); | 376 | parser->global.report_size = item_udata(item); |
377 | if (parser->global.report_size > 96) { | 377 | if (parser->global.report_size > 128) { |
378 | hid_err(parser->device, "invalid report_size %d\n", | 378 | hid_err(parser->device, "invalid report_size %d\n", |
379 | parser->global.report_size); | 379 | parser->global.report_size); |
380 | return -1; | 380 | return -1; |
@@ -757,6 +757,7 @@ int hid_open_report(struct hid_device *device) | |||
757 | struct hid_item item; | 757 | struct hid_item item; |
758 | unsigned int size; | 758 | unsigned int size; |
759 | __u8 *start; | 759 | __u8 *start; |
760 | __u8 *buf; | ||
760 | __u8 *end; | 761 | __u8 *end; |
761 | int ret; | 762 | int ret; |
762 | static int (*dispatch_type[])(struct hid_parser *parser, | 763 | static int (*dispatch_type[])(struct hid_parser *parser, |
@@ -775,12 +776,21 @@ int hid_open_report(struct hid_device *device) | |||
775 | return -ENODEV; | 776 | return -ENODEV; |
776 | size = device->dev_rsize; | 777 | size = device->dev_rsize; |
777 | 778 | ||
779 | buf = kmemdup(start, size, GFP_KERNEL); | ||
780 | if (buf == NULL) | ||
781 | return -ENOMEM; | ||
782 | |||
778 | if (device->driver->report_fixup) | 783 | if (device->driver->report_fixup) |
779 | start = device->driver->report_fixup(device, start, &size); | 784 | start = device->driver->report_fixup(device, buf, &size); |
785 | else | ||
786 | start = buf; | ||
780 | 787 | ||
781 | device->rdesc = kmemdup(start, size, GFP_KERNEL); | 788 | start = kmemdup(start, size, GFP_KERNEL); |
782 | if (device->rdesc == NULL) | 789 | kfree(buf); |
790 | if (start == NULL) | ||
783 | return -ENOMEM; | 791 | return -ENOMEM; |
792 | |||
793 | device->rdesc = start; | ||
784 | device->rsize = size; | 794 | device->rsize = size; |
785 | 795 | ||
786 | parser = vzalloc(sizeof(struct hid_parser)); | 796 | parser = vzalloc(sizeof(struct hid_parser)); |
@@ -1448,7 +1458,14 @@ void hid_disconnect(struct hid_device *hdev) | |||
1448 | } | 1458 | } |
1449 | EXPORT_SYMBOL_GPL(hid_disconnect); | 1459 | EXPORT_SYMBOL_GPL(hid_disconnect); |
1450 | 1460 | ||
1451 | /* a list of devices for which there is a specialized driver on HID bus */ | 1461 | /* |
1462 | * A list of devices for which there is a specialized driver on HID bus. | ||
1463 | * | ||
1464 | * Please note that for multitouch devices (driven by hid-multitouch driver), | ||
1465 | * there is a proper autodetection and autoloading in place (based on presence | ||
1466 | * of HID_DG_CONTACTID), so those devices don't need to be added to this list, | ||
1467 | * as we are doing the right thing in hid_scan_usage(). | ||
1468 | */ | ||
1452 | static const struct hid_device_id hid_have_special_driver[] = { | 1469 | static const struct hid_device_id hid_have_special_driver[] = { |
1453 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, | 1470 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, |
1454 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) }, | 1471 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) }, |
@@ -1628,6 +1645,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1628 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, | 1645 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, |
1629 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, | 1646 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, |
1630 | { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, | 1647 | { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, |
1648 | #if IS_ENABLED(CONFIG_HID_ROCCAT) | ||
1631 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) }, | 1649 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) }, |
1632 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) }, | 1650 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) }, |
1633 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) }, | 1651 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) }, |
@@ -1636,6 +1654,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1636 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) }, | 1654 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) }, |
1637 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, | 1655 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, |
1638 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) }, | 1656 | { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) }, |
1657 | #endif | ||
1639 | { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, | 1658 | { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, |
1640 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, | 1659 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, |
1641 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, | 1660 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, |
diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c index 9e43aaca9774..3e159a50dac7 100644 --- a/drivers/hid/hid-cypress.c +++ b/drivers/hid/hid-cypress.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 01dd9a7daf7a..933fff0fff1f 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) | |||
911 | 911 | ||
912 | } | 912 | } |
913 | 913 | ||
914 | |||
915 | static int hid_debug_rdesc_show(struct seq_file *f, void *p) | 914 | static int hid_debug_rdesc_show(struct seq_file *f, void *p) |
916 | { | 915 | { |
917 | struct hid_device *hdev = f->private; | 916 | struct hid_device *hdev = f->private; |
917 | const __u8 *rdesc = hdev->rdesc; | ||
918 | unsigned rsize = hdev->rsize; | ||
918 | int i; | 919 | int i; |
919 | 920 | ||
921 | if (!rdesc) { | ||
922 | rdesc = hdev->dev_rdesc; | ||
923 | rsize = hdev->dev_rsize; | ||
924 | } | ||
925 | |||
920 | /* dump HID report descriptor */ | 926 | /* dump HID report descriptor */ |
921 | for (i = 0; i < hdev->rsize; i++) | 927 | for (i = 0; i < rsize; i++) |
922 | seq_printf(f, "%02x ", hdev->rdesc[i]); | 928 | seq_printf(f, "%02x ", rdesc[i]); |
923 | seq_printf(f, "\n\n"); | 929 | seq_printf(f, "\n\n"); |
924 | 930 | ||
925 | /* dump parsed data and input mappings */ | 931 | /* dump parsed data and input mappings */ |
diff --git a/drivers/hid/hid-ezkey.c b/drivers/hid/hid-ezkey.c index ca1163e9d42d..6540af2871a7 100644 --- a/drivers/hid/hid-ezkey.c +++ b/drivers/hid/hid-ezkey.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c index e88b951cd10d..4442c30ef531 100644 --- a/drivers/hid/hid-gyration.c +++ b/drivers/hid/hid-gyration.c | |||
@@ -4,7 +4,6 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2007 Paul Walmsley | ||
8 | * Copyright (c) 2008 Jiri Slaby | 7 | * Copyright (c) 2008 Jiri Slaby |
9 | * Copyright (c) 2006-2008 Jiri Kosina | 8 | * Copyright (c) 2006-2008 Jiri Kosina |
10 | */ | 9 | */ |
diff --git a/drivers/hid/hid-holtekff.c b/drivers/hid/hid-holtekff.c index 4e7542151e22..ff295e60059b 100644 --- a/drivers/hid/hid-holtekff.c +++ b/drivers/hid/hid-holtekff.c | |||
@@ -100,8 +100,7 @@ static void holtekff_send(struct holtekff_device *holtekff, | |||
100 | holtekff->field->value[i] = data[i]; | 100 | holtekff->field->value[i] = data[i]; |
101 | } | 101 | } |
102 | 102 | ||
103 | dbg_hid("sending %02x %02x %02x %02x %02x %02x %02x\n", data[0], | 103 | dbg_hid("sending %*ph\n", 7, data); |
104 | data[1], data[2], data[3], data[4], data[5], data[6]); | ||
105 | 104 | ||
106 | usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT); | 105 | usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT); |
107 | } | 106 | } |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index a534375fdf2e..c1da94a81a0d 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | */ | 8 | */ |
10 | 9 | ||
11 | /* | 10 | /* |
@@ -299,6 +298,9 @@ | |||
299 | #define USB_VENDOR_ID_EZKEY 0x0518 | 298 | #define USB_VENDOR_ID_EZKEY 0x0518 |
300 | #define USB_DEVICE_ID_BTC_8193 0x0002 | 299 | #define USB_DEVICE_ID_BTC_8193 0x0002 |
301 | 300 | ||
301 | #define USB_VENDOR_ID_FREESCALE 0x15A2 | ||
302 | #define USB_DEVICE_ID_FREESCALE_MX28 0x004F | ||
303 | |||
302 | #define USB_VENDOR_ID_FRUCTEL 0x25B6 | 304 | #define USB_VENDOR_ID_FRUCTEL 0x25B6 |
303 | #define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002 | 305 | #define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002 |
304 | 306 | ||
@@ -656,7 +658,6 @@ | |||
656 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000 | 658 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000 |
657 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001 | 659 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001 |
658 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008 | 660 | #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008 |
659 | #define USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN 0x3001 | ||
660 | 661 | ||
661 | #define USB_VENDOR_ID_ROCCAT 0x1e7d | 662 | #define USB_VENDOR_ID_ROCCAT 0x1e7d |
662 | #define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4 | 663 | #define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4 |
diff --git a/drivers/hid/hid-lcpower.c b/drivers/hid/hid-lcpower.c index c4fe9bd095b7..22bc14abdfa3 100644 --- a/drivers/hid/hid-lcpower.c +++ b/drivers/hid/hid-lcpower.c | |||
@@ -24,7 +24,7 @@ static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
24 | struct hid_field *field, struct hid_usage *usage, | 24 | struct hid_field *field, struct hid_usage *usage, |
25 | unsigned long **bit, int *max) | 25 | unsigned long **bit, int *max) |
26 | { | 26 | { |
27 | if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000) | 27 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) |
28 | return 0; | 28 | return 0; |
29 | 29 | ||
30 | switch (usage->hid & HID_USAGE) { | 30 | switch (usage->hid & HID_USAGE) { |
diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c index 60c4e1e85913..cea016e94f43 100644 --- a/drivers/hid/hid-lenovo-tpkbd.c +++ b/drivers/hid/hid-lenovo-tpkbd.c | |||
@@ -56,9 +56,8 @@ static int tpkbd_input_mapping(struct hid_device *hdev, | |||
56 | static int tpkbd_features_set(struct hid_device *hdev) | 56 | static int tpkbd_features_set(struct hid_device *hdev) |
57 | { | 57 | { |
58 | struct hid_report *report; | 58 | struct hid_report *report; |
59 | struct tpkbd_data_pointer *data_pointer; | 59 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
60 | 60 | ||
61 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
62 | report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4]; | 61 | report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4]; |
63 | 62 | ||
64 | report->field[0]->value[0] = data_pointer->press_to_select ? 0x01 : 0x02; | 63 | report->field[0]->value[0] = data_pointer->press_to_select ? 0x01 : 0x02; |
@@ -77,14 +76,8 @@ static ssize_t pointer_press_to_select_show(struct device *dev, | |||
77 | struct device_attribute *attr, | 76 | struct device_attribute *attr, |
78 | char *buf) | 77 | char *buf) |
79 | { | 78 | { |
80 | struct hid_device *hdev; | 79 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
81 | struct tpkbd_data_pointer *data_pointer; | 80 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
82 | |||
83 | hdev = container_of(dev, struct hid_device, dev); | ||
84 | if (hdev == NULL) | ||
85 | return -ENODEV; | ||
86 | |||
87 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
88 | 81 | ||
89 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->press_to_select); | 82 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->press_to_select); |
90 | } | 83 | } |
@@ -94,16 +87,10 @@ static ssize_t pointer_press_to_select_store(struct device *dev, | |||
94 | const char *buf, | 87 | const char *buf, |
95 | size_t count) | 88 | size_t count) |
96 | { | 89 | { |
97 | struct hid_device *hdev; | 90 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
98 | struct tpkbd_data_pointer *data_pointer; | 91 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
99 | int value; | 92 | int value; |
100 | 93 | ||
101 | hdev = container_of(dev, struct hid_device, dev); | ||
102 | if (hdev == NULL) | ||
103 | return -ENODEV; | ||
104 | |||
105 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
106 | |||
107 | if (kstrtoint(buf, 10, &value)) | 94 | if (kstrtoint(buf, 10, &value)) |
108 | return -EINVAL; | 95 | return -EINVAL; |
109 | if (value < 0 || value > 1) | 96 | if (value < 0 || value > 1) |
@@ -119,14 +106,8 @@ static ssize_t pointer_dragging_show(struct device *dev, | |||
119 | struct device_attribute *attr, | 106 | struct device_attribute *attr, |
120 | char *buf) | 107 | char *buf) |
121 | { | 108 | { |
122 | struct hid_device *hdev; | 109 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
123 | struct tpkbd_data_pointer *data_pointer; | 110 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
124 | |||
125 | hdev = container_of(dev, struct hid_device, dev); | ||
126 | if (hdev == NULL) | ||
127 | return -ENODEV; | ||
128 | |||
129 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
130 | 111 | ||
131 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->dragging); | 112 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->dragging); |
132 | } | 113 | } |
@@ -136,16 +117,10 @@ static ssize_t pointer_dragging_store(struct device *dev, | |||
136 | const char *buf, | 117 | const char *buf, |
137 | size_t count) | 118 | size_t count) |
138 | { | 119 | { |
139 | struct hid_device *hdev; | 120 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
140 | struct tpkbd_data_pointer *data_pointer; | 121 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
141 | int value; | 122 | int value; |
142 | 123 | ||
143 | hdev = container_of(dev, struct hid_device, dev); | ||
144 | if (hdev == NULL) | ||
145 | return -ENODEV; | ||
146 | |||
147 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
148 | |||
149 | if (kstrtoint(buf, 10, &value)) | 124 | if (kstrtoint(buf, 10, &value)) |
150 | return -EINVAL; | 125 | return -EINVAL; |
151 | if (value < 0 || value > 1) | 126 | if (value < 0 || value > 1) |
@@ -161,14 +136,8 @@ static ssize_t pointer_release_to_select_show(struct device *dev, | |||
161 | struct device_attribute *attr, | 136 | struct device_attribute *attr, |
162 | char *buf) | 137 | char *buf) |
163 | { | 138 | { |
164 | struct hid_device *hdev; | 139 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
165 | struct tpkbd_data_pointer *data_pointer; | 140 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
166 | |||
167 | hdev = container_of(dev, struct hid_device, dev); | ||
168 | if (hdev == NULL) | ||
169 | return -ENODEV; | ||
170 | |||
171 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
172 | 141 | ||
173 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->release_to_select); | 142 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->release_to_select); |
174 | } | 143 | } |
@@ -178,16 +147,10 @@ static ssize_t pointer_release_to_select_store(struct device *dev, | |||
178 | const char *buf, | 147 | const char *buf, |
179 | size_t count) | 148 | size_t count) |
180 | { | 149 | { |
181 | struct hid_device *hdev; | 150 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
182 | struct tpkbd_data_pointer *data_pointer; | 151 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
183 | int value; | 152 | int value; |
184 | 153 | ||
185 | hdev = container_of(dev, struct hid_device, dev); | ||
186 | if (hdev == NULL) | ||
187 | return -ENODEV; | ||
188 | |||
189 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
190 | |||
191 | if (kstrtoint(buf, 10, &value)) | 154 | if (kstrtoint(buf, 10, &value)) |
192 | return -EINVAL; | 155 | return -EINVAL; |
193 | if (value < 0 || value > 1) | 156 | if (value < 0 || value > 1) |
@@ -203,14 +166,8 @@ static ssize_t pointer_select_right_show(struct device *dev, | |||
203 | struct device_attribute *attr, | 166 | struct device_attribute *attr, |
204 | char *buf) | 167 | char *buf) |
205 | { | 168 | { |
206 | struct hid_device *hdev; | 169 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
207 | struct tpkbd_data_pointer *data_pointer; | 170 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
208 | |||
209 | hdev = container_of(dev, struct hid_device, dev); | ||
210 | if (hdev == NULL) | ||
211 | return -ENODEV; | ||
212 | |||
213 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
214 | 171 | ||
215 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->select_right); | 172 | return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->select_right); |
216 | } | 173 | } |
@@ -220,16 +177,10 @@ static ssize_t pointer_select_right_store(struct device *dev, | |||
220 | const char *buf, | 177 | const char *buf, |
221 | size_t count) | 178 | size_t count) |
222 | { | 179 | { |
223 | struct hid_device *hdev; | 180 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
224 | struct tpkbd_data_pointer *data_pointer; | 181 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
225 | int value; | 182 | int value; |
226 | 183 | ||
227 | hdev = container_of(dev, struct hid_device, dev); | ||
228 | if (hdev == NULL) | ||
229 | return -ENODEV; | ||
230 | |||
231 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
232 | |||
233 | if (kstrtoint(buf, 10, &value)) | 184 | if (kstrtoint(buf, 10, &value)) |
234 | return -EINVAL; | 185 | return -EINVAL; |
235 | if (value < 0 || value > 1) | 186 | if (value < 0 || value > 1) |
@@ -245,14 +196,8 @@ static ssize_t pointer_sensitivity_show(struct device *dev, | |||
245 | struct device_attribute *attr, | 196 | struct device_attribute *attr, |
246 | char *buf) | 197 | char *buf) |
247 | { | 198 | { |
248 | struct hid_device *hdev; | 199 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
249 | struct tpkbd_data_pointer *data_pointer; | 200 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
250 | |||
251 | hdev = container_of(dev, struct hid_device, dev); | ||
252 | if (hdev == NULL) | ||
253 | return -ENODEV; | ||
254 | |||
255 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
256 | 201 | ||
257 | return snprintf(buf, PAGE_SIZE, "%u\n", | 202 | return snprintf(buf, PAGE_SIZE, "%u\n", |
258 | data_pointer->sensitivity); | 203 | data_pointer->sensitivity); |
@@ -263,16 +208,10 @@ static ssize_t pointer_sensitivity_store(struct device *dev, | |||
263 | const char *buf, | 208 | const char *buf, |
264 | size_t count) | 209 | size_t count) |
265 | { | 210 | { |
266 | struct hid_device *hdev; | 211 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
267 | struct tpkbd_data_pointer *data_pointer; | 212 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
268 | int value; | 213 | int value; |
269 | 214 | ||
270 | hdev = container_of(dev, struct hid_device, dev); | ||
271 | if (hdev == NULL) | ||
272 | return -ENODEV; | ||
273 | |||
274 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
275 | |||
276 | if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) | 215 | if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) |
277 | return -EINVAL; | 216 | return -EINVAL; |
278 | 217 | ||
@@ -286,14 +225,10 @@ static ssize_t pointer_press_speed_show(struct device *dev, | |||
286 | struct device_attribute *attr, | 225 | struct device_attribute *attr, |
287 | char *buf) | 226 | char *buf) |
288 | { | 227 | { |
289 | struct hid_device *hdev; | 228 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
290 | struct tpkbd_data_pointer *data_pointer; | 229 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
291 | 230 | ||
292 | hdev = container_of(dev, struct hid_device, dev); | 231 | data_pointer = hid_get_drvdata(hdev); |
293 | if (hdev == NULL) | ||
294 | return -ENODEV; | ||
295 | |||
296 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
297 | 232 | ||
298 | return snprintf(buf, PAGE_SIZE, "%u\n", | 233 | return snprintf(buf, PAGE_SIZE, "%u\n", |
299 | data_pointer->press_speed); | 234 | data_pointer->press_speed); |
@@ -304,16 +239,10 @@ static ssize_t pointer_press_speed_store(struct device *dev, | |||
304 | const char *buf, | 239 | const char *buf, |
305 | size_t count) | 240 | size_t count) |
306 | { | 241 | { |
307 | struct hid_device *hdev; | 242 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
308 | struct tpkbd_data_pointer *data_pointer; | 243 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
309 | int value; | 244 | int value; |
310 | 245 | ||
311 | hdev = container_of(dev, struct hid_device, dev); | ||
312 | if (hdev == NULL) | ||
313 | return -ENODEV; | ||
314 | |||
315 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
316 | |||
317 | if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) | 246 | if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) |
318 | return -EINVAL; | 247 | return -EINVAL; |
319 | 248 | ||
@@ -370,15 +299,11 @@ static const struct attribute_group tpkbd_attr_group_pointer = { | |||
370 | static enum led_brightness tpkbd_led_brightness_get( | 299 | static enum led_brightness tpkbd_led_brightness_get( |
371 | struct led_classdev *led_cdev) | 300 | struct led_classdev *led_cdev) |
372 | { | 301 | { |
373 | struct device *dev; | 302 | struct device *dev = led_cdev->dev->parent; |
374 | struct hid_device *hdev; | 303 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
375 | struct tpkbd_data_pointer *data_pointer; | 304 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
376 | int led_nr = 0; | 305 | int led_nr = 0; |
377 | 306 | ||
378 | dev = led_cdev->dev->parent; | ||
379 | hdev = container_of(dev, struct hid_device, dev); | ||
380 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
381 | |||
382 | if (led_cdev == &data_pointer->led_micmute) | 307 | if (led_cdev == &data_pointer->led_micmute) |
383 | led_nr = 1; | 308 | led_nr = 1; |
384 | 309 | ||
@@ -390,16 +315,12 @@ static enum led_brightness tpkbd_led_brightness_get( | |||
390 | static void tpkbd_led_brightness_set(struct led_classdev *led_cdev, | 315 | static void tpkbd_led_brightness_set(struct led_classdev *led_cdev, |
391 | enum led_brightness value) | 316 | enum led_brightness value) |
392 | { | 317 | { |
393 | struct device *dev; | 318 | struct device *dev = led_cdev->dev->parent; |
394 | struct hid_device *hdev; | 319 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
320 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); | ||
395 | struct hid_report *report; | 321 | struct hid_report *report; |
396 | struct tpkbd_data_pointer *data_pointer; | ||
397 | int led_nr = 0; | 322 | int led_nr = 0; |
398 | 323 | ||
399 | dev = led_cdev->dev->parent; | ||
400 | hdev = container_of(dev, struct hid_device, dev); | ||
401 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
402 | |||
403 | if (led_cdev == &data_pointer->led_micmute) | 324 | if (led_cdev == &data_pointer->led_micmute) |
404 | led_nr = 1; | 325 | led_nr = 1; |
405 | 326 | ||
@@ -508,13 +429,11 @@ err_free: | |||
508 | 429 | ||
509 | static void tpkbd_remove_tp(struct hid_device *hdev) | 430 | static void tpkbd_remove_tp(struct hid_device *hdev) |
510 | { | 431 | { |
511 | struct tpkbd_data_pointer *data_pointer; | 432 | struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev); |
512 | 433 | ||
513 | sysfs_remove_group(&hdev->dev.kobj, | 434 | sysfs_remove_group(&hdev->dev.kobj, |
514 | &tpkbd_attr_group_pointer); | 435 | &tpkbd_attr_group_pointer); |
515 | 436 | ||
516 | data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev); | ||
517 | |||
518 | led_classdev_unregister(&data_pointer->led_micmute); | 437 | led_classdev_unregister(&data_pointer->led_micmute); |
519 | led_classdev_unregister(&data_pointer->led_mute); | 438 | led_classdev_unregister(&data_pointer->led_mute); |
520 | 439 | ||
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index afc4de389f81..a2f8e88b9fa2 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | * Copyright (c) 2010 Hendrik Iben | 9 | * Copyright (c) 2010 Hendrik Iben |
11 | */ | 10 | */ |
@@ -109,7 +108,7 @@ static __u8 dfp_rdesc_fixed[] = { | |||
109 | static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 108 | static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
110 | unsigned int *rsize) | 109 | unsigned int *rsize) |
111 | { | 110 | { |
112 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); | 111 | struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
113 | 112 | ||
114 | if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && | 113 | if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && |
115 | rdesc[84] == 0x8c && rdesc[85] == 0x02) { | 114 | rdesc[84] == 0x8c && rdesc[85] == 0x02) { |
@@ -278,7 +277,7 @@ static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
278 | 0, 0, 0, 0, 0,183,184,185,186,187, | 277 | 0, 0, 0, 0, 0,183,184,185,186,187, |
279 | 188,189,190,191,192,193,194, 0, 0, 0 | 278 | 188,189,190,191,192,193,194, 0, 0, 0 |
280 | }; | 279 | }; |
281 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); | 280 | struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
282 | unsigned int hid = usage->hid; | 281 | unsigned int hid = usage->hid; |
283 | 282 | ||
284 | if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER && | 283 | if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER && |
@@ -319,7 +318,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, | |||
319 | struct hid_field *field, struct hid_usage *usage, | 318 | struct hid_field *field, struct hid_usage *usage, |
320 | unsigned long **bit, int *max) | 319 | unsigned long **bit, int *max) |
321 | { | 320 | { |
322 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); | 321 | struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
323 | 322 | ||
324 | if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY && | 323 | if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY && |
325 | (field->flags & HID_MAIN_ITEM_RELATIVE)) | 324 | (field->flags & HID_MAIN_ITEM_RELATIVE)) |
@@ -335,7 +334,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, | |||
335 | static int lg_event(struct hid_device *hdev, struct hid_field *field, | 334 | static int lg_event(struct hid_device *hdev, struct hid_field *field, |
336 | struct hid_usage *usage, __s32 value) | 335 | struct hid_usage *usage, __s32 value) |
337 | { | 336 | { |
338 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); | 337 | struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
339 | 338 | ||
340 | if ((drv_data->quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) { | 339 | if ((drv_data->quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) { |
341 | input_event(field->hidinput->input, usage->type, usage->code, | 340 | input_event(field->hidinput->input, usage->type, usage->code, |
@@ -419,7 +418,7 @@ err_free: | |||
419 | 418 | ||
420 | static void lg_remove(struct hid_device *hdev) | 419 | static void lg_remove(struct hid_device *hdev) |
421 | { | 420 | { |
422 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); | 421 | struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
423 | if (drv_data->quirks & LG_FF4) | 422 | if (drv_data->quirks & LG_FF4) |
424 | lg4ff_deinit(hdev); | 423 | lg4ff_deinit(hdev); |
425 | 424 | ||
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 4fb4a80928c8..d7947c701f30 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -423,7 +423,7 @@ static void lg4ff_led_set_brightness(struct led_classdev *led_cdev, | |||
423 | { | 423 | { |
424 | struct device *dev = led_cdev->dev->parent; | 424 | struct device *dev = led_cdev->dev->parent; |
425 | struct hid_device *hid = container_of(dev, struct hid_device, dev); | 425 | struct hid_device *hid = container_of(dev, struct hid_device, dev); |
426 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hid); | 426 | struct lg_drv_data *drv_data = hid_get_drvdata(hid); |
427 | struct lg4ff_device_entry *entry; | 427 | struct lg4ff_device_entry *entry; |
428 | int i, state = 0; | 428 | int i, state = 0; |
429 | 429 | ||
@@ -458,7 +458,7 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde | |||
458 | { | 458 | { |
459 | struct device *dev = led_cdev->dev->parent; | 459 | struct device *dev = led_cdev->dev->parent; |
460 | struct hid_device *hid = container_of(dev, struct hid_device, dev); | 460 | struct hid_device *hid = container_of(dev, struct hid_device, dev); |
461 | struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hid); | 461 | struct lg_drv_data *drv_data = hid_get_drvdata(hid); |
462 | struct lg4ff_device_entry *entry; | 462 | struct lg4ff_device_entry *entry; |
463 | int i, value = 0; | 463 | int i, value = 0; |
464 | 464 | ||
diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index e5c699b6c6f3..3acdcfcc17df 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-monterey.c b/drivers/hid/hid-monterey.c index dedf757781ae..cd3643e06fa6 100644 --- a/drivers/hid/hid-monterey.c +++ b/drivers/hid/hid-monterey.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 9fae2ebdd758..86a969f63292 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c | |||
@@ -882,10 +882,10 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
882 | nd->activate_slack = activate_slack; | 882 | nd->activate_slack = activate_slack; |
883 | nd->act_state = activate_slack; | 883 | nd->act_state = activate_slack; |
884 | nd->deactivate_slack = -deactivate_slack; | 884 | nd->deactivate_slack = -deactivate_slack; |
885 | nd->sensor_logical_width = 0; | 885 | nd->sensor_logical_width = 1; |
886 | nd->sensor_logical_height = 0; | 886 | nd->sensor_logical_height = 1; |
887 | nd->sensor_physical_width = 0; | 887 | nd->sensor_physical_width = 1; |
888 | nd->sensor_physical_height = 0; | 888 | nd->sensor_physical_height = 1; |
889 | 889 | ||
890 | hid_set_drvdata(hdev, nd); | 890 | hid_set_drvdata(hdev, nd); |
891 | 891 | ||
diff --git a/drivers/hid/hid-petalynx.c b/drivers/hid/hid-petalynx.c index f1ea3ff8a98d..4c521de4e7e6 100644 --- a/drivers/hid/hid-petalynx.c +++ b/drivers/hid/hid-petalynx.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-primax.c b/drivers/hid/hid-primax.c index 4d3c60d88318..c15adb0c98a1 100644 --- a/drivers/hid/hid-primax.c +++ b/drivers/hid/hid-primax.c | |||
@@ -64,29 +64,6 @@ static int px_raw_event(struct hid_device *hid, struct hid_report *report, | |||
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | static int px_probe(struct hid_device *hid, const struct hid_device_id *id) | ||
68 | { | ||
69 | int ret; | ||
70 | |||
71 | ret = hid_parse(hid); | ||
72 | if (ret) { | ||
73 | hid_err(hid, "parse failed\n"); | ||
74 | goto fail; | ||
75 | } | ||
76 | |||
77 | ret = hid_hw_start(hid, HID_CONNECT_DEFAULT); | ||
78 | if (ret) | ||
79 | hid_err(hid, "hw start failed\n"); | ||
80 | |||
81 | fail: | ||
82 | return ret; | ||
83 | } | ||
84 | |||
85 | static void px_remove(struct hid_device *hid) | ||
86 | { | ||
87 | hid_hw_stop(hid); | ||
88 | } | ||
89 | |||
90 | static const struct hid_device_id px_devices[] = { | 67 | static const struct hid_device_id px_devices[] = { |
91 | { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, | 68 | { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, |
92 | { } | 69 | { } |
@@ -97,8 +74,6 @@ static struct hid_driver px_driver = { | |||
97 | .name = "primax", | 74 | .name = "primax", |
98 | .id_table = px_devices, | 75 | .id_table = px_devices, |
99 | .raw_event = px_raw_event, | 76 | .raw_event = px_raw_event, |
100 | .probe = px_probe, | ||
101 | .remove = px_remove, | ||
102 | }; | 77 | }; |
103 | 78 | ||
104 | static int __init px_init(void) | 79 | static int __init px_init(void) |
diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index b71b77ab0dc7..ec8ca3336315 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c | |||
@@ -105,7 +105,7 @@ static ssize_t show_channel(struct device *dev, | |||
105 | struct device_attribute *attr, char *buf) | 105 | struct device_attribute *attr, char *buf) |
106 | { | 106 | { |
107 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 107 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
108 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 108 | struct pk_device *pk = hid_get_drvdata(hdev); |
109 | 109 | ||
110 | dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel); | 110 | dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel); |
111 | 111 | ||
@@ -118,7 +118,7 @@ static ssize_t store_channel(struct device *dev, | |||
118 | struct device_attribute *attr, const char *buf, size_t count) | 118 | struct device_attribute *attr, const char *buf, size_t count) |
119 | { | 119 | { |
120 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 120 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
121 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 121 | struct pk_device *pk = hid_get_drvdata(hdev); |
122 | 122 | ||
123 | unsigned channel = 0; | 123 | unsigned channel = 0; |
124 | 124 | ||
@@ -142,7 +142,7 @@ static ssize_t show_sustain(struct device *dev, | |||
142 | struct device_attribute *attr, char *buf) | 142 | struct device_attribute *attr, char *buf) |
143 | { | 143 | { |
144 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 144 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
145 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 145 | struct pk_device *pk = hid_get_drvdata(hdev); |
146 | 146 | ||
147 | dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain); | 147 | dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain); |
148 | 148 | ||
@@ -155,7 +155,7 @@ static ssize_t store_sustain(struct device *dev, | |||
155 | struct device_attribute *attr, const char *buf, size_t count) | 155 | struct device_attribute *attr, const char *buf, size_t count) |
156 | { | 156 | { |
157 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 157 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
158 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 158 | struct pk_device *pk = hid_get_drvdata(hdev); |
159 | 159 | ||
160 | unsigned sustain = 0; | 160 | unsigned sustain = 0; |
161 | 161 | ||
@@ -181,7 +181,7 @@ static ssize_t show_octave(struct device *dev, | |||
181 | struct device_attribute *attr, char *buf) | 181 | struct device_attribute *attr, char *buf) |
182 | { | 182 | { |
183 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 183 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
184 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 184 | struct pk_device *pk = hid_get_drvdata(hdev); |
185 | 185 | ||
186 | dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave); | 186 | dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave); |
187 | 187 | ||
@@ -194,7 +194,7 @@ static ssize_t store_octave(struct device *dev, | |||
194 | struct device_attribute *attr, const char *buf, size_t count) | 194 | struct device_attribute *attr, const char *buf, size_t count) |
195 | { | 195 | { |
196 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); | 196 | struct hid_device *hdev = container_of(dev, struct hid_device, dev); |
197 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 197 | struct pk_device *pk = hid_get_drvdata(hdev); |
198 | 198 | ||
199 | int octave = 0; | 199 | int octave = 0; |
200 | 200 | ||
@@ -759,7 +759,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
759 | struct hid_field *field, struct hid_usage *usage, | 759 | struct hid_field *field, struct hid_usage *usage, |
760 | unsigned long **bit, int *max) | 760 | unsigned long **bit, int *max) |
761 | { | 761 | { |
762 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 762 | struct pk_device *pk = hid_get_drvdata(hdev); |
763 | struct pcmidi_snd *pm; | 763 | struct pcmidi_snd *pm; |
764 | 764 | ||
765 | pm = pk->pm; | 765 | pm = pk->pm; |
@@ -777,7 +777,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
777 | static int pk_raw_event(struct hid_device *hdev, struct hid_report *report, | 777 | static int pk_raw_event(struct hid_device *hdev, struct hid_report *report, |
778 | u8 *data, int size) | 778 | u8 *data, int size) |
779 | { | 779 | { |
780 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 780 | struct pk_device *pk = hid_get_drvdata(hdev); |
781 | int ret = 0; | 781 | int ret = 0; |
782 | 782 | ||
783 | if (1 == pk->pm->ifnum) { | 783 | if (1 == pk->pm->ifnum) { |
@@ -858,7 +858,7 @@ err_free_pk: | |||
858 | 858 | ||
859 | static void pk_remove(struct hid_device *hdev) | 859 | static void pk_remove(struct hid_device *hdev) |
860 | { | 860 | { |
861 | struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); | 861 | struct pk_device *pk = hid_get_drvdata(hdev); |
862 | struct pcmidi_snd *pm; | 862 | struct pcmidi_snd *pm; |
863 | 863 | ||
864 | pm = pk->pm; | 864 | pm = pk->pm; |
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 3c1fd8af5e0c..a5821d317229 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | * Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk> | 9 | * Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk> |
11 | * | 10 | * |
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 5cd25bd907f8..7f33ebf299c2 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -4,7 +4,6 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2007 Paul Walmsley | ||
8 | * Copyright (c) 2008 Jiri Slaby | 7 | * Copyright (c) 2008 Jiri Slaby |
9 | * Copyright (c) 2006-2008 Jiri Kosina | 8 | * Copyright (c) 2006-2008 Jiri Kosina |
10 | */ | 9 | */ |
diff --git a/drivers/hid/hid-sunplus.c b/drivers/hid/hid-sunplus.c index d484a0043dd4..45b4b066a262 100644 --- a/drivers/hid/hid-sunplus.c +++ b/drivers/hid/hid-sunplus.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | 8 | * Copyright (c) 2008 Jiri Slaby |
10 | */ | 9 | */ |
11 | 10 | ||
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 75b970f116ee..2f60da9ed066 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
@@ -5,7 +5,6 @@ | |||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006-2007 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> | 8 | * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> |
10 | * Copyright (c) 2006 Andrew Zabolotny <zap@homelink.ru> | 9 | * Copyright (c) 2006 Andrew Zabolotny <zap@homelink.ru> |
11 | * Copyright (c) 2009 Bastien Nocera <hadess@hadess.net> | 10 | * Copyright (c) 2009 Bastien Nocera <hadess@hadess.net> |
diff --git a/drivers/hid/hid-waltop.c b/drivers/hid/hid-waltop.c index 745e4e9a8cf2..bb536ab5941e 100644 --- a/drivers/hid/hid-waltop.c +++ b/drivers/hid/hid-waltop.c | |||
@@ -638,28 +638,6 @@ static __u8 sirius_battery_free_tablet_rdesc_fixed[] = { | |||
638 | 0xC0 /* End Collection */ | 638 | 0xC0 /* End Collection */ |
639 | }; | 639 | }; |
640 | 640 | ||
641 | static int waltop_probe(struct hid_device *hdev, | ||
642 | const struct hid_device_id *id) | ||
643 | { | ||
644 | int ret; | ||
645 | |||
646 | ret = hid_parse(hdev); | ||
647 | if (ret) { | ||
648 | hid_err(hdev, "parse failed\n"); | ||
649 | goto err; | ||
650 | } | ||
651 | |||
652 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | ||
653 | if (ret) { | ||
654 | hid_err(hdev, "hw start failed\n"); | ||
655 | goto err; | ||
656 | } | ||
657 | |||
658 | return 0; | ||
659 | err: | ||
660 | return ret; | ||
661 | } | ||
662 | |||
663 | static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 641 | static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
664 | unsigned int *rsize) | 642 | unsigned int *rsize) |
665 | { | 643 | { |
@@ -776,11 +754,6 @@ static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report, | |||
776 | return 0; | 754 | return 0; |
777 | } | 755 | } |
778 | 756 | ||
779 | static void waltop_remove(struct hid_device *hdev) | ||
780 | { | ||
781 | hid_hw_stop(hdev); | ||
782 | } | ||
783 | |||
784 | static const struct hid_device_id waltop_devices[] = { | 757 | static const struct hid_device_id waltop_devices[] = { |
785 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, | 758 | { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, |
786 | USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, | 759 | USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, |
@@ -803,10 +776,8 @@ MODULE_DEVICE_TABLE(hid, waltop_devices); | |||
803 | static struct hid_driver waltop_driver = { | 776 | static struct hid_driver waltop_driver = { |
804 | .name = "waltop", | 777 | .name = "waltop", |
805 | .id_table = waltop_devices, | 778 | .id_table = waltop_devices, |
806 | .probe = waltop_probe, | ||
807 | .report_fixup = waltop_report_fixup, | 779 | .report_fixup = waltop_report_fixup, |
808 | .raw_event = waltop_raw_event, | 780 | .raw_event = waltop_raw_event, |
809 | .remove = waltop_remove, | ||
810 | }; | 781 | }; |
811 | 782 | ||
812 | static int __init waltop_init(void) | 783 | static int __init waltop_init(void) |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index c46c5f1037f4..17d15bb610d1 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -522,21 +522,28 @@ int __init hidraw_init(void) | |||
522 | 522 | ||
523 | if (result < 0) { | 523 | if (result < 0) { |
524 | pr_warn("can't get major number\n"); | 524 | pr_warn("can't get major number\n"); |
525 | result = 0; | ||
526 | goto out; | 525 | goto out; |
527 | } | 526 | } |
528 | 527 | ||
529 | hidraw_class = class_create(THIS_MODULE, "hidraw"); | 528 | hidraw_class = class_create(THIS_MODULE, "hidraw"); |
530 | if (IS_ERR(hidraw_class)) { | 529 | if (IS_ERR(hidraw_class)) { |
531 | result = PTR_ERR(hidraw_class); | 530 | result = PTR_ERR(hidraw_class); |
532 | unregister_chrdev(hidraw_major, "hidraw"); | 531 | goto error_cdev; |
533 | goto out; | ||
534 | } | 532 | } |
535 | 533 | ||
536 | cdev_init(&hidraw_cdev, &hidraw_ops); | 534 | cdev_init(&hidraw_cdev, &hidraw_ops); |
537 | cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES); | 535 | result = cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES); |
536 | if (result < 0) | ||
537 | goto error_class; | ||
538 | |||
538 | out: | 539 | out: |
539 | return result; | 540 | return result; |
541 | |||
542 | error_class: | ||
543 | class_destroy(hidraw_class); | ||
544 | error_cdev: | ||
545 | unregister_chrdev_region(dev_id, HIDRAW_MAX_DEVICES); | ||
546 | goto out; | ||
540 | } | 547 | } |
541 | 548 | ||
542 | void hidraw_exit(void) | 549 | void hidraw_exit(void) |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index dedd8e4e5c6d..8e0c4bf94ebc 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -1415,20 +1415,20 @@ static int hid_post_reset(struct usb_interface *intf) | |||
1415 | * configuration descriptors passed, we already know that | 1415 | * configuration descriptors passed, we already know that |
1416 | * the size of the HID report descriptor has not changed. | 1416 | * the size of the HID report descriptor has not changed. |
1417 | */ | 1417 | */ |
1418 | rdesc = kmalloc(hid->rsize, GFP_KERNEL); | 1418 | rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL); |
1419 | if (!rdesc) { | 1419 | if (!rdesc) { |
1420 | dbg_hid("couldn't allocate rdesc memory (post_reset)\n"); | 1420 | dbg_hid("couldn't allocate rdesc memory (post_reset)\n"); |
1421 | return 1; | 1421 | return 1; |
1422 | } | 1422 | } |
1423 | status = hid_get_class_descriptor(dev, | 1423 | status = hid_get_class_descriptor(dev, |
1424 | interface->desc.bInterfaceNumber, | 1424 | interface->desc.bInterfaceNumber, |
1425 | HID_DT_REPORT, rdesc, hid->rsize); | 1425 | HID_DT_REPORT, rdesc, hid->dev_rsize); |
1426 | if (status < 0) { | 1426 | if (status < 0) { |
1427 | dbg_hid("reading report descriptor failed (post_reset)\n"); | 1427 | dbg_hid("reading report descriptor failed (post_reset)\n"); |
1428 | kfree(rdesc); | 1428 | kfree(rdesc); |
1429 | return 1; | 1429 | return 1; |
1430 | } | 1430 | } |
1431 | status = memcmp(rdesc, hid->rdesc, hid->rsize); | 1431 | status = memcmp(rdesc, hid->dev_rdesc, hid->dev_rsize); |
1432 | kfree(rdesc); | 1432 | kfree(rdesc); |
1433 | if (status != 0) { | 1433 | if (status != 0) { |
1434 | dbg_hid("report descriptor changed\n"); | 1434 | dbg_hid("report descriptor changed\n"); |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 991e85c7325c..11c7932dc7e6 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -70,12 +70,13 @@ static const struct hid_blacklist { | |||
70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, | 70 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, |
71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 71 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 72 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
73 | { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, | ||
73 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, | 74 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, |
74 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, | 75 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, |
75 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, | 76 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, |
76 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, | 77 | { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, |
77 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, | 78 | { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, |
78 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET }, | 79 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001, HID_QUIRK_NOGET }, |
79 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET }, | 80 | { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET }, |
80 | { USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET }, | 81 | { USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET }, |
81 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 82 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |