Lines Matching refs:td

182 static void mt_post_parse_default_settings(struct mt_device *td,
184 static void mt_post_parse(struct mt_device *td, struct mt_application *app);
429 struct mt_device *td = hid_get_drvdata(hdev); in mt_show_quirks() local
431 return sprintf(buf, "%u\n", td->mtclass.quirks); in mt_show_quirks()
439 struct mt_device *td = hid_get_drvdata(hdev); in mt_set_quirks() local
447 td->mtclass.quirks = val; in mt_set_quirks()
449 list_for_each_entry(application, &td->applications, list) { in mt_set_quirks()
504 struct mt_device *td = hid_get_drvdata(hdev); in mt_feature_mapping() local
510 td->maxcontacts = field->value[0]; in mt_feature_mapping()
511 if (!td->maxcontacts && in mt_feature_mapping()
513 td->maxcontacts = field->logical_maximum; in mt_feature_mapping()
514 if (td->mtclass.maxcontacts) in mt_feature_mapping()
516 td->maxcontacts = td->mtclass.maxcontacts; in mt_feature_mapping()
527 td->is_buttonpad = true; in mt_feature_mapping()
576 static struct mt_application *mt_allocate_application(struct mt_device *td, in mt_allocate_application() argument
582 mt_application = devm_kzalloc(&td->hdev->dev, sizeof(*mt_application), in mt_allocate_application()
598 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_allocate_application()
603 mt_application->quirks = td->mtclass.quirks; in mt_allocate_application()
606 list_add_tail(&mt_application->list, &td->applications); in mt_allocate_application()
611 static struct mt_application *mt_find_application(struct mt_device *td, in mt_find_application() argument
617 list_for_each_entry(tmp, &td->applications, list) { in mt_find_application()
619 if (!(td->mtclass.quirks & MT_QUIRK_SEPARATE_APP_REPORT) || in mt_find_application()
628 mt_application = mt_allocate_application(td, report); in mt_find_application()
633 static struct mt_report_data *mt_allocate_report_data(struct mt_device *td, in mt_allocate_report_data() argument
636 struct mt_class *cls = &td->mtclass; in mt_allocate_report_data()
641 rdata = devm_kzalloc(&td->hdev->dev, sizeof(*rdata), GFP_KERNEL); in mt_allocate_report_data()
646 rdata->application = mt_find_application(td, report); in mt_allocate_report_data()
649 devm_kfree(&td->hdev->dev, rdata); in mt_allocate_report_data()
659 if (field->logical == HID_DG_FINGER || td->hdev->group != HID_GROUP_MULTITOUCH_WIN_8) { in mt_allocate_report_data()
673 list_add_tail(&rdata->list, &td->reports); in mt_allocate_report_data()
678 static struct mt_report_data *mt_find_report_data(struct mt_device *td, in mt_find_report_data() argument
683 list_for_each_entry(tmp, &td->reports, list) { in mt_find_report_data()
691 rdata = mt_allocate_report_data(td, report); in mt_find_report_data()
746 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_mapping() local
747 struct mt_class *cls = &td->mtclass; in mt_touch_input_mapping()
757 td->inputmode_value = MT_INPUTMODE_TOUCHPAD; in mt_touch_input_mapping()
950 static int mt_compute_slot(struct mt_device *td, struct mt_application *app, in mt_compute_slot() argument
971 static void mt_release_pending_palms(struct mt_device *td, in mt_release_pending_palms() argument
978 for_each_set_bit(slotnum, app->pending_palm_slots, td->maxcontacts) { in mt_release_pending_palms()
997 static void mt_sync_frame(struct mt_device *td, struct mt_application *app, in mt_sync_frame() argument
1007 mt_release_pending_palms(td, app, input); in mt_sync_frame()
1012 if (test_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags)) in mt_sync_frame()
1013 set_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
1015 clear_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags); in mt_sync_frame()
1016 clear_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_sync_frame()
1049 static int mt_process_slot(struct mt_device *td, struct input_dev *input, in mt_process_slot() argument
1054 struct hid_device *hdev = td->hdev; in mt_process_slot()
1082 slotnum = mt_compute_slot(td, app, slot, input); in mt_process_slot()
1083 if (slotnum < 0 || slotnum >= td->maxcontacts) in mt_process_slot()
1191 set_bit(MT_IO_FLAGS_ACTIVE_SLOTS, &td->mt_io_flags); in mt_process_slot()
1239 struct mt_device *td = hid_get_drvdata(hid); in mt_touch_report() local
1252 if (test_and_set_bit_lock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_touch_report()
1287 if (!mt_process_slot(td, input, app, slot)) in mt_touch_report()
1305 mt_sync_frame(td, app, input); in mt_touch_report()
1326 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_touch_report()
1327 mod_timer(&td->release_timer, in mt_touch_report()
1330 timer_delete(&td->release_timer); in mt_touch_report()
1333 clear_bit_unlock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_touch_report()
1340 struct mt_device *td = hid_get_drvdata(hdev); in mt_touch_input_configured() local
1341 struct mt_class *cls = &td->mtclass; in mt_touch_input_configured()
1350 td->maxcontacts = cls->maxcontacts; in mt_touch_input_configured()
1352 if (!td->maxcontacts) in mt_touch_input_configured()
1353 td->maxcontacts = MT_DEFAULT_MAXCONTACT; in mt_touch_input_configured()
1355 mt_post_parse(td, app); in mt_touch_input_configured()
1356 if (td->serial_maybe) in mt_touch_input_configured()
1357 mt_post_parse_default_settings(td, app); in mt_touch_input_configured()
1375 td->is_buttonpad = true; in mt_touch_input_configured()
1377 if (td->is_buttonpad) in mt_touch_input_configured()
1381 BITS_TO_LONGS(td->maxcontacts), in mt_touch_input_configured()
1387 ret = input_mt_init_slots(input, td->maxcontacts, app->mt_flags); in mt_touch_input_configured()
1401 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapping() local
1405 rdata = mt_find_report_data(td, field->report); in mt_input_mapping()
1419 if (!td->mtclass.export_all_inputs && in mt_input_mapping()
1474 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_mapped() local
1477 rdata = mt_find_report_data(td, field->report); in mt_input_mapped()
1490 struct mt_device *td = hid_get_drvdata(hid); in mt_event() local
1493 rdata = mt_find_report_data(td, field->report); in mt_event()
1526 struct mt_device *td = hid_get_drvdata(hid); in mt_report() local
1533 rdata = mt_find_report_data(td, report); in mt_report()
1548 struct mt_device *td = hid_get_drvdata(hdev); in mt_need_to_apply_feature() local
1549 struct mt_class *cls = &td->mtclass; in mt_need_to_apply_feature()
1580 field->value[index] = td->inputmode_value; in mt_need_to_apply_feature()
1648 static void mt_post_parse_default_settings(struct mt_device *td, in mt_post_parse_default_settings() argument
1665 static void mt_post_parse(struct mt_device *td, struct mt_application *app) in mt_post_parse() argument
1673 struct mt_device *td = hid_get_drvdata(hdev); in mt_input_configured() local
1681 rdata = mt_find_report_data(td, report); in mt_input_configured()
1766 struct mt_device *td = hid_get_drvdata(hid); in mt_release_contacts() local
1783 list_for_each_entry(application, &td->applications, list) { in mt_release_contacts()
1790 struct mt_device *td = timer_container_of(td, t, release_timer); in mt_expired_timeout() local
1791 struct hid_device *hdev = td->hdev; in mt_expired_timeout()
1797 if (test_and_set_bit_lock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags)) in mt_expired_timeout()
1799 if (test_bit(MT_IO_FLAGS_PENDING_SLOTS, &td->mt_io_flags)) in mt_expired_timeout()
1801 clear_bit_unlock(MT_IO_FLAGS_RUNNING, &td->mt_io_flags); in mt_expired_timeout()
1807 struct mt_device *td; in mt_probe() local
1817 td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL); in mt_probe()
1818 if (!td) { in mt_probe()
1822 td->hdev = hdev; in mt_probe()
1823 td->mtclass = *mtclass; in mt_probe()
1824 td->inputmode_value = MT_INPUTMODE_TOUCHSCREEN; in mt_probe()
1825 hid_set_drvdata(hdev, td); in mt_probe()
1827 INIT_LIST_HEAD(&td->applications); in mt_probe()
1828 INIT_LIST_HEAD(&td->reports); in mt_probe()
1831 td->serial_maybe = true; in mt_probe()
1840 td->mtclass.quirks = MT_QUIRK_ORIENTATION_INVERT; in mt_probe()
1862 timer_setup(&td->release_timer, mt_expired_timeout, 0); in mt_probe()
1895 struct mt_device *td = hid_get_drvdata(hdev); in mt_suspend() local
1898 if ((td->mtclass.quirks & MT_QUIRK_DISABLE_WAKEUP) || in mt_suspend()
1929 struct mt_device *td = hid_get_drvdata(hdev); in mt_remove() local
1931 timer_delete_sync(&td->release_timer); in mt_remove()