Lines Matching refs:mt

42 	struct input_mt *mt = dev->mt;  in input_mt_init_slots()  local
47 if (mt) in input_mt_init_slots()
48 return mt->num_slots != num_slots ? -EINVAL : 0; in input_mt_init_slots()
53 mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL); in input_mt_init_slots()
54 if (!mt) in input_mt_init_slots()
57 mt->num_slots = num_slots; in input_mt_init_slots()
58 mt->flags = flags; in input_mt_init_slots()
87 mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL); in input_mt_init_slots()
88 if (!mt->red) in input_mt_init_slots()
94 input_mt_set_value(&mt->slots[i], ABS_MT_TRACKING_ID, -1); in input_mt_init_slots()
97 mt->frame = 1; in input_mt_init_slots()
99 dev->mt = mt; in input_mt_init_slots()
102 kfree(mt); in input_mt_init_slots()
116 if (dev->mt) { in input_mt_destroy_slots()
117 kfree(dev->mt->red); in input_mt_destroy_slots()
118 kfree(dev->mt); in input_mt_destroy_slots()
120 dev->mt = NULL; in input_mt_destroy_slots()
141 struct input_mt *mt = dev->mt; in input_mt_report_slot_state() local
145 if (!mt) in input_mt_report_slot_state()
148 slot = &mt->slots[mt->slot]; in input_mt_report_slot_state()
149 slot->frame = mt->frame; in input_mt_report_slot_state()
158 id = input_mt_new_trkid(mt); in input_mt_report_slot_state()
201 struct input_mt *mt = dev->mt; in input_mt_report_pointer_emulation() local
205 if (!mt) in input_mt_report_pointer_emulation()
209 oldid = mt->trkid; in input_mt_report_pointer_emulation()
212 for (i = 0; i < mt->num_slots; ++i) { in input_mt_report_pointer_emulation()
213 struct input_mt_slot *ps = &mt->slots[i]; in input_mt_report_pointer_emulation()
262 static void __input_mt_drop_unused(struct input_dev *dev, struct input_mt *mt) in __input_mt_drop_unused() argument
268 for (i = 0; i < mt->num_slots; i++) { in __input_mt_drop_unused()
269 if (input_mt_is_active(&mt->slots[i]) && in __input_mt_drop_unused()
270 !input_mt_is_used(mt, &mt->slots[i])) { in __input_mt_drop_unused()
285 struct input_mt *mt = dev->mt; in input_mt_drop_unused() local
287 if (mt) { in input_mt_drop_unused()
292 __input_mt_drop_unused(dev, mt); in input_mt_drop_unused()
293 mt->frame++; in input_mt_drop_unused()
308 struct input_mt *mt = dev->mt; in input_mt_release_slots() local
312 if (mt) { in input_mt_release_slots()
314 mt->frame++; in input_mt_release_slots()
316 __input_mt_drop_unused(dev, mt); in input_mt_release_slots()
321 mt->frame++; in input_mt_release_slots()
335 struct input_mt *mt = dev->mt; in input_mt_sync_frame() local
338 if (!mt) in input_mt_sync_frame()
341 if (mt->flags & INPUT_MT_DROP_UNUSED) { in input_mt_sync_frame()
345 __input_mt_drop_unused(dev, mt); in input_mt_sync_frame()
349 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) in input_mt_sync_frame()
354 mt->frame++; in input_mt_sync_frame()
406 static int input_mt_set_matrix(struct input_mt *mt, in input_mt_set_matrix() argument
412 int *w = mt->red; in input_mt_set_matrix()
415 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_matrix()
426 return w - mt->red; in input_mt_set_matrix()
429 static void input_mt_set_slots(struct input_mt *mt, in input_mt_set_slots() argument
433 int *w = mt->red, j; in input_mt_set_slots()
438 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
444 slots[j] = s - mt->slots; in input_mt_set_slots()
452 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
458 slots[j] = s - mt->slots; in input_mt_set_slots()
487 struct input_mt *mt = dev->mt; in input_mt_assign_slots() local
491 if (!mt || !mt->red) in input_mt_assign_slots()
493 if (num_pos > mt->num_slots) in input_mt_assign_slots()
498 nrc = input_mt_set_matrix(mt, pos, num_pos, mu); in input_mt_assign_slots()
499 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu); in input_mt_assign_slots()
500 input_mt_set_slots(mt, slots, num_pos); in input_mt_assign_slots()
520 struct input_mt *mt = dev->mt; in input_mt_get_slot_by_key() local
523 if (!mt) in input_mt_get_slot_by_key()
526 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
528 return s - mt->slots; in input_mt_get_slot_by_key()
530 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
531 if (!input_mt_is_active(s) && !input_mt_is_used(mt, s)) { in input_mt_get_slot_by_key()
533 return s - mt->slots; in input_mt_get_slot_by_key()