aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@enac.fr>2011-01-07 17:44:32 -0500
committerJiri Kosina <jkosina@suse.cz>2011-01-11 15:26:53 -0500
commit0d2689c0f054f6a8bf3115d6386bd9c2d65dc44b (patch)
tree09550f95283383e63b216d19f39406c7e2881afe /drivers/hid
parent31b6ca0af758a88e5e769b48cc6dde037ee37b96 (diff)
HID: add feature_mapping callback
Currently hid doesn't export the features it knows to the specific modules. Some information can be really important in such features: MosArt and Cypress devices are by default not in a multitouch mode. We have to send the value 2 on the right feature. This patch exports to the module the features report so they can find the right feature to set up the correct mode. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-input.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index d8d372bae3cc..8703b2cd27ca 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -290,6 +290,14 @@ 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
293 if (device->driver->input_mapping) { 301 if (device->driver->input_mapping) {
294 int ret = device->driver->input_mapping(device, hidinput, field, 302 int ret = device->driver->input_mapping(device, hidinput, field,
295 usage, &bit, &max); 303 usage, &bit, &max);
@@ -839,7 +847,6 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
839 struct hid_input *hidinput = NULL; 847 struct hid_input *hidinput = NULL;
840 struct input_dev *input_dev; 848 struct input_dev *input_dev;
841 int i, j, k; 849 int i, j, k;
842 int max_report_type = HID_OUTPUT_REPORT;
843 850
844 INIT_LIST_HEAD(&hid->inputs); 851 INIT_LIST_HEAD(&hid->inputs);
845 852
@@ -856,10 +863,11 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
856 return -1; 863 return -1;
857 } 864 }
858 865
859 if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) 866 for (k = HID_INPUT_REPORT; k <= HID_FEATURE_REPORT; k++) {
860 max_report_type = HID_INPUT_REPORT; 867 if (k == HID_OUTPUT_REPORT &&
868 hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
869 continue;
861 870
862 for (k = HID_INPUT_REPORT; k <= max_report_type; k++)
863 list_for_each_entry(report, &hid->report_enum[k].report_list, list) { 871 list_for_each_entry(report, &hid->report_enum[k].report_list, list) {
864 872
865 if (!report->maxfield) 873 if (!report->maxfield)
@@ -912,6 +920,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
912 hidinput = NULL; 920 hidinput = NULL;
913 } 921 }
914 } 922 }
923 }
915 924
916 if (hidinput && input_register_device(hidinput->input)) 925 if (hidinput && input_register_device(hidinput->input))
917 goto out_cleanup; 926 goto out_cleanup;