Lines Matching refs:usage
481 struct hid_field *field, struct hid_usage *usage) in mt_feature_mapping() argument
485 switch (usage->hid) { in mt_feature_mapping()
499 if (usage->usage_index >= field->report_count) { in mt_feature_mapping()
505 if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD) in mt_feature_mapping()
511 if (usage->usage_index == 0) in mt_feature_mapping()
530 struct mt_usages *usage; in mt_allocate_usage() local
532 usage = devm_kzalloc(&hdev->dev, sizeof(*usage), GFP_KERNEL); in mt_allocate_usage()
533 if (!usage) in mt_allocate_usage()
537 usage->x = DEFAULT_ZERO; in mt_allocate_usage()
538 usage->y = DEFAULT_ZERO; in mt_allocate_usage()
539 usage->cx = DEFAULT_ZERO; in mt_allocate_usage()
540 usage->cy = DEFAULT_ZERO; in mt_allocate_usage()
541 usage->p = DEFAULT_ZERO; in mt_allocate_usage()
542 usage->w = DEFAULT_ZERO; in mt_allocate_usage()
543 usage->h = DEFAULT_ZERO; in mt_allocate_usage()
544 usage->a = DEFAULT_ZERO; in mt_allocate_usage()
545 usage->contactid = DEFAULT_ZERO; in mt_allocate_usage()
546 usage->tip_state = DEFAULT_FALSE; in mt_allocate_usage()
547 usage->inrange_state = DEFAULT_FALSE; in mt_allocate_usage()
548 usage->confidence_state = DEFAULT_TRUE; in mt_allocate_usage()
550 list_add_tail(&usage->list, &application->mt_usages); in mt_allocate_usage()
552 return usage; in mt_allocate_usage()
639 if (field->usage[n].hid == HID_DG_CONTACTID) { in mt_allocate_report_data()
675 struct mt_usages *usage; in mt_store_field() local
679 usage = mt_allocate_usage(hdev, application); in mt_store_field()
681 usage = list_last_entry(&application->mt_usages, in mt_store_field()
685 if (!usage) in mt_store_field()
688 target = (__s32 **)((char *)usage + offset); in mt_store_field()
694 if (usage->contactid == DEFAULT_ZERO || in mt_store_field()
695 usage->x == DEFAULT_ZERO || in mt_store_field()
696 usage->y == DEFAULT_ZERO) { in mt_store_field()
701 usage = mt_allocate_usage(hdev, application); in mt_store_field()
702 if (!usage) in mt_store_field()
705 target = (__s32 **)((char *)usage + offset); in mt_store_field()
713 &field->value[usage->usage_index], \
717 struct hid_field *field, struct hid_usage *usage, in mt_touch_input_mapping() argument
729 (usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) { in mt_touch_input_mapping()
735 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) in mt_touch_input_mapping()
738 if (usage->usage_index) in mt_touch_input_mapping()
739 prev_usage = &field->usage[usage->usage_index - 1]; in mt_touch_input_mapping()
741 switch (usage->hid & HID_USAGE_PAGE) { in mt_touch_input_mapping()
744 switch (usage->hid) { in mt_touch_input_mapping()
746 if (prev_usage && (prev_usage->hid == usage->hid)) { in mt_touch_input_mapping()
771 if (prev_usage && (prev_usage->hid == usage->hid)) { in mt_touch_input_mapping()
786 switch (usage->hid) { in mt_touch_input_mapping()
850 app->scantime = &field->value[usage->usage_index]; in mt_touch_input_mapping()
855 app->raw_cc = &field->value[usage->usage_index]; in mt_touch_input_mapping()
882 code = BTN_MOUSE + ((usage->hid - 1) & HID_USAGE); in mt_touch_input_mapping()
889 (usage->hid & HID_USAGE) > 1) in mt_touch_input_mapping()
893 code = BTN_0 + ((usage->hid - 1) & HID_USAGE); in mt_touch_input_mapping()
895 hid_map_usage(hi, usage, bit, max, EV_KEY, code); in mt_touch_input_mapping()
999 struct hid_usage *usage, __s32 value) in mt_touch_event() argument
1003 hid->hiddev_hid_event(hid, field, usage, value); in mt_touch_event()
1159 struct hid_usage *usage, in mt_process_mt_event() argument
1166 if (!usage->type || !(hid->claimed & HID_CLAIMED_INPUT)) in mt_process_mt_event()
1186 if (usage->type == EV_KEY && usage->code == BTN_LEFT) { in mt_process_mt_event()
1192 input_event(input, usage->type, usage->code, value); in mt_process_mt_event()
1259 &field->usage[n], field->value[n], in mt_touch_report()
1340 #define mt_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, \
1343 struct hid_field *field, struct hid_usage *usage, in mt_input_mapping() argument
1384 (usage->hid & HID_USAGE_PAGE) == HID_UP_CUSTOM) { in mt_input_mapping()
1388 switch (usage->hid & HID_USAGE) { in mt_input_mapping()
1401 return mt_touch_input_mapping(hdev, hi, field, usage, bit, max, in mt_input_mapping()
1416 struct hid_field *field, struct hid_usage *usage, in mt_input_mapped() argument
1433 struct hid_usage *usage, __s32 value) in mt_event() argument
1440 return mt_touch_event(hid, field, usage, value); in mt_event()
1464 struct hid_usage *usage, in mt_need_to_apply_feature() argument
1473 unsigned int index = usage->usage_index; in mt_need_to_apply_feature()
1478 switch (usage->hid) { in mt_need_to_apply_feature()
1538 struct hid_usage *usage; in mt_set_modes() local
1553 usage = &rep->field[i]->usage[j]; in mt_set_modes()
1557 usage, in mt_set_modes()
1654 static void mt_fix_const_field(struct hid_field *field, unsigned int usage) in mt_fix_const_field() argument
1656 if (field->usage[0].hid != usage || in mt_fix_const_field()
1664 static void mt_fix_const_fields(struct hid_device *hdev, unsigned int usage) in mt_fix_const_fields() argument
1678 mt_fix_const_field(report->field[i], usage); in mt_fix_const_fields()