summaryrefslogtreecommitdiff
path: root/usr/src/dkms_source_tree/hid-input.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-03-09 22:34:41 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-09 22:34:41 +0100
commitcde3defc861023c688877c9180df66a37746a204 (patch)
tree68033a8faa8cecdde494168a7f5a82d4df050a37 /usr/src/dkms_source_tree/hid-input.c
parente36747e4ddb1dc0f89a38798c0c669e10e5de5f2 (diff)
upgrade to natty (2.6.38-5)
Diffstat (limited to 'usr/src/dkms_source_tree/hid-input.c')
-rw-r--r--usr/src/dkms_source_tree/hid-input.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/usr/src/dkms_source_tree/hid-input.c b/usr/src/dkms_source_tree/hid-input.c
index d8d372b..05709e3 100644
--- a/usr/src/dkms_source_tree/hid-input.c
+++ b/usr/src/dkms_source_tree/hid-input.c
@@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
319 319
320 switch (field->application) { 320 switch (field->application) {
321 case HID_GD_MOUSE: 321 case HID_GD_MOUSE:
322 case HID_GD_POINTER: code += 0x110; break; 322 case HID_GD_POINTER: code += BTN_MOUSE; break;
323 case HID_GD_JOYSTICK: 323 case HID_GD_JOYSTICK:
324 if (code <= 0xf) 324 if (code <= 0xf)
325 code += BTN_JOYSTICK; 325 code += BTN_JOYSTICK;
326 else 326 else
327 code += BTN_TRIGGER_HAPPY; 327 code += BTN_TRIGGER_HAPPY;
328 break; 328 break;
329 case HID_GD_GAMEPAD: code += 0x130; break; 329 case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
330 default: 330 default:
331 switch (field->physical) { 331 switch (field->physical) {
332 case HID_GD_MOUSE: 332 case HID_GD_MOUSE:
333 case HID_GD_POINTER: code += 0x110; break; 333 case HID_GD_POINTER: code += BTN_MOUSE; break;
334 case HID_GD_JOYSTICK: code += 0x120; break; 334 case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
335 case HID_GD_GAMEPAD: code += 0x130; break; 335 case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
336 default: code += 0x100; 336 default: code += BTN_MISC;
337 } 337 }
338 } 338 }
339 339
@@ -817,14 +817,21 @@ static int hidinput_open(struct input_dev *dev)
817{ 817{
818 struct hid_device *hid = input_get_drvdata(dev); 818 struct hid_device *hid = input_get_drvdata(dev);
819 819
820 return hid->ll_driver->open(hid); 820 return hid_hw_open(hid);
821} 821}
822 822
823static void hidinput_close(struct input_dev *dev) 823static void hidinput_close(struct input_dev *dev)
824{ 824{
825 struct hid_device *hid = input_get_drvdata(dev); 825 struct hid_device *hid = input_get_drvdata(dev);
826 826
827 hid->ll_driver->close(hid); 827 hid_hw_close(hid);
828}
829
830static void report_features(struct hid_device *hid)
831{
832 /* no feature report support in this test, since it is in flux */
833
834 return;
828} 835}
829 836
830/* 837/*
@@ -839,7 +846,6 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
839 struct hid_input *hidinput = NULL; 846 struct hid_input *hidinput = NULL;
840 struct input_dev *input_dev; 847 struct input_dev *input_dev;
841 int i, j, k; 848 int i, j, k;
842 int max_report_type = HID_OUTPUT_REPORT;
843 849
844 INIT_LIST_HEAD(&hid->inputs); 850 INIT_LIST_HEAD(&hid->inputs);
845 851
@@ -856,10 +862,13 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
856 return -1; 862 return -1;
857 } 863 }
858 864
859 if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS) 865 report_features(hid);
860 max_report_type = HID_INPUT_REPORT; 866
867 for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++) {
868 if (k == HID_OUTPUT_REPORT &&
869 hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
870 continue;
861 871
862 for (k = HID_INPUT_REPORT; k <= max_report_type; k++)
863 list_for_each_entry(report, &hid->report_enum[k].report_list, list) { 872 list_for_each_entry(report, &hid->report_enum[k].report_list, list) {
864 873
865 if (!report->maxfield) 874 if (!report->maxfield)
@@ -871,7 +880,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
871 if (!hidinput || !input_dev) { 880 if (!hidinput || !input_dev) {
872 kfree(hidinput); 881 kfree(hidinput);
873 input_free_device(input_dev); 882 input_free_device(input_dev);
874 err_hid("Out of memory during hid input probe"); 883 hid_err(hid, "Out of memory during hid input probe\n");
875 goto out_unwind; 884 goto out_unwind;
876 } 885 }
877 886
@@ -912,6 +921,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
912 hidinput = NULL; 921 hidinput = NULL;
913 } 922 }
914 } 923 }
924 }
915 925
916 if (hidinput && input_register_device(hidinput->input)) 926 if (hidinput && input_register_device(hidinput->input))
917 goto out_cleanup; 927 goto out_cleanup;