hid-input.c (85cdaf524b7ddab627e7d15405693f2511ef7505) | hid-input.c (c500c9714011edab021591340042787722db9cf0) |
---|---|
1/* 2 * Copyright (c) 2000-2001 Vojtech Pavlik 3 * Copyright (c) 2006-2007 Jiri Kosina 4 * 5 * HID to Linux Input mapping 6 */ 7 8/* --- 376 unchanged lines hidden (view full) --- 385 goto ignore; 386 } 387 388 /* handle input mappings for quirky devices */ 389 ret = hidinput_mapping_quirks(usage, input, &bit, &max); 390 if (ret) 391 goto mapped; 392 | 1/* 2 * Copyright (c) 2000-2001 Vojtech Pavlik 3 * Copyright (c) 2006-2007 Jiri Kosina 4 * 5 * HID to Linux Input mapping 6 */ 7 8/* --- 376 unchanged lines hidden (view full) --- 385 goto ignore; 386 } 387 388 /* handle input mappings for quirky devices */ 389 ret = hidinput_mapping_quirks(usage, input, &bit, &max); 390 if (ret) 391 goto mapped; 392 |
393 if (device->driver->input_mapping) { 394 int ret = device->driver->input_mapping(device, hidinput, field, 395 usage, &bit, &max); 396 if (ret > 0) 397 goto mapped; 398 if (ret < 0) 399 goto ignore; 400 } 401 |
|
393 switch (usage->hid & HID_USAGE_PAGE) { 394 395 case HID_UP_UNDEFINED: 396 goto ignore; 397 398 case HID_UP_KEYBOARD: 399 400 set_bit(EV_REP, input->evbit); --- 349 unchanged lines hidden (view full) --- 750 map_rel(REL_MISC); 751 break; 752 } 753 map_abs(ABS_MISC); 754 break; 755 } 756 757mapped: | 402 switch (usage->hid & HID_USAGE_PAGE) { 403 404 case HID_UP_UNDEFINED: 405 goto ignore; 406 407 case HID_UP_KEYBOARD: 408 409 set_bit(EV_REP, input->evbit); --- 349 unchanged lines hidden (view full) --- 759 map_rel(REL_MISC); 760 break; 761 } 762 map_abs(ABS_MISC); 763 break; 764 } 765 766mapped: |
767 if (device->driver->input_mapped && device->driver->input_mapped(device, 768 hidinput, field, usage, &bit, &max) < 0) 769 goto ignore; 770 |
|
758 if (device->quirks & HID_QUIRK_MIGHTYMOUSE) { 759 if (usage->hid == HID_GD_Z) 760 map_rel(REL_HWHEEL); 761 else if (usage->code == BTN_1) 762 map_key(BTN_2); 763 else if (usage->code == BTN_2) 764 map_key(BTN_1); 765 } --- 190 unchanged lines hidden (view full) --- 956 return -1; 957} 958EXPORT_SYMBOL_GPL(hidinput_find_field); 959 960static int hidinput_open(struct input_dev *dev) 961{ 962 struct hid_device *hid = input_get_drvdata(dev); 963 | 771 if (device->quirks & HID_QUIRK_MIGHTYMOUSE) { 772 if (usage->hid == HID_GD_Z) 773 map_rel(REL_HWHEEL); 774 else if (usage->code == BTN_1) 775 map_key(BTN_2); 776 else if (usage->code == BTN_2) 777 map_key(BTN_1); 778 } --- 190 unchanged lines hidden (view full) --- 969 return -1; 970} 971EXPORT_SYMBOL_GPL(hidinput_find_field); 972 973static int hidinput_open(struct input_dev *dev) 974{ 975 struct hid_device *hid = input_get_drvdata(dev); 976 |
964 return hid->hid_open(hid); | 977 return hid->ll_driver->open(hid); |
965} 966 967static void hidinput_close(struct input_dev *dev) 968{ 969 struct hid_device *hid = input_get_drvdata(dev); 970 | 978} 979 980static void hidinput_close(struct input_dev *dev) 981{ 982 struct hid_device *hid = input_get_drvdata(dev); 983 |
971 hid->hid_close(hid); | 984 hid->ll_driver->close(hid); |
972} 973 974/* 975 * Register the input device; print a message. 976 * Configure the input layer interface 977 * Read all reports and initialize the absolute field values. 978 */ 979 --- 34 unchanged lines hidden (view full) --- 1014 if (!hidinput || !input_dev) { 1015 kfree(hidinput); 1016 input_free_device(input_dev); 1017 err_hid("Out of memory during hid input probe"); 1018 goto out_unwind; 1019 } 1020 1021 input_set_drvdata(input_dev, hid); | 985} 986 987/* 988 * Register the input device; print a message. 989 * Configure the input layer interface 990 * Read all reports and initialize the absolute field values. 991 */ 992 --- 34 unchanged lines hidden (view full) --- 1027 if (!hidinput || !input_dev) { 1028 kfree(hidinput); 1029 input_free_device(input_dev); 1030 err_hid("Out of memory during hid input probe"); 1031 goto out_unwind; 1032 } 1033 1034 input_set_drvdata(input_dev, hid); |
1022 input_dev->event = hid->hidinput_input_event; | 1035 input_dev->event = 1036 hid->ll_driver->hidinput_input_event; |
1023 input_dev->open = hidinput_open; 1024 input_dev->close = hidinput_close; 1025 input_dev->setkeycode = hidinput_setkeycode; 1026 input_dev->getkeycode = hidinput_getkeycode; 1027 1028 input_dev->name = hid->name; 1029 input_dev->phys = hid->phys; 1030 input_dev->uniq = hid->uniq; --- 55 unchanged lines hidden --- | 1037 input_dev->open = hidinput_open; 1038 input_dev->close = hidinput_close; 1039 input_dev->setkeycode = hidinput_setkeycode; 1040 input_dev->getkeycode = hidinput_getkeycode; 1041 1042 input_dev->name = hid->name; 1043 input_dev->phys = hid->phys; 1044 input_dev->uniq = hid->uniq; --- 55 unchanged lines hidden --- |