aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-input.c30
-rw-r--r--drivers/hid/hid-multitouch.c2
-rw-r--r--include/linux/hid.h2
3 files changed, 23 insertions, 11 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 7f552bfad32c..ebcc02a1c1c9 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;
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 07d3183fdde5..2bbc9545f5cc 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -122,7 +122,7 @@ struct mt_class mt_classes[] = {
122 { } 122 { }
123}; 123};
124 124
125static void mt_feature_mapping(struct hid_device *hdev, struct hid_input *hi, 125static void mt_feature_mapping(struct hid_device *hdev,
126 struct hid_field *field, struct hid_usage *usage) 126 struct hid_field *field, struct hid_usage *usage)
127{ 127{
128 if (usage->hid == HID_DG_INPUTMODE) { 128 if (usage->hid == HID_DG_INPUTMODE) {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index d91c25e253c8..fc5faf60f6df 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -638,7 +638,7 @@ struct hid_driver {
638 struct hid_input *hidinput, struct hid_field *field, 638 struct hid_input *hidinput, struct hid_field *field,
639 struct hid_usage *usage, unsigned long **bit, int *max); 639 struct hid_usage *usage, unsigned long **bit, int *max);
640 void (*feature_mapping)(struct hid_device *hdev, 640 void (*feature_mapping)(struct hid_device *hdev,
641 struct hid_input *hidinput, struct hid_field *field, 641 struct hid_field *field,
642 struct hid_usage *usage); 642 struct hid_usage *usage);
643#ifdef CONFIG_PM 643#ifdef CONFIG_PM
644 int (*suspend)(struct hid_device *hdev, pm_message_t message); 644 int (*suspend)(struct hid_device *hdev, pm_message_t message);