diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 13:35:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-18 13:35:30 -0400 |
commit | 7fd23a24717a327a66f3c32d11a20a2f169c824f (patch) | |
tree | 62a731f3edac9e58427fc27396ad5da8804fa579 /drivers/hid/hid-input.c | |
parent | 0a95d92c0054e74fb79607ac2df958b7bf295706 (diff) | |
parent | 65b06194c9c9f41bc07ac6a6d42edb4b9e43fea4 (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: (48 commits)
HID: add support for Logitech Driving Force Pro wheel
HID: hid-ortek: remove spurious reference
HID: add support for Ortek PKB-1700
HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor'
HID: hid-ntrig: init settle and mode check
HID: merge hid-egalax into hid-multitouch
HID: hid-multitouch: Send events per slot if CONTACTCOUNT is missing
HID: ntrig remove if and drop an indent
HID: ACRUX - activate the device immediately after binding
HID: ntrig: apply NO_INIT_REPORTS quirk
HID: hid-magicmouse: Correct touch orientation direction
HID: ntrig don't dereference unclaimed hidinput
HID: Do not create input devices for feature reports
HID: bt hidp: send Output reports using SET_REPORT on the Control channel
HID: hid-sony.c: Fix sending Output reports to the Sixaxis
HID: add support for Keytouch IEC 60945
HID: Add HID Report Descriptor to sysfs
HID: add IRTOUCH infrared USB to hid_have_special_driver
HID: kernel oops in out_cleanup in function hidinput_connect
HID: Add teletext/color keys - gyration remote - EU version (GYAR3101CKDE)
...
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 7f552bfad32c..cd74203c8178 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -290,14 +290,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
290 | goto ignore; | 290 | goto ignore; |
291 | } | 291 | } |
292 | 292 | ||
293 | if (field->report_type == HID_FEATURE_REPORT) { | ||
294 | if (device->driver->feature_mapping) { | ||
295 | device->driver->feature_mapping(device, hidinput, field, | ||
296 | usage); | ||
297 | } | ||
298 | goto ignore; | ||
299 | } | ||
300 | |||
301 | if (device->driver->input_mapping) { | 293 | if (device->driver->input_mapping) { |
302 | int ret = device->driver->input_mapping(device, hidinput, field, | 294 | int ret = device->driver->input_mapping(device, hidinput, field, |
303 | usage, &bit, &max); | 295 | usage, &bit, &max); |
@@ -835,6 +827,24 @@ static void hidinput_close(struct input_dev *dev) | |||
835 | hid_hw_close(hid); | 827 | hid_hw_close(hid); |
836 | } | 828 | } |
837 | 829 | ||
830 | static void report_features(struct hid_device *hid) | ||
831 | { | ||
832 | struct hid_driver *drv = hid->driver; | ||
833 | struct hid_report_enum *rep_enum; | ||
834 | struct hid_report *rep; | ||
835 | int i, j; | ||
836 | |||
837 | if (!drv->feature_mapping) | ||
838 | return; | ||
839 | |||
840 | rep_enum = &hid->report_enum[HID_FEATURE_REPORT]; | ||
841 | list_for_each_entry(rep, &rep_enum->report_list, list) | ||
842 | for (i = 0; i < rep->maxfield; i++) | ||
843 | for (j = 0; j < rep->field[i]->maxusage; j++) | ||
844 | drv->feature_mapping(hid, rep->field[i], | ||
845 | rep->field[i]->usage + j); | ||
846 | } | ||
847 | |||
838 | /* | 848 | /* |
839 | * Register the input device; print a message. | 849 | * Register the input device; print a message. |
840 | * Configure the input layer interface | 850 | * Configure the input layer interface |
@@ -863,7 +873,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
863 | return -1; | 873 | return -1; |
864 | } | 874 | } |
865 | 875 | ||
866 | for (k = HID_INPUT_REPORT; k <= HID_FEATURE_REPORT; k++) { | 876 | report_features(hid); |
877 | |||
878 | for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++) { | ||
867 | if (k == HID_OUTPUT_REPORT && | 879 | if (k == HID_OUTPUT_REPORT && |
868 | hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) | 880 | hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) |
869 | continue; | 881 | continue; |
@@ -928,6 +940,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
928 | return 0; | 940 | return 0; |
929 | 941 | ||
930 | out_cleanup: | 942 | out_cleanup: |
943 | list_del(&hidinput->list); | ||
931 | input_free_device(hidinput->input); | 944 | input_free_device(hidinput->input); |
932 | kfree(hidinput); | 945 | kfree(hidinput); |
933 | out_unwind: | 946 | out_unwind: |