diff options
Diffstat (limited to 'drivers/hid/hid-input.c')
| -rw-r--r-- | drivers/hid/hid-input.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index c7a6833f6821..25d180a24fc4 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
| @@ -31,9 +31,8 @@ | |||
| 31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
| 32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
| 33 | 33 | ||
| 34 | #undef DEBUG | ||
| 35 | |||
| 36 | #include <linux/hid.h> | 34 | #include <linux/hid.h> |
| 35 | #include <linux/hid-debug.h> | ||
| 37 | 36 | ||
| 38 | static int hid_pb_fnmode = 1; | 37 | static int hid_pb_fnmode = 1; |
| 39 | module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); | 38 | module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); |
| @@ -252,9 +251,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
| 252 | 251 | ||
| 253 | field->hidinput = hidinput; | 252 | field->hidinput = hidinput; |
| 254 | 253 | ||
| 255 | #ifdef DEBUG | 254 | #ifdef CONFIG_HID_DEBUG |
| 256 | printk(KERN_DEBUG "Mapping: "); | 255 | printk(KERN_DEBUG "Mapping: "); |
| 257 | resolv_usage(usage->hid); | 256 | hid_resolv_usage(usage->hid); |
| 258 | printk(" ---> "); | 257 | printk(" ---> "); |
| 259 | #endif | 258 | #endif |
| 260 | 259 | ||
| @@ -682,14 +681,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
| 682 | field->dpad = usage->code; | 681 | field->dpad = usage->code; |
| 683 | } | 682 | } |
| 684 | 683 | ||
| 685 | #ifdef DEBUG | 684 | hid_resolv_event(usage->type, usage->code); |
| 686 | resolv_event(usage->type, usage->code); | 685 | #ifdef CONFIG_HID_DEBUG |
| 687 | printk("\n"); | 686 | printk("\n"); |
| 688 | #endif | 687 | #endif |
| 689 | return; | 688 | return; |
| 690 | 689 | ||
| 691 | ignore: | 690 | ignore: |
| 692 | #ifdef DEBUG | 691 | #ifdef CONFIG_HID_DEBUG |
| 693 | printk("IGNORED\n"); | 692 | printk("IGNORED\n"); |
| 694 | #endif | 693 | #endif |
| 695 | return; | 694 | return; |
| @@ -804,6 +803,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int | |||
| 804 | } | 803 | } |
| 805 | EXPORT_SYMBOL_GPL(hidinput_find_field); | 804 | EXPORT_SYMBOL_GPL(hidinput_find_field); |
| 806 | 805 | ||
| 806 | static int hidinput_open(struct input_dev *dev) | ||
| 807 | { | ||
| 808 | struct hid_device *hid = dev->private; | ||
| 809 | return hid->hid_open(hid); | ||
| 810 | } | ||
| 811 | |||
| 812 | static void hidinput_close(struct input_dev *dev) | ||
| 813 | { | ||
| 814 | struct hid_device *hid = dev->private; | ||
| 815 | hid->hid_close(hid); | ||
| 816 | } | ||
| 817 | |||
| 807 | /* | 818 | /* |
| 808 | * Register the input device; print a message. | 819 | * Register the input device; print a message. |
| 809 | * Configure the input layer interface | 820 | * Configure the input layer interface |
| @@ -816,6 +827,7 @@ int hidinput_connect(struct hid_device *hid) | |||
| 816 | struct hid_input *hidinput = NULL; | 827 | struct hid_input *hidinput = NULL; |
| 817 | struct input_dev *input_dev; | 828 | struct input_dev *input_dev; |
| 818 | int i, j, k; | 829 | int i, j, k; |
| 830 | int max_report_type = HID_OUTPUT_REPORT; | ||
| 819 | 831 | ||
| 820 | INIT_LIST_HEAD(&hid->inputs); | 832 | INIT_LIST_HEAD(&hid->inputs); |
| 821 | 833 | ||
| @@ -828,7 +840,10 @@ int hidinput_connect(struct hid_device *hid) | |||
| 828 | if (i == hid->maxcollection) | 840 | if (i == hid->maxcollection) |
| 829 | return -1; | 841 | return -1; |
| 830 | 842 | ||
| 831 | for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++) | 843 | if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) |
| 844 | max_report_type = HID_INPUT_REPORT; | ||
| 845 | |||
| 846 | for (k = HID_INPUT_REPORT; k <= max_report_type; k++) | ||
| 832 | list_for_each_entry(report, &hid->report_enum[k].report_list, list) { | 847 | list_for_each_entry(report, &hid->report_enum[k].report_list, list) { |
| 833 | 848 | ||
| 834 | if (!report->maxfield) | 849 | if (!report->maxfield) |
| @@ -846,8 +861,8 @@ int hidinput_connect(struct hid_device *hid) | |||
| 846 | 861 | ||
| 847 | input_dev->private = hid; | 862 | input_dev->private = hid; |
| 848 | input_dev->event = hid->hidinput_input_event; | 863 | input_dev->event = hid->hidinput_input_event; |
| 849 | input_dev->open = hid->hidinput_open; | 864 | input_dev->open = hidinput_open; |
| 850 | input_dev->close = hid->hidinput_close; | 865 | input_dev->close = hidinput_close; |
| 851 | 866 | ||
| 852 | input_dev->name = hid->name; | 867 | input_dev->name = hid->name; |
| 853 | input_dev->phys = hid->phys; | 868 | input_dev->phys = hid->phys; |
