• Home
  • Raw
  • Download

Lines Matching refs:td

129 static void mt_post_parse_default_settings(struct mt_device *td);
130 static void mt_post_parse(struct mt_device *td);
172 static int cypress_compute_slot(struct mt_device *td) in cypress_compute_slot() argument
174 if (td->curdata.contactid != 0 || td->num_received == 0) in cypress_compute_slot()
175 return td->curdata.contactid; in cypress_compute_slot()
278 struct mt_device *td = hid_get_drvdata(hdev); in mt_show_quirks() local
280 return sprintf(buf, "%u\n", td->mtclass.quirks); in mt_show_quirks()
288 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_quirks() local
295 td->mtclass.quirks = val; in mt_set_quirks()
297 if (td->cc_index < 0) in mt_set_quirks()
298 td->mtclass.quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE; in mt_set_quirks()
316 struct mt_device *td = hid_get_drvdata(hdev); in mt_get_feature() local
328 if (td->mtclass.name != MT_CLS_WIN_8) in mt_get_feature()
353 struct mt_device *td = hid_get_drvdata(hdev); in mt_feature_mapping() local
363 if (td->inputmode < 0) { in mt_feature_mapping()
364 td->inputmode = field->report->id; in mt_feature_mapping()
365 td->inputmode_index = usage->usage_index; in mt_feature_mapping()
381 td->maxcontact_report_id = field->report->id; in mt_feature_mapping()
382 td->maxcontacts = field->value[0]; in mt_feature_mapping()
383 if (!td->maxcontacts && in mt_feature_mapping()
385 td->maxcontacts = field->logical_maximum; in mt_feature_mapping()
386 if (td->mtclass.maxcontacts) in mt_feature_mapping()
388 td->maxcontacts = td->mtclass.maxcontacts; in mt_feature_mapping()
399 td->is_buttonpad = true; in mt_feature_mapping()
420 static void mt_store_field(struct hid_usage *usage, struct mt_device *td, in mt_store_field() argument
423 struct mt_fields *f = td->fields; in mt_store_field()
435 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_mapping() local
436 struct mt_class *cls = &td->mtclass; in mt_touch_input_mapping()
441 td->mt_flags |= INPUT_MT_DIRECT; in mt_touch_input_mapping()
448 td->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_mapping()
449 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_touch_input_mapping()
454 td->buttons_count++; in mt_touch_input_mapping()
476 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
491 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
505 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
511 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
516 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
519 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
520 td->touches_by_report++; in mt_touch_input_mapping()
521 td->mt_report_id = field->report->id; in mt_touch_input_mapping()
529 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
540 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
547 mt_store_field(usage, td, hi); in mt_touch_input_mapping()
554 td->cc_index = field->index; in mt_touch_input_mapping()
555 td->cc_value_index = usage->usage_index; in mt_touch_input_mapping()
595 static int mt_compute_slot(struct mt_device *td, struct input_dev *input) in mt_compute_slot() argument
597 __s32 quirks = td->mtclass.quirks; in mt_compute_slot()
600 return td->curdata.contactid; in mt_compute_slot()
603 return cypress_compute_slot(td); in mt_compute_slot()
606 return td->num_received; in mt_compute_slot()
609 return td->curdata.contactid - 1; in mt_compute_slot()
611 return input_mt_get_slot_by_key(input, td->curdata.contactid); in mt_compute_slot()
618 static void mt_complete_slot(struct mt_device *td, struct input_dev *input) in mt_complete_slot() argument
620 if ((td->mtclass.quirks & MT_QUIRK_CONTACT_CNT_ACCURATE) && in mt_complete_slot()
621 td->num_received >= td->num_expected) in mt_complete_slot()
624 if (td->curvalid || (td->mtclass.quirks & MT_QUIRK_ALWAYS_VALID)) { in mt_complete_slot()
626 int slotnum = mt_compute_slot(td, input); in mt_complete_slot()
627 struct mt_slot *s = &td->curdata; in mt_complete_slot()
630 if (slotnum < 0 || slotnum >= td->maxcontacts) in mt_complete_slot()
633 if ((td->mtclass.quirks & MT_QUIRK_IGNORE_DUPLICATES) && mt) { in mt_complete_slot()
640 if (!(td->mtclass.quirks & MT_QUIRK_CONFIDENCE)) in mt_complete_slot()
667 td->num_received++; in mt_complete_slot()
674 static void mt_sync_frame(struct mt_device *td, struct input_dev *input) in mt_sync_frame() argument
678 td->num_received = 0; in mt_sync_frame()
694 struct mt_device *td = hid_get_drvdata(hid); in mt_process_mt_event() local
695 __s32 quirks = td->mtclass.quirks; in mt_process_mt_event()
702 td->curvalid = value; in mt_process_mt_event()
704 td->curdata.inrange_state = value; in mt_process_mt_event()
708 td->curvalid = value; in mt_process_mt_event()
709 td->curdata.touch_state = value; in mt_process_mt_event()
713 td->curdata.confidence_state = value; in mt_process_mt_event()
715 td->curvalid = value; in mt_process_mt_event()
718 td->curdata.contactid = value; in mt_process_mt_event()
721 td->curdata.p = value; in mt_process_mt_event()
725 td->curdata.cx = value; in mt_process_mt_event()
727 td->curdata.x = value; in mt_process_mt_event()
731 td->curdata.cy = value; in mt_process_mt_event()
733 td->curdata.y = value; in mt_process_mt_event()
736 td->curdata.w = value; in mt_process_mt_event()
739 td->curdata.h = value; in mt_process_mt_event()
756 if (usage->hid == td->last_slot_field) in mt_process_mt_event()
757 mt_complete_slot(td, field->hidinput->input); in mt_process_mt_event()
765 struct mt_device *td = hid_get_drvdata(hid); in mt_touch_report() local
774 if (td->cc_index >= 0) { in mt_touch_report()
775 struct hid_field *field = report->field[td->cc_index]; in mt_touch_report()
776 int value = field->value[td->cc_value_index]; in mt_touch_report()
778 td->num_expected = value; in mt_touch_report()
793 if (td->num_received >= td->num_expected) in mt_touch_report()
794 mt_sync_frame(td, report->field[0]->hidinput->input); in mt_touch_report()
800 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_configured() local
801 struct mt_class *cls = &td->mtclass; in mt_touch_input_configured()
805 if (!td->maxcontacts) in mt_touch_input_configured()
806 td->maxcontacts = MT_DEFAULT_MAXCONTACT; in mt_touch_input_configured()
808 mt_post_parse(td); in mt_touch_input_configured()
809 if (td->serial_maybe) in mt_touch_input_configured()
810 mt_post_parse_default_settings(td); in mt_touch_input_configured()
813 td->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_configured()
816 td->mt_flags |= INPUT_MT_DROP_UNUSED; in mt_touch_input_configured()
819 if ((td->mt_flags & INPUT_MT_POINTER) && (td->buttons_count == 1)) in mt_touch_input_configured()
820 td->is_buttonpad = true; in mt_touch_input_configured()
822 if (td->is_buttonpad) in mt_touch_input_configured()
825 ret = input_mt_init_slots(input, td->maxcontacts, td->mt_flags); in mt_touch_input_configured()
829 td->mt_flags = 0; in mt_touch_input_configured()
837 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapping() local
845 if (!td->mtclass.export_all_inputs && in mt_input_mapping()
861 (field->report->id != td->mt_report_id) && in mt_input_mapping()
862 (td->mt_report_id != -1)) in mt_input_mapping()
895 struct mt_device *td = hid_get_drvdata(hid); in mt_event() local
897 if (field->report->id == td->mt_report_id) in mt_event()
905 struct mt_device *td = hid_get_drvdata(hid); in mt_report() local
911 if (report->id == td->mt_report_id) in mt_report()
920 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_input_mode() local
923 struct mt_class *cls = &td->mtclass; in mt_set_input_mode()
927 if (td->inputmode < 0) in mt_set_input_mode()
931 r = re->report_id_hash[td->inputmode]; in mt_set_input_mode()
945 r->field[0]->value[td->inputmode_index] = td->inputmode_value; in mt_set_input_mode()
952 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_maxcontacts() local
957 if (td->maxcontact_report_id < 0) in mt_set_maxcontacts()
960 if (!td->mtclass.maxcontacts) in mt_set_maxcontacts()
964 r = re->report_id_hash[td->maxcontact_report_id]; in mt_set_maxcontacts()
966 max = td->mtclass.maxcontacts; in mt_set_maxcontacts()
976 static void mt_post_parse_default_settings(struct mt_device *td) in mt_post_parse_default_settings() argument
978 __s32 quirks = td->mtclass.quirks; in mt_post_parse_default_settings()
981 if (td->touches_by_report == 1) { in mt_post_parse_default_settings()
989 td->mtclass.quirks = quirks; in mt_post_parse_default_settings()
992 static void mt_post_parse(struct mt_device *td) in mt_post_parse() argument
994 struct mt_fields *f = td->fields; in mt_post_parse()
995 struct mt_class *cls = &td->mtclass; in mt_post_parse()
997 if (td->touches_by_report > 0) { in mt_post_parse()
998 int field_count_per_touch = f->length / td->touches_by_report; in mt_post_parse()
999 td->last_slot_field = f->usages[field_count_per_touch - 1]; in mt_post_parse()
1002 if (td->cc_index < 0) in mt_post_parse()
1008 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_configured() local
1014 if (hi->report->id == td->mt_report_id) { in mt_input_configured()
1079 struct mt_device *td; in mt_probe() local
1119 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); in mt_probe()
1120 if (!td) { in mt_probe()
1124 td->mtclass = *mtclass; in mt_probe()
1125 td->inputmode = -1; in mt_probe()
1126 td->maxcontact_report_id = -1; in mt_probe()
1127 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; in mt_probe()
1128 td->cc_index = -1; in mt_probe()
1129 td->mt_report_id = -1; in mt_probe()
1130 hid_set_drvdata(hdev, td); in mt_probe()
1132 td->fields = devm_kzalloc(&hdev->dev, sizeof(struct mt_fields), in mt_probe()
1134 if (!td->fields) { in mt_probe()
1140 td->serial_maybe = true; in mt_probe()
1156 devm_kfree(&hdev->dev, td->fields); in mt_probe()
1157 td->fields = NULL; in mt_probe()