/drivers/hid/ |
D | hid-input.c | 63 #define map_abs(c) hid_map_usage(hidinput, usage, &bit, &max, EV_ABS, (c)) 64 #define map_rel(c) hid_map_usage(hidinput, usage, &bit, &max, EV_REL, (c)) 65 #define map_key(c) hid_map_usage(hidinput, usage, &bit, &max, EV_KEY, (c)) 66 #define map_led(c) hid_map_usage(hidinput, usage, &bit, &max, EV_LED, (c)) 68 #define map_abs_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ 70 #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ 73 static bool match_scancode(struct hid_usage *usage, in match_scancode() argument 76 return (usage->hid & (HID_USAGE_PAGE | HID_USAGE)) == scancode; in match_scancode() 79 static bool match_keycode(struct hid_usage *usage, in match_keycode() argument 85 return (usage->type == EV_KEY && usage->code == keycode); in match_keycode() [all …]
|
D | hid-microsoft.c | 58 #define ms_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 60 static int ms_ergonomy_kb_quirk(struct hid_input *hi, struct hid_usage *usage, in ms_ergonomy_kb_quirk() argument 65 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) { in ms_ergonomy_kb_quirk() 66 switch (usage->hid & HID_USAGE) { in ms_ergonomy_kb_quirk() 81 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) in ms_ergonomy_kb_quirk() 84 switch (usage->hid & HID_USAGE) { in ms_ergonomy_kb_quirk() 95 hid_map_usage_clear(hi, usage, bit, max, EV_REL, REL_WHEEL); in ms_ergonomy_kb_quirk() 122 static int ms_presenter_8k_quirk(struct hid_input *hi, struct hid_usage *usage, in ms_presenter_8k_quirk() argument 125 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) in ms_presenter_8k_quirk() 129 switch (usage->hid & HID_USAGE) { in ms_presenter_8k_quirk() [all …]
|
D | hid-lg.c | 438 #define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 442 struct hid_usage *usage, unsigned long **bit, int *max) in lg_ultrax_remote_mapping() argument 444 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in lg_ultrax_remote_mapping() 448 switch (usage->hid & HID_USAGE) { in lg_ultrax_remote_mapping() 474 static int lg_dinovo_mapping(struct hid_input *hi, struct hid_usage *usage, in lg_dinovo_mapping() argument 477 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in lg_dinovo_mapping() 480 switch (usage->hid & HID_USAGE) { in lg_dinovo_mapping() 490 static int lg_wireless_mapping(struct hid_input *hi, struct hid_usage *usage, in lg_wireless_mapping() argument 493 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in lg_wireless_mapping() 496 switch (usage->hid & HID_USAGE) { in lg_wireless_mapping() [all …]
|
D | hid-multitouch.c | 351 struct hid_field *field, struct hid_usage *usage) in mt_feature_mapping() argument 355 switch (usage->hid) { in mt_feature_mapping() 358 if (usage->usage_index >= field->report_count) { in mt_feature_mapping() 365 td->inputmode_index = usage->usage_index; in mt_feature_mapping() 392 if (usage->usage_index >= field->report_count) { in mt_feature_mapping() 398 if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD) in mt_feature_mapping() 404 if (usage->usage_index == 0) in mt_feature_mapping() 420 static void mt_store_field(struct hid_usage *usage, struct mt_device *td, in mt_store_field() argument 428 f->usages[f->length++] = usage->hid; in mt_store_field() 432 struct hid_field *field, struct hid_usage *usage, in mt_touch_input_mapping() argument [all …]
|
D | hid-gyration.c | 25 #define gy_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 28 struct hid_field *field, struct hid_usage *usage, in gyration_input_mapping() argument 31 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in gyration_input_mapping() 35 switch (usage->hid & HID_USAGE) { in gyration_input_mapping() 58 struct hid_usage *usage, __s32 value) in gyration_event() argument 64 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_GENDESK && in gyration_event() 65 (usage->hid & 0xff) == 0x82) { in gyration_event() 67 input_event(input, usage->type, usage->code, 1); in gyration_event() 69 input_event(input, usage->type, usage->code, 0); in gyration_event()
|
D | hid-ezkey.c | 25 #define ez_map_rel(c) hid_map_usage(hi, usage, bit, max, EV_REL, (c)) 26 #define ez_map_key(c) hid_map_usage(hi, usage, bit, max, EV_KEY, (c)) 29 struct hid_field *field, struct hid_usage *usage, in ez_input_mapping() argument 32 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in ez_input_mapping() 35 switch (usage->hid & HID_USAGE) { in ez_input_mapping() 51 struct hid_usage *usage, __s32 value) in ez_event() argument 54 !usage->type) in ez_event() 58 if (usage->type == EV_REL && usage->code == REL_HWHEEL) { in ez_event() 60 input_event(input, usage->type, REL_WHEEL, -value); in ez_event()
|
D | hid-a4tech.c | 36 struct hid_field *field, struct hid_usage *usage, in a4_input_mapped() argument 41 if (usage->type == EV_REL && usage->code == REL_WHEEL) in a4_input_mapped() 44 if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) in a4_input_mapped() 51 struct hid_usage *usage, __s32 value) in a4_event() argument 57 !usage->type) in a4_event() 63 if (usage->type == EV_REL && usage->code == REL_WHEEL) { in a4_event() 68 if (usage->hid == 0x000100b8) { in a4_event() 75 if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) { in a4_event() 80 if (usage->code == REL_WHEEL && a4->hw_wheel) { in a4_event() 81 input_event(input, usage->type, REL_HWHEEL, value); in a4_event()
|
D | hid-icade.c | 168 struct hid_usage *usage, __s32 value) in icade_event() argument 173 !usage->type) in icade_event() 180 trans = icade_find_translation(usage->hid & HID_USAGE); in icade_event() 185 input_event(field->hidinput->input, usage->type, in icade_event() 192 struct hid_field *field, struct hid_usage *usage, in icade_input_mapping() argument 197 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_KEYBOARD) { in icade_input_mapping() 198 trans = icade_find_translation(usage->hid & HID_USAGE); in icade_input_mapping() 203 hid_map_usage(hi, usage, bit, max, EV_KEY, trans->to); in icade_input_mapping() 215 struct hid_field *field, struct hid_usage *usage, in icade_input_mapped() argument 218 if (usage->type == EV_KEY) in icade_input_mapped() [all …]
|
D | hid-apple.c | 180 struct hid_usage *usage, __s32 value) in hidinput_apple_event() argument 187 if (usage->code == KEY_FN) { in hidinput_apple_event() 189 input_event(input, usage->type, usage->code, value); in hidinput_apple_event() 202 trans = apple_find_translation (table, usage->code); in hidinput_apple_event() 230 input_event(input, usage->type, code, value); in hidinput_apple_event() 235 (test_bit(usage->code, asc->pressed_numlock) || in hidinput_apple_event() 238 usage->code); in hidinput_apple_event() 242 set_bit(usage->code, in hidinput_apple_event() 245 clear_bit(usage->code, in hidinput_apple_event() 248 input_event(input, usage->type, trans->to, in hidinput_apple_event() [all …]
|
D | hid-lenovo.c | 45 #define map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c)) 78 struct hid_usage *usage, unsigned long **bit, int *max) in lenovo_input_mapping_tpkbd() argument 80 if (usage->hid == (HID_UP_BUTTON | 0x0010)) { in lenovo_input_mapping_tpkbd() 91 struct hid_usage *usage, unsigned long **bit, int *max) in lenovo_input_mapping_cptkbd() argument 94 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR || in lenovo_input_mapping_cptkbd() 95 (usage->hid & HID_USAGE_PAGE) == HID_UP_LNVENDOR) { in lenovo_input_mapping_cptkbd() 96 switch (usage->hid & HID_USAGE) { in lenovo_input_mapping_cptkbd() 132 if (usage->hid == HID_GD_WHEEL) in lenovo_input_mapping_cptkbd() 134 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON && in lenovo_input_mapping_cptkbd() 135 (usage->hid & HID_USAGE) == 0x003) in lenovo_input_mapping_cptkbd() [all …]
|
D | hid-plantronics.c | 41 (usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) 56 struct hid_usage *usage, in plantronics_input_mapping() argument 90 switch (usage->hid) { in plantronics_input_mapping() 113 usage->hid, field->application); in plantronics_input_mapping() 117 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, mapped_key); in plantronics_input_mapping() 119 usage->hid, field->application, mapped_key); in plantronics_input_mapping() 124 struct hid_usage *usage, __s32 value) in plantronics_event() argument 158 col_page = hdev->collection[i].usage & HID_USAGE_PAGE; in plantronics_device_type() 160 plt_type = hdev->collection[i].usage; in plantronics_device_type() 164 plt_type = hdev->collection[i].usage; in plantronics_device_type()
|
D | hid-cypress.c | 87 struct hid_field *field, struct hid_usage *usage, in cp_input_mapped() argument 95 if (usage->type == EV_REL && usage->code == REL_WHEEL) in cp_input_mapped() 97 if (usage->hid == 0x00090005) in cp_input_mapped() 104 struct hid_usage *usage, __s32 value) in cp_event() argument 109 !usage->type || !(quirks & CP_2WHEEL_MOUSE_HACK)) in cp_event() 112 if (usage->hid == 0x00090005) { in cp_event() 121 if (usage->code == REL_WHEEL && (quirks & CP_2WHEEL_MOUSE_HACK_ON)) { in cp_event() 124 input_event(input, usage->type, REL_HWHEEL, value); in cp_event()
|
D | hid-corsair.c | 46 static int corsair_usage_to_gkey(unsigned int usage) in corsair_usage_to_gkey() argument 49 if (usage >= 0xd0 && usage <= 0xdf) in corsair_usage_to_gkey() 50 return usage - 0xd0 + 1; in corsair_usage_to_gkey() 52 if (usage >= 0xe8 && usage <= 0xe9) in corsair_usage_to_gkey() 53 return usage - 0xe8 + 17; in corsair_usage_to_gkey() 604 struct hid_usage *usage, __s32 value) in corsair_event() argument 611 switch (usage->hid & HID_USAGE) { in corsair_event() 628 struct hid_usage *usage, unsigned long **bit, in corsair_input_mapping() argument 633 gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE); in corsair_input_mapping() 635 hid_map_usage_clear(input, usage, bit, max, EV_KEY, in corsair_input_mapping() [all …]
|
D | hid-petalynx.c | 38 #define pl_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 41 struct hid_field *field, struct hid_usage *usage, in pl_input_mapping() argument 44 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_LOGIVENDOR) { in pl_input_mapping() 45 switch (usage->hid & HID_USAGE) { in pl_input_mapping() 57 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) { in pl_input_mapping() 58 switch (usage->hid & HID_USAGE) { in pl_input_mapping()
|
D | hid-tivo.c | 22 #define tivo_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 26 struct hid_field *field, struct hid_usage *usage, in tivo_input_mapping() argument 29 switch (usage->hid & HID_USAGE_PAGE) { in tivo_input_mapping() 31 switch (usage->hid & HID_USAGE) { in tivo_input_mapping() 45 switch (usage->hid & HID_USAGE) { in tivo_input_mapping()
|
D | hid-samsung.c | 98 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c)) 101 struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, in samsung_kbd_mouse_input_mapping() argument 107 if (1 != ifnum || HID_UP_CONSUMER != (usage->hid & HID_USAGE_PAGE)) in samsung_kbd_mouse_input_mapping() 111 usage->hid & HID_USAGE); in samsung_kbd_mouse_input_mapping() 113 switch (usage->hid & HID_USAGE) { in samsung_kbd_mouse_input_mapping() 142 struct hid_field *field, struct hid_usage *usage, in samsung_input_mapping() argument 149 hi, field, usage, bit, max); in samsung_input_mapping()
|
D | hid-xinmo.c | 29 struct hid_usage *usage, __s32 value) in xinmo_event() argument 31 switch (usage->code) { in xinmo_event() 37 input_event(field->hidinput->input, usage->type, in xinmo_event() 38 usage->code, -1); in xinmo_event()
|
D | hid-kensington.c | 21 #define ks_map_key(c) hid_map_usage(hi, usage, bit, max, EV_KEY, (c)) 24 struct hid_field *field, struct hid_usage *usage, in ks_input_mapping() argument 27 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) in ks_input_mapping() 30 switch (usage->hid & HID_USAGE) { in ks_input_mapping()
|
D | hid-saitek.c | 155 struct hid_usage *usage, __s32 value) in saitek_event() argument 160 if (usage->type == EV_KEY && value && in saitek_event() 162 usage->code - BTN_MOUSE == 10) || in saitek_event() 164 usage->code - BTN_MOUSE == 15))) { in saitek_event() 166 input_report_key(input, usage->code, 1); in saitek_event() 169 input_report_key(input, usage->code, 0); in saitek_event()
|
D | hid-lcpower.c | 21 #define ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 24 struct hid_field *field, struct hid_usage *usage, in ts_input_mapping() argument 27 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) in ts_input_mapping() 30 switch (usage->hid & HID_USAGE) { in ts_input_mapping()
|
D | hid-gfrm.c | 32 struct hid_field *field, struct hid_usage *usage, in gfrm_input_mapping() argument 38 if (usage->hid == (HID_UP_CONSUMER | 0x4)) { in gfrm_input_mapping() 40 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_INFO); in gfrm_input_mapping() 44 if (usage->hid == (HID_UP_CONSUMER | 0x41)) { in gfrm_input_mapping() 46 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_OK); in gfrm_input_mapping()
|
D | hid-monterey.c | 34 #define mr_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 37 struct hid_field *field, struct hid_usage *usage, in mr_input_mapping() argument 40 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in mr_input_mapping() 43 switch (usage->hid & HID_USAGE) { in mr_input_mapping()
|
D | hid-sunplus.c | 36 #define sp_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 39 struct hid_field *field, struct hid_usage *usage, in sp_input_mapping() argument 42 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in sp_input_mapping() 45 switch (usage->hid & HID_USAGE) { in sp_input_mapping()
|
D | hid-cherry.c | 39 #define ch_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ 42 struct hid_field *field, struct hid_usage *usage, in ch_input_mapping() argument 45 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) in ch_input_mapping() 48 switch (usage->hid & HID_USAGE) { in ch_input_mapping()
|
/drivers/hid/usbhid/ |
D | hid-pidff.c | 220 static void pidff_set(struct pidff_usage *usage, u16 value) in pidff_set() argument 222 usage->value[0] = pidff_rescale(value, 0xffff, usage->field); in pidff_set() 223 pr_debug("calculated from %d to %d\n", value, usage->value[0]); in pidff_set() 226 static void pidff_set_signed(struct pidff_usage *usage, s16 value) in pidff_set_signed() argument 228 if (usage->field->logical_minimum < 0) in pidff_set_signed() 229 usage->value[0] = pidff_rescale_signed(value, usage->field); in pidff_set_signed() 232 usage->value[0] = in pidff_set_signed() 233 pidff_rescale(-value, 0x8000, usage->field); in pidff_set_signed() 235 usage->value[0] = in pidff_set_signed() 236 pidff_rescale(value, 0x7fff, usage->field); in pidff_set_signed() [all …]
|