• Home
  • Raw
  • Download

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(sizeof(*mt) + num_slots * sizeof(*mt->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()
138 struct input_mt *mt = dev->mt; in input_mt_report_slot_state() local
142 if (!mt) in input_mt_report_slot_state()
145 slot = &mt->slots[mt->slot]; in input_mt_report_slot_state()
146 slot->frame = mt->frame; in input_mt_report_slot_state()
155 id = input_mt_new_trkid(mt); in input_mt_report_slot_state()
196 struct input_mt *mt = dev->mt; in input_mt_report_pointer_emulation() local
200 if (!mt) in input_mt_report_pointer_emulation()
204 oldid = mt->trkid; in input_mt_report_pointer_emulation()
207 for (i = 0; i < mt->num_slots; ++i) { in input_mt_report_pointer_emulation()
208 struct input_mt_slot *ps = &mt->slots[i]; in input_mt_report_pointer_emulation()
242 static void __input_mt_drop_unused(struct input_dev *dev, struct input_mt *mt) in __input_mt_drop_unused() argument
246 for (i = 0; i < mt->num_slots; i++) { in __input_mt_drop_unused()
247 if (!input_mt_is_used(mt, &mt->slots[i])) { in __input_mt_drop_unused()
262 struct input_mt *mt = dev->mt; in input_mt_drop_unused() local
264 if (mt) { in input_mt_drop_unused()
265 __input_mt_drop_unused(dev, mt); in input_mt_drop_unused()
266 mt->frame++; in input_mt_drop_unused()
281 struct input_mt *mt = dev->mt; in input_mt_sync_frame() local
284 if (!mt) in input_mt_sync_frame()
287 if (mt->flags & INPUT_MT_DROP_UNUSED) in input_mt_sync_frame()
288 __input_mt_drop_unused(dev, mt); in input_mt_sync_frame()
290 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) in input_mt_sync_frame()
295 mt->frame++; in input_mt_sync_frame()
344 static int input_mt_set_matrix(struct input_mt *mt, in input_mt_set_matrix() argument
350 int *w = mt->red; in input_mt_set_matrix()
353 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_matrix()
364 return w - mt->red; in input_mt_set_matrix()
367 static void input_mt_set_slots(struct input_mt *mt, in input_mt_set_slots() argument
371 int *w = mt->red, j; in input_mt_set_slots()
376 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
382 slots[j] = s - mt->slots; in input_mt_set_slots()
390 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { in input_mt_set_slots()
396 slots[j] = s - mt->slots; in input_mt_set_slots()
425 struct input_mt *mt = dev->mt; in input_mt_assign_slots() local
429 if (!mt || !mt->red) in input_mt_assign_slots()
431 if (num_pos > mt->num_slots) in input_mt_assign_slots()
436 nrc = input_mt_set_matrix(mt, pos, num_pos, mu); in input_mt_assign_slots()
437 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu); in input_mt_assign_slots()
438 input_mt_set_slots(mt, slots, num_pos); in input_mt_assign_slots()
458 struct input_mt *mt = dev->mt; in input_mt_get_slot_by_key() local
461 if (!mt) in input_mt_get_slot_by_key()
464 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
466 return s - mt->slots; in input_mt_get_slot_by_key()
468 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) in input_mt_get_slot_by_key()
469 if (!input_mt_is_active(s) && !input_mt_is_used(mt, s)) { in input_mt_get_slot_by_key()
471 return s - mt->slots; in input_mt_get_slot_by_key()