Lines Matching refs:app
172 struct mt_application *app);
173 static void mt_post_parse(struct mt_device *td, struct mt_application *app);
674 mt_store_field(hdev, app, \
680 unsigned long **bit, int *max, struct mt_application *app) in mt_touch_input_mapping() argument
692 app->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_mapping()
698 app->buttons_count++; in mt_touch_input_mapping()
750 if (app->quirks & MT_QUIRK_HOVERING) { in mt_touch_input_mapping()
761 app->quirks |= MT_QUIRK_CONFIDENCE; in mt_touch_input_mapping()
763 if (app->quirks & MT_QUIRK_CONFIDENCE) in mt_touch_input_mapping()
779 app->touches_by_report++; in mt_touch_input_mapping()
782 if (!(app->quirks & MT_QUIRK_NO_AREA)) in mt_touch_input_mapping()
788 if (!(app->quirks & MT_QUIRK_NO_AREA)) { in mt_touch_input_mapping()
810 app->scantime = &field->value[usage->usage_index]; in mt_touch_input_mapping()
811 app->scantime_logical_max = field->logical_maximum; in mt_touch_input_mapping()
814 app->have_contact_count = true; in mt_touch_input_mapping()
815 app->raw_cc = &field->value[usage->usage_index]; in mt_touch_input_mapping()
847 if ((app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) && in mt_touch_input_mapping()
867 static int mt_compute_slot(struct mt_device *td, struct mt_application *app, in mt_compute_slot() argument
871 __s32 quirks = app->quirks; in mt_compute_slot()
877 return cypress_compute_slot(app, slot); in mt_compute_slot()
880 return app->num_received; in mt_compute_slot()
889 struct mt_application *app, in mt_release_pending_palms() argument
895 for_each_set_bit(slotnum, app->pending_palm_slots, td->maxcontacts) { in mt_release_pending_palms()
896 clear_bit(slotnum, app->pending_palm_slots); in mt_release_pending_palms()
914 static void mt_sync_frame(struct mt_device *td, struct mt_application *app, in mt_sync_frame() argument
917 if (app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) in mt_sync_frame()
918 input_event(input, EV_KEY, BTN_LEFT, app->left_button_state); in mt_sync_frame()
921 input_event(input, EV_MSC, MSC_TIMESTAMP, app->timestamp); in mt_sync_frame()
924 mt_release_pending_palms(td, app, input); in mt_sync_frame()
926 app->num_received = 0; in mt_sync_frame()
927 app->left_button_state = 0; in mt_sync_frame()
936 static int mt_compute_timestamp(struct mt_application *app, __s32 value) in mt_compute_timestamp() argument
938 long delta = value - app->prev_scantime; in mt_compute_timestamp()
939 unsigned long jdelta = jiffies_to_usecs(jiffies - app->jiffies); in mt_compute_timestamp()
941 app->jiffies = jiffies; in mt_compute_timestamp()
944 delta += app->scantime_logical_max; in mt_compute_timestamp()
953 return app->timestamp + delta; in mt_compute_timestamp()
967 struct mt_application *app, in mt_process_slot() argument
971 __s32 quirks = app->quirks; in mt_process_slot()
983 app->num_received >= app->num_expected) in mt_process_slot()
998 slotnum = mt_compute_slot(td, app, slot, input); in mt_process_slot()
1018 if (app->application == HID_GD_SYSTEM_MULTIAXIS) in mt_process_slot()
1034 set_bit(slotnum, app->pending_palm_slots); in mt_process_slot()
1094 struct mt_application *app, in mt_process_mt_event() argument
1100 __s32 quirks = app->quirks; in mt_process_mt_event()
1124 app->left_button_state |= value; in mt_process_mt_event()
1137 struct mt_application *app = rdata->application; in mt_touch_report() local
1151 scantime = *app->scantime; in mt_touch_report()
1152 app->timestamp = mt_compute_timestamp(app, scantime); in mt_touch_report()
1153 if (app->raw_cc != DEFAULT_ZERO) in mt_touch_report()
1154 contact_count = *app->raw_cc; in mt_touch_report()
1168 if ((app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) && in mt_touch_report()
1169 app->num_received == 0 && in mt_touch_report()
1170 app->prev_scantime != scantime) in mt_touch_report()
1171 app->num_expected = contact_count; in mt_touch_report()
1174 app->num_expected = contact_count; in mt_touch_report()
1176 app->prev_scantime = scantime; in mt_touch_report()
1178 first_packet = app->num_received == 0; in mt_touch_report()
1182 list_for_each_entry(slot, &app->mt_usages, list) { in mt_touch_report()
1183 if (!mt_process_slot(td, input, app, slot)) in mt_touch_report()
1184 app->num_received++; in mt_touch_report()
1195 mt_process_mt_event(hid, app, field, in mt_touch_report()
1200 if (app->num_received >= app->num_expected) in mt_touch_report()
1201 mt_sync_frame(td, app, input); in mt_touch_report()
1221 if (app->quirks & MT_QUIRK_STICKY_FINGERS) { in mt_touch_report()
1234 struct mt_application *app) in mt_touch_input_configured() argument
1244 mt_post_parse(td, app); in mt_touch_input_configured()
1246 mt_post_parse_default_settings(td, app); in mt_touch_input_configured()
1249 app->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_configured()
1251 if (app->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP) in mt_touch_input_configured()
1252 app->mt_flags |= INPUT_MT_DROP_UNUSED; in mt_touch_input_configured()
1255 if ((app->mt_flags & INPUT_MT_POINTER) && in mt_touch_input_configured()
1256 (app->buttons_count == 1)) in mt_touch_input_configured()
1262 app->pending_palm_slots = devm_kcalloc(&hi->input->dev, in mt_touch_input_configured()
1266 if (!app->pending_palm_slots) in mt_touch_input_configured()
1269 ret = input_mt_init_slots(input, td->maxcontacts, app->mt_flags); in mt_touch_input_configured()
1273 app->mt_flags = 0; in mt_touch_input_configured()
1509 struct mt_application *app) in mt_post_parse_default_settings() argument
1511 __s32 quirks = app->quirks; in mt_post_parse_default_settings()
1514 if (list_is_singular(&app->mt_usages)) { in mt_post_parse_default_settings()
1522 app->quirks = quirks; in mt_post_parse_default_settings()
1525 static void mt_post_parse(struct mt_device *td, struct mt_application *app) in mt_post_parse() argument
1527 if (!app->have_contact_count) in mt_post_parse()
1528 app->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE; in mt_post_parse()