Lines Matching refs:mt

44 	struct input_mt *mt = dev->mt;  in input_mt_init_slots()  local
49 if (mt) in input_mt_init_slots()
50 return mt->num_slots != num_slots ? -EINVAL : 0; in input_mt_init_slots()
52 mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL); in input_mt_init_slots()
53 if (!mt) in input_mt_init_slots()
56 mt->num_slots = num_slots; in input_mt_init_slots()
57 mt->flags = flags; in input_mt_init_slots()
86 mt->red = kcalloc(n2, sizeof(*mt->red), GFP_KERNEL); in input_mt_init_slots()
87 if (!mt->red) in input_mt_init_slots()
93 input_mt_set_value(&mt->slots[i], ABS_MT_TRACKING_ID, -1); in input_mt_init_slots()
96 mt->frame = 1; in input_mt_init_slots()
98 dev->mt = mt; in input_mt_init_slots()
101 kfree(mt); in input_mt_init_slots()
115 if (dev->mt) { in input_mt_destroy_slots()
116 kfree(dev->mt->red); in input_mt_destroy_slots()
117 kfree(dev->mt); in input_mt_destroy_slots()
119 dev->mt = NULL; in input_mt_destroy_slots()
140 struct input_mt *mt = dev->mt; in input_mt_report_slot_state() local
144 if (!mt) in input_mt_report_slot_state()
147 slot = &mt->slots[mt->slot]; in input_mt_report_slot_state()
148 slot->frame = mt->frame; in input_mt_report_slot_state()
157 id = input_mt_new_trkid(mt); in input_mt_report_slot_state()
200 struct input_mt *mt = dev->mt; in input_mt_report_pointer_emulation() local
204 if (!mt) in input_mt_report_pointer_emulation()
208 oldid = mt->trkid; in input_mt_report_pointer_emulation()
211 for (i = 0; i < mt->num_slots; ++i) { in input_mt_report_pointer_emulation()
212 struct input_mt_slot *ps = &mt->slots[i]; in input_mt_report_pointer_emulation()
261 static void __input_mt_drop_unused(struct input_dev *dev, struct input_mt *mt) in __input_mt_drop_unused() argument
265 for (i = 0; i < mt->num_slots; i++) { in __input_mt_drop_unused()
266 if (!input_mt_is_used(mt, &mt->slots[i])) { in __input_mt_drop_unused()
281 struct input_mt *mt = dev->mt; in input_mt_drop_unused() local
283 if (mt) { in input_mt_drop_unused()
284 __input_mt_drop_unused(dev, mt); in input_mt_drop_unused()
285 mt->frame++; in input_mt_drop_unused()
300 struct input_mt *mt = dev->mt; in input_mt_sync_frame() local
303 if (!mt) in input_mt_sync_frame()
306 if (mt->flags & INPUT_MT_DROP_UNUSED) in input_mt_sync_frame()
307 __input_mt_drop_unused(dev, mt); in input_mt_sync_frame()
309 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) in input_mt_sync_frame()
314 mt->frame++; in input_mt_sync_frame()
363 static int input_mt_set_matrix(struct input_mt *mt, in input_mt_set_matrix() argument
369 int *w = mt->red; in input_mt_set_matrix()
372 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_matrix()
383 return w - mt->red; in input_mt_set_matrix()
386 static void input_mt_set_slots(struct input_mt *mt, in input_mt_set_slots() argument
390 int *w = mt->red, j; in input_mt_set_slots()
395 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
401 slots[j] = s - mt->slots; in input_mt_set_slots()
409 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
415 slots[j] = s - mt->slots; in input_mt_set_slots()
444 struct input_mt *mt = dev->mt; in input_mt_assign_slots() local
448 if (!mt || !mt->red) in input_mt_assign_slots()
450 if (num_pos > mt->num_slots) in input_mt_assign_slots()
455 nrc = input_mt_set_matrix(mt, pos, num_pos, mu); in input_mt_assign_slots()
456 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu); in input_mt_assign_slots()
457 input_mt_set_slots(mt, slots, num_pos); in input_mt_assign_slots()
477 struct input_mt *mt = dev->mt; in input_mt_get_slot_by_key() local
480 if (!mt) in input_mt_get_slot_by_key()
483 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
485 return s - mt->slots; in input_mt_get_slot_by_key()
487 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
488 if (!input_mt_is_active(s) && !input_mt_is_used(mt, s)) { in input_mt_get_slot_by_key()
490 return s - mt->slots; in input_mt_get_slot_by_key()