Lines Matching +full:abs +full:- +full:fuzz
4 * Copyright (c) 2008-2010 Henrik Rydberg
19 if (dev->absinfo && test_bit(src, dev->absbit)) { in copy_abs()
20 dev->absinfo[dst] = dev->absinfo[src]; in copy_abs()
21 dev->absinfo[dst].fuzz = 0; in copy_abs()
22 dev->absbit[BIT_WORD(dst)] |= BIT_MASK(dst); in copy_abs()
27 * input_mt_init_slots() - initialize MT input slots
38 * May be called repeatedly. Returns -EINVAL if attempting to
44 struct input_mt *mt = dev->mt; in input_mt_init_slots()
50 return mt->num_slots != num_slots ? -EINVAL : 0; 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()
58 input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); in input_mt_init_slots()
62 __set_bit(EV_KEY, dev->evbit); in input_mt_init_slots()
63 __set_bit(BTN_TOUCH, dev->keybit); in input_mt_init_slots()
70 __set_bit(BTN_TOOL_FINGER, dev->keybit); in input_mt_init_slots()
71 __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); in input_mt_init_slots()
73 __set_bit(BTN_TOOL_TRIPLETAP, dev->keybit); in input_mt_init_slots()
75 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); in input_mt_init_slots()
77 __set_bit(BTN_TOOL_QUINTTAP, dev->keybit); in input_mt_init_slots()
78 __set_bit(INPUT_PROP_POINTER, dev->propbit); in input_mt_init_slots()
81 __set_bit(INPUT_PROP_DIRECT, dev->propbit); in input_mt_init_slots()
83 __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); 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()
102 return -ENOMEM; in input_mt_init_slots()
107 * input_mt_destroy_slots() - frees the MT slots of the input device
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()
124 * input_mt_report_slot_state() - report contact state
140 struct input_mt *mt = dev->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()
151 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); in input_mt_report_slot_state()
167 * input_mt_report_finger_count() - report contact count
188 * input_mt_report_pointer_emulation() - common pointer emulation
195 * The input core ensures only the KEY and ABS axes already setup for
200 struct input_mt *mt = dev->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()
217 if ((id - oldid) & TRKID_SGN) { in input_mt_report_pointer_emulation()
228 !test_bit(ABS_MT_DISTANCE, dev->absbit) && in input_mt_report_pointer_emulation()
229 test_bit(ABS_DISTANCE, dev->absbit) && in input_mt_report_pointer_emulation()
233 * only report general hover (and not per-contact in input_mt_report_pointer_emulation()
250 if (test_bit(ABS_MT_PRESSURE, dev->absbit)) { in input_mt_report_pointer_emulation()
255 if (test_bit(ABS_MT_PRESSURE, dev->absbit)) in input_mt_report_pointer_emulation()
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()
268 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); in __input_mt_drop_unused()
274 * input_mt_drop_unused() - Inactivate slots not seen in this frame
281 struct input_mt *mt = dev->mt; in input_mt_drop_unused()
285 mt->frame++; in input_mt_drop_unused()
291 * input_mt_sync_frame() - synchronize mt frame
300 struct input_mt *mt = dev->mt; in input_mt_sync_frame()
306 if (mt->flags & INPUT_MT_DROP_UNUSED) 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()
343 *p -= c; in adjust_dual()
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()
378 int dx = x - p->x, dy = y - p->y; in input_mt_set_matrix()
379 *w++ = dx * dx + dy * dy - mu; in input_mt_set_matrix()
383 return w - mt->red; in input_mt_set_matrix()
390 int *w = mt->red, j; in input_mt_set_slots()
393 slots[j] = -1; 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()
423 * input_mt_assign_slots() - perform a best-match assignment
444 struct input_mt *mt = dev->mt; in input_mt_assign_slots()
448 if (!mt || !mt->red) in input_mt_assign_slots()
449 return -ENXIO; in input_mt_assign_slots()
450 if (num_pos > mt->num_slots) in input_mt_assign_slots()
451 return -EINVAL; in input_mt_assign_slots()
456 find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc, mu); in input_mt_assign_slots()
464 * input_mt_get_slot_by_key() - return slot matching key
471 * If no available slot can be found, -1 is returned.
477 struct input_mt *mt = dev->mt; in input_mt_get_slot_by_key()
481 return -1; 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()
484 if (input_mt_is_active(s) && s->key == key) 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()
489 s->key = key; in input_mt_get_slot_by_key()
490 return s - mt->slots; in input_mt_get_slot_by_key()
493 return -1; in input_mt_get_slot_by_key()