diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-06 14:56:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-06 14:56:37 -0800 |
commit | 2ac04a1597d9bca952dafcf8cbff4621884cb723 (patch) | |
tree | a6e20ab900dfc425a6b9c6bef9939383113d3072 /drivers/hid/hid-input.c | |
parent | 0c7d3757116c59b3eedd9aa6dfd7ae0a1341f5c2 (diff) | |
parent | a417a21e10831bca695b4ba9c74f4ddf5a95ac06 (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:
USB HID: handle multi-interface devices for Apple macbook pro properly
HID: move away from DEBUG defines in favor of CONFIG_HID_DEBUG
USB HID: fix bogus comment in hid_get_class_descriptor()
USB HID: remove hid_find_field_by_usage()
HID: API - fix leftovers of hidinput API in USB HID
HID: hid debug from hid-debug.h to hid layer
hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter
hid: quirk for multi-input devices with unneeded output reports
hid: allow force feedback for multi-input devices
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 c7a6833f682..25d180a24fc 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -31,9 +31,8 @@ #include <linux/slab.h> #include <linux/kernel.h> -#undef DEBUG - #include <linux/hid.h> +#include <linux/hid-debug.h> static int hid_pb_fnmode = 1; 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 field->hidinput = hidinput; -#ifdef DEBUG +#ifdef CONFIG_HID_DEBUG printk(KERN_DEBUG "Mapping: "); - resolv_usage(usage->hid); + hid_resolv_usage(usage->hid); printk(" ---> "); #endif @@ -682,14 +681,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel field->dpad = usage->code; } -#ifdef DEBUG - resolv_event(usage->type, usage->code); + hid_resolv_event(usage->type, usage->code); +#ifdef CONFIG_HID_DEBUG printk("\n"); #endif return; ignore: -#ifdef DEBUG +#ifdef CONFIG_HID_DEBUG printk("IGNORED\n"); #endif return; @@ -804,6 +803,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int } EXPORT_SYMBOL_GPL(hidinput_find_field); +static int hidinput_open(struct input_dev *dev) +{ + struct hid_device *hid = dev->private; + return hid->hid_open(hid); +} + +static void hidinput_close(struct input_dev *dev) +{ + struct hid_device *hid = dev->private; + hid->hid_close(hid); +} + /* * Register the input device; print a message. * Configure the input layer interface @@ -816,6 +827,7 @@ int hidinput_connect(struct hid_device *hid) struct hid_input *hidinput = NULL; struct input_dev *input_dev; int i, j, k; + int max_report_type = HID_OUTPUT_REPORT; INIT_LIST_HEAD(&hid->inputs); @@ -828,7 +840,10 @@ int hidinput_connect(struct hid_device *hid) if (i == hid->maxcollection) return -1; - for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++) + if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) + max_report_type = HID_INPUT_REPORT; + + for (k = HID_INPUT_REPORT; k <= max_report_type; k++) list_for_each_entry(report, &hid->report_enum[k].report_list, list) { if (!report->maxfield) @@ -846,8 +861,8 @@ int hidinput_connect(struct hid_device *hid) input_dev->private = hid; input_dev->event = hid->hidinput_input_event; - input_dev->open = hid->hidinput_open; - input_dev->close = hid->hidinput_close; + input_dev->open = hidinput_open; + input_dev->close = hidinput_close; input_dev->name = hid->name; input_dev->phys = hid->phys; |