Lines Matching refs:td

171 static void mt_post_parse_default_settings(struct mt_device *td,
173 static void mt_post_parse(struct mt_device *td, struct mt_application *app);
374 struct mt_device *td = hid_get_drvdata(hdev); in mt_show_quirks() local
376 return sprintf(buf, "%u\n", td->mtclass.quirks); in mt_show_quirks()
384 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_quirks() local
392 td->mtclass.quirks = val; in mt_set_quirks()
394 list_for_each_entry(application, &td->applications, list) { in mt_set_quirks()
449 struct mt_device *td = hid_get_drvdata(hdev); in mt_feature_mapping() local
455 td->maxcontacts = field->value[0]; in mt_feature_mapping()
456 if (!td->maxcontacts && in mt_feature_mapping()
458 td->maxcontacts = field->logical_maximum; in mt_feature_mapping()
459 if (td->mtclass.maxcontacts) in mt_feature_mapping()
461 td->maxcontacts = td->mtclass.maxcontacts; in mt_feature_mapping()
472 td->is_buttonpad = true; in mt_feature_mapping()
521 static struct mt_application *mt_allocate_application(struct mt_device *td, in mt_allocate_application() argument
527 mt_application = devm_kzalloc(&td->hdev->dev, sizeof(*mt_application), in mt_allocate_application()
543 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_allocate_application()
548 mt_application->quirks = td->mtclass.quirks; in mt_allocate_application()
551 list_add_tail(&mt_application->list, &td->applications); in mt_allocate_application()
556 static struct mt_application *mt_find_application(struct mt_device *td, in mt_find_application() argument
562 list_for_each_entry(tmp, &td->applications, list) { in mt_find_application()
564 if (!(td->mtclass.quirks & MT_QUIRK_SEPARATE_APP_REPORT) || in mt_find_application()
573 mt_application = mt_allocate_application(td, report); in mt_find_application()
578 static struct mt_report_data *mt_allocate_report_data(struct mt_device *td, in mt_allocate_report_data() argument
585 rdata = devm_kzalloc(&td->hdev->dev, sizeof(*rdata), GFP_KERNEL); in mt_allocate_report_data()
590 rdata->application = mt_find_application(td, report); in mt_allocate_report_data()
593 devm_kfree(&td->hdev->dev, rdata); in mt_allocate_report_data()
609 list_add_tail(&rdata->list, &td->reports); in mt_allocate_report_data()
614 static struct mt_report_data *mt_find_report_data(struct mt_device *td, in mt_find_report_data() argument
619 list_for_each_entry(tmp, &td->reports, list) { in mt_find_report_data()
627 rdata = mt_allocate_report_data(td, report); in mt_find_report_data()
682 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_mapping() local
683 struct mt_class *cls = &td->mtclass; in mt_touch_input_mapping()
693 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_touch_input_mapping()
867 static int mt_compute_slot(struct mt_device *td, struct mt_application *app, in mt_compute_slot() argument
888 static void mt_release_pending_palms(struct mt_device *td, in mt_release_pending_palms() argument
895 for_each_set_bit(slotnum, app->pending_palm_slots, td->maxcontacts) { in mt_release_pending_palms()
914 static void mt_sync_frame(struct mt_device *td, struct mt_application *app, in mt_sync_frame() argument
924 mt_release_pending_palms(td, app, input); in mt_sync_frame()
929 if (test_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags)) in mt_sync_frame()
930 set_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
932 clear_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
933 clear_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_sync_frame()
966 static int mt_process_slot(struct mt_device *td, struct input_dev *input, in mt_process_slot() argument
998 slotnum = mt_compute_slot(td, app, slot, input); in mt_process_slot()
999 if (slotnum < 0 || slotnum >= td->maxcontacts) in mt_process_slot()
1087 set_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_process_slot()
1135 struct mt_device *td = hid_get_drvdata(hid); in mt_touch_report() local
1148 if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_touch_report()
1183 if (!mt_process_slot(td, input, app, slot)) in mt_touch_report()
1201 mt_sync_frame(td, app, input); in mt_touch_report()
1222 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_touch_report()
1223 mod_timer(&td->release_timer, in mt_touch_report()
1226 del_timer(&td->release_timer); in mt_touch_report()
1229 clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_touch_report()
1236 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_configured() local
1237 struct mt_class *cls = &td->mtclass; in mt_touch_input_configured()
1241 if (!td->maxcontacts) in mt_touch_input_configured()
1242 td->maxcontacts = MT_DEFAULT_MAXCONTACT; in mt_touch_input_configured()
1244 mt_post_parse(td, app); in mt_touch_input_configured()
1245 if (td->serial_maybe) in mt_touch_input_configured()
1246 mt_post_parse_default_settings(td, app); in mt_touch_input_configured()
1257 td->is_buttonpad = true; in mt_touch_input_configured()
1259 if (td->is_buttonpad) in mt_touch_input_configured()
1263 BITS_TO_LONGS(td->maxcontacts), in mt_touch_input_configured()
1269 ret = input_mt_init_slots(input, td->maxcontacts, app->mt_flags); in mt_touch_input_configured()
1283 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapping() local
1287 rdata = mt_find_report_data(td, field->report); in mt_input_mapping()
1301 if (!td->mtclass.export_all_inputs && in mt_input_mapping()
1356 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapped() local
1359 rdata = mt_find_report_data(td, field->report); in mt_input_mapped()
1372 struct mt_device *td = hid_get_drvdata(hid); in mt_event() local
1375 rdata = mt_find_report_data(td, field->report); in mt_event()
1384 struct mt_device *td = hid_get_drvdata(hid); in mt_report() local
1391 rdata = mt_find_report_data(td, report); in mt_report()
1407 struct mt_device *td = hid_get_drvdata(hdev); in mt_need_to_apply_feature() local
1408 struct mt_class *cls = &td->mtclass; in mt_need_to_apply_feature()
1439 field->value[index] = td->inputmode_value; in mt_need_to_apply_feature()
1508 static void mt_post_parse_default_settings(struct mt_device *td, in mt_post_parse_default_settings() argument
1525 static void mt_post_parse(struct mt_device *td, struct mt_application *app) in mt_post_parse() argument
1533 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_configured() local
1542 rdata = mt_find_report_data(td, report); in mt_input_configured()
1633 struct mt_device *td = hid_get_drvdata(hid); in mt_release_contacts() local
1652 list_for_each_entry(application, &td->applications, list) { in mt_release_contacts()
1659 struct mt_device *td = from_timer(td, t, release_timer); in mt_expired_timeout() local
1660 struct hid_device *hdev = td->hdev; in mt_expired_timeout()
1666 if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_expired_timeout()
1668 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_expired_timeout()
1670 clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_expired_timeout()
1676 struct mt_device *td; in mt_probe() local
1686 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); in mt_probe()
1687 if (!td) { in mt_probe()
1691 td->hdev = hdev; in mt_probe()
1692 td->mtclass = *mtclass; in mt_probe()
1693 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; in mt_probe()
1694 hid_set_drvdata(hdev, td); in mt_probe()
1696 INIT_LIST_HEAD(&td->applications); in mt_probe()
1697 INIT_LIST_HEAD(&td->reports); in mt_probe()
1700 td->serial_maybe = true; in mt_probe()
1717 timer_setup(&td->release_timer, mt_expired_timeout, 0); in mt_probe()
1762 struct mt_device *td = hid_get_drvdata(hdev); in mt_remove() local
1764 del_timer_sync(&td->release_timer); in mt_remove()