aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-02-24 13:30:59 -0500
committerJiri Kosina <jkosina@suse.cz>2011-03-01 11:25:39 -0500
commitf635bd11c8d332d917fb9a4cad3071b2357d5b2a (patch)
tree4b20ddba8054224336cc377a725203a5925088da /drivers/hid/hid-input.c
parent97e1efbbe1c8492ea4f804618e26b19325c879fe (diff)
HID: Do not create input devices for feature reports
When the multi input quirk is set, there is a new input device created for every feature report. Since the idea is to present features per hid device, not per input device, revert back to the original report loop and change the feature_mapping() callback to not take the input device as argument. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Tested-by: Benjamin Tissoires <benjmain.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 7f552bfad32..ebcc02a1c1c 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
830static 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;