Lines Matching refs:td

173 static void mt_post_parse_default_settings(struct mt_device *td,
175 static void mt_post_parse(struct mt_device *td, struct mt_application *app);
368 struct mt_device *td = hid_get_drvdata(hdev); in mt_show_quirks() local
370 return sprintf(buf, "%u\n", td->mtclass.quirks); in mt_show_quirks()
378 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_quirks() local
386 td->mtclass.quirks = val; in mt_set_quirks()
388 list_for_each_entry(application, &td->applications, list) { in mt_set_quirks()
443 struct mt_device *td = hid_get_drvdata(hdev); in mt_feature_mapping() local
449 td->maxcontacts = field->value[0]; in mt_feature_mapping()
450 if (!td->maxcontacts && in mt_feature_mapping()
452 td->maxcontacts = field->logical_maximum; in mt_feature_mapping()
453 if (td->mtclass.maxcontacts) in mt_feature_mapping()
455 td->maxcontacts = td->mtclass.maxcontacts; in mt_feature_mapping()
466 td->is_buttonpad = true; in mt_feature_mapping()
515 static struct mt_application *mt_allocate_application(struct mt_device *td, in mt_allocate_application() argument
520 mt_application = devm_kzalloc(&td->hdev->dev, sizeof(*mt_application), in mt_allocate_application()
536 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_allocate_application()
541 mt_application->quirks = td->mtclass.quirks; in mt_allocate_application()
543 list_add_tail(&mt_application->list, &td->applications); in mt_allocate_application()
548 static struct mt_application *mt_find_application(struct mt_device *td, in mt_find_application() argument
553 list_for_each_entry(tmp, &td->applications, list) { in mt_find_application()
561 mt_application = mt_allocate_application(td, application); in mt_find_application()
566 static struct mt_report_data *mt_allocate_report_data(struct mt_device *td, in mt_allocate_report_data() argument
573 rdata = devm_kzalloc(&td->hdev->dev, sizeof(*rdata), GFP_KERNEL); in mt_allocate_report_data()
578 rdata->application = mt_find_application(td, report->application); in mt_allocate_report_data()
581 devm_kfree(&td->hdev->dev, rdata); in mt_allocate_report_data()
597 list_add_tail(&rdata->list, &td->reports); in mt_allocate_report_data()
602 static struct mt_report_data *mt_find_report_data(struct mt_device *td, in mt_find_report_data() argument
607 list_for_each_entry(tmp, &td->reports, list) { in mt_find_report_data()
615 rdata = mt_allocate_report_data(td, report); in mt_find_report_data()
663 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_mapping() local
664 struct mt_class *cls = &td->mtclass; in mt_touch_input_mapping()
674 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_touch_input_mapping()
848 static int mt_compute_slot(struct mt_device *td, struct mt_application *app, in mt_compute_slot() argument
869 static void mt_release_pending_palms(struct mt_device *td, in mt_release_pending_palms() argument
876 for_each_set_bit(slotnum, app->pending_palm_slots, td->maxcontacts) { in mt_release_pending_palms()
895 static void mt_sync_frame(struct mt_device *td, struct mt_application *app, in mt_sync_frame() argument
905 mt_release_pending_palms(td, app, input); in mt_sync_frame()
910 if (test_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags)) in mt_sync_frame()
911 set_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
913 clear_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
914 clear_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_sync_frame()
947 static int mt_process_slot(struct mt_device *td, struct input_dev *input, in mt_process_slot() argument
979 slotnum = mt_compute_slot(td, app, slot, input); in mt_process_slot()
980 if (slotnum < 0 || slotnum >= td->maxcontacts) in mt_process_slot()
1068 set_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_process_slot()
1116 struct mt_device *td = hid_get_drvdata(hid); in mt_touch_report() local
1129 if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_touch_report()
1164 if (!mt_process_slot(td, input, app, slot)) in mt_touch_report()
1182 mt_sync_frame(td, app, input); in mt_touch_report()
1203 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_touch_report()
1204 mod_timer(&td->release_timer, in mt_touch_report()
1207 del_timer(&td->release_timer); in mt_touch_report()
1210 clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_touch_report()
1217 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_configured() local
1218 struct mt_class *cls = &td->mtclass; in mt_touch_input_configured()
1222 if (!td->maxcontacts) in mt_touch_input_configured()
1223 td->maxcontacts = MT_DEFAULT_MAXCONTACT; in mt_touch_input_configured()
1225 mt_post_parse(td, app); in mt_touch_input_configured()
1226 if (td->serial_maybe) in mt_touch_input_configured()
1227 mt_post_parse_default_settings(td, app); in mt_touch_input_configured()
1238 td->is_buttonpad = true; in mt_touch_input_configured()
1240 if (td->is_buttonpad) in mt_touch_input_configured()
1244 BITS_TO_LONGS(td->maxcontacts), in mt_touch_input_configured()
1250 ret = input_mt_init_slots(input, td->maxcontacts, app->mt_flags); in mt_touch_input_configured()
1264 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapping() local
1268 rdata = mt_find_report_data(td, field->report); in mt_input_mapping()
1282 if (!td->mtclass.export_all_inputs && in mt_input_mapping()
1330 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapped() local
1333 rdata = mt_find_report_data(td, field->report); in mt_input_mapped()
1346 struct mt_device *td = hid_get_drvdata(hid); in mt_event() local
1349 rdata = mt_find_report_data(td, field->report); in mt_event()
1358 struct mt_device *td = hid_get_drvdata(hid); in mt_report() local
1365 rdata = mt_find_report_data(td, report); in mt_report()
1381 struct mt_device *td = hid_get_drvdata(hdev); in mt_need_to_apply_feature() local
1382 struct mt_class *cls = &td->mtclass; in mt_need_to_apply_feature()
1413 field->value[index] = td->inputmode_value; in mt_need_to_apply_feature()
1482 static void mt_post_parse_default_settings(struct mt_device *td, in mt_post_parse_default_settings() argument
1499 static void mt_post_parse(struct mt_device *td, struct mt_application *app) in mt_post_parse() argument
1507 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_configured() local
1518 rdata = mt_find_report_data(td, report); in mt_input_configured()
1619 struct mt_device *td = hid_get_drvdata(hid); in mt_release_contacts() local
1638 list_for_each_entry(application, &td->applications, list) { in mt_release_contacts()
1645 struct mt_device *td = from_timer(td, t, release_timer); in mt_expired_timeout() local
1646 struct hid_device *hdev = td->hdev; in mt_expired_timeout()
1652 if (test_and_set_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_expired_timeout()
1654 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_expired_timeout()
1656 clear_bit(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_expired_timeout()
1662 struct mt_device *td; in mt_probe() local
1672 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); in mt_probe()
1673 if (!td) { in mt_probe()
1677 td->hdev = hdev; in mt_probe()
1678 td->mtclass = *mtclass; in mt_probe()
1679 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; in mt_probe()
1680 hid_set_drvdata(hdev, td); in mt_probe()
1682 INIT_LIST_HEAD(&td->applications); in mt_probe()
1683 INIT_LIST_HEAD(&td->reports); in mt_probe()
1686 td->serial_maybe = true; in mt_probe()
1703 timer_setup(&td->release_timer, mt_expired_timeout, 0); in mt_probe()
1748 struct mt_device *td = hid_get_drvdata(hdev); in mt_remove() local
1750 del_timer_sync(&td->release_timer); in mt_remove()