Lines Matching refs:app
175 struct mt_application *app);
176 static void mt_post_parse(struct mt_device *td, struct mt_application *app);
712 mt_store_field(hdev, app, \
718 unsigned long **bit, int *max, struct mt_application *app) in mt_touch_input_mapping() argument
730 app->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_mapping()
736 app->buttons_count++; in mt_touch_input_mapping()
788 if (app->quirks & MT_QUIRK_HOVERING) { in mt_touch_input_mapping()
801 app->quirks |= MT_QUIRK_CONFIDENCE; in mt_touch_input_mapping()
803 if (app->quirks & MT_QUIRK_CONFIDENCE) in mt_touch_input_mapping()
819 app->touches_by_report++; in mt_touch_input_mapping()
822 if (!(app->quirks & MT_QUIRK_NO_AREA)) in mt_touch_input_mapping()
828 if (!(app->quirks & MT_QUIRK_NO_AREA)) { in mt_touch_input_mapping()
850 app->scantime = &field->value[usage->usage_index]; in mt_touch_input_mapping()
851 app->scantime_logical_max = field->logical_maximum; in mt_touch_input_mapping()
854 app->have_contact_count = true; in mt_touch_input_mapping()
855 app->raw_cc = &field->value[usage->usage_index]; in mt_touch_input_mapping()
887 if ((app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) && in mt_touch_input_mapping()
909 static int mt_compute_slot(struct mt_device *td, struct mt_application *app, in mt_compute_slot() argument
913 __s32 quirks = app->quirks; in mt_compute_slot()
919 return cypress_compute_slot(app, slot); in mt_compute_slot()
922 return app->num_received; in mt_compute_slot()
931 struct mt_application *app, in mt_release_pending_palms() argument
937 for_each_set_bit(slotnum, app->pending_palm_slots, td->maxcontacts) { in mt_release_pending_palms()
938 clear_bit(slotnum, app->pending_palm_slots); in mt_release_pending_palms()
956 static void mt_sync_frame(struct mt_device *td, struct mt_application *app, in mt_sync_frame() argument
959 if (app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) in mt_sync_frame()
960 input_event(input, EV_KEY, BTN_LEFT, app->left_button_state); in mt_sync_frame()
963 input_event(input, EV_MSC, MSC_TIMESTAMP, app->timestamp); in mt_sync_frame()
966 mt_release_pending_palms(td, app, input); in mt_sync_frame()
968 app->num_received = 0; in mt_sync_frame()
969 app->left_button_state = 0; in mt_sync_frame()
978 static int mt_compute_timestamp(struct mt_application *app, __s32 value) in mt_compute_timestamp() argument
980 long delta = value - app->prev_scantime; in mt_compute_timestamp()
981 unsigned long jdelta = jiffies_to_usecs(jiffies - app->jiffies); in mt_compute_timestamp()
983 app->jiffies = jiffies; in mt_compute_timestamp()
986 delta += app->scantime_logical_max; in mt_compute_timestamp()
995 return app->timestamp + delta; in mt_compute_timestamp()
1009 struct mt_application *app, in mt_process_slot() argument
1014 __s32 quirks = app->quirks; in mt_process_slot()
1026 app->num_received >= app->num_expected) in mt_process_slot()
1041 slotnum = mt_compute_slot(td, app, slot, input); in mt_process_slot()
1061 if (app->application == HID_GD_SYSTEM_MULTIAXIS) in mt_process_slot()
1077 set_bit(slotnum, app->pending_palm_slots); in mt_process_slot()
1157 struct mt_application *app, in mt_process_mt_event() argument
1163 __s32 quirks = app->quirks; in mt_process_mt_event()
1187 app->left_button_state |= value; in mt_process_mt_event()
1200 struct mt_application *app = rdata->application; in mt_touch_report() local
1214 scantime = *app->scantime; in mt_touch_report()
1215 app->timestamp = mt_compute_timestamp(app, scantime); in mt_touch_report()
1216 if (app->raw_cc != DEFAULT_ZERO) in mt_touch_report()
1217 contact_count = *app->raw_cc; in mt_touch_report()
1231 if ((app->quirks & MT_QUIRK_WIN8_PTP_BUTTONS) && in mt_touch_report()
1232 app->num_received == 0 && in mt_touch_report()
1233 app->prev_scantime != scantime) in mt_touch_report()
1234 app->num_expected = contact_count; in mt_touch_report()
1237 app->num_expected = contact_count; in mt_touch_report()
1239 app->prev_scantime = scantime; in mt_touch_report()
1241 first_packet = app->num_received == 0; in mt_touch_report()
1245 list_for_each_entry(slot, &app->mt_usages, list) { in mt_touch_report()
1246 if (!mt_process_slot(td, input, app, slot)) in mt_touch_report()
1247 app->num_received++; in mt_touch_report()
1258 mt_process_mt_event(hid, app, field, in mt_touch_report()
1263 if (app->num_received >= app->num_expected) in mt_touch_report()
1264 mt_sync_frame(td, app, input); in mt_touch_report()
1284 if (app->quirks & MT_QUIRK_STICKY_FINGERS) { in mt_touch_report()
1297 struct mt_application *app) in mt_touch_input_configured() argument
1307 mt_post_parse(td, app); in mt_touch_input_configured()
1309 mt_post_parse_default_settings(td, app); in mt_touch_input_configured()
1312 app->mt_flags |= INPUT_MT_POINTER; in mt_touch_input_configured()
1314 if (app->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP) in mt_touch_input_configured()
1315 app->mt_flags |= INPUT_MT_DROP_UNUSED; in mt_touch_input_configured()
1318 if ((app->mt_flags & INPUT_MT_POINTER) && in mt_touch_input_configured()
1319 (app->buttons_count == 1)) in mt_touch_input_configured()
1325 app->pending_palm_slots = devm_kcalloc(&hi->input->dev, in mt_touch_input_configured()
1329 if (!app->pending_palm_slots) in mt_touch_input_configured()
1332 ret = input_mt_init_slots(input, td->maxcontacts, app->mt_flags); in mt_touch_input_configured()
1336 app->mt_flags = 0; in mt_touch_input_configured()
1572 struct mt_application *app) in mt_post_parse_default_settings() argument
1574 __s32 quirks = app->quirks; in mt_post_parse_default_settings()
1577 if (list_is_singular(&app->mt_usages)) { in mt_post_parse_default_settings()
1585 app->quirks = quirks; in mt_post_parse_default_settings()
1588 static void mt_post_parse(struct mt_device *td, struct mt_application *app) in mt_post_parse() argument
1590 if (!app->have_contact_count) in mt_post_parse()
1591 app->quirks &= ~MT_QUIRK_CONTACT_CNT_ACCURATE; in mt_post_parse()