Lines Matching refs:code
64 static inline int is_event_supported(unsigned int code, in is_event_supported() argument
67 return code <= max && test_bit(code, bm); in is_event_supported()
86 static void input_start_autorepeat(struct input_dev *dev, int code) in input_start_autorepeat() argument
91 dev->repeat_key = code; in input_start_autorepeat()
140 input_start_autorepeat(dev, v->code); in input_pass_values()
156 unsigned int code, int *pval) in input_handle_abs_event() argument
163 if (code == ABS_MT_SLOT) { in input_handle_abs_event()
174 is_mt_event = input_is_mt_value(code); in input_handle_abs_event()
177 pold = &dev->absinfo[code].value; in input_handle_abs_event()
179 pold = &mt->slots[mt->slot].abs[code - ABS_MT_FIRST]; in input_handle_abs_event()
191 dev->absinfo[code].fuzz); in input_handle_abs_event()
208 unsigned int type, unsigned int code, int *pval) in input_get_disposition() argument
220 switch (code) { in input_get_disposition()
235 if (is_event_supported(code, dev->keybit, KEY_MAX)) { in input_get_disposition()
243 if (!!test_bit(code, dev->key) != !!value) { in input_get_disposition()
245 __change_bit(code, dev->key); in input_get_disposition()
252 if (is_event_supported(code, dev->swbit, SW_MAX) && in input_get_disposition()
253 !!test_bit(code, dev->sw) != !!value) { in input_get_disposition()
255 __change_bit(code, dev->sw); in input_get_disposition()
261 if (is_event_supported(code, dev->absbit, ABS_MAX)) in input_get_disposition()
262 disposition = input_handle_abs_event(dev, code, &value); in input_get_disposition()
267 if (is_event_supported(code, dev->relbit, REL_MAX) && value) in input_get_disposition()
273 if (is_event_supported(code, dev->mscbit, MSC_MAX)) in input_get_disposition()
279 if (is_event_supported(code, dev->ledbit, LED_MAX) && in input_get_disposition()
280 !!test_bit(code, dev->led) != !!value) { in input_get_disposition()
282 __change_bit(code, dev->led); in input_get_disposition()
288 if (is_event_supported(code, dev->sndbit, SND_MAX)) { in input_get_disposition()
290 if (!!test_bit(code, dev->snd) != !!value) in input_get_disposition()
291 __change_bit(code, dev->snd); in input_get_disposition()
297 if (code <= REP_MAX && value >= 0 && dev->rep[code] != value) { in input_get_disposition()
298 dev->rep[code] = value; in input_get_disposition()
318 unsigned int type, unsigned int code, int value) in input_event_dispose() argument
321 dev->event(dev, type, code, value); in input_event_dispose()
329 v->code = ABS_MT_SLOT; in input_event_dispose()
335 v->code = code; in input_event_dispose()
358 unsigned int type, unsigned int code, int value) in input_handle_event() argument
364 disposition = input_get_disposition(dev, type, code, &value); in input_handle_event()
367 add_input_randomness(type, code, value); in input_handle_event()
369 input_event_dispose(dev, disposition, type, code, value); in input_handle_event()
391 unsigned int type, unsigned int code, int value) in input_event() argument
395 input_handle_event(dev, type, code, value); in input_event()
412 unsigned int type, unsigned int code, int value) in input_inject_event() argument
423 input_handle_event(dev, type, code, value); in input_inject_event()
676 int code; in input_dev_release_keys() local
681 for_each_set_bit(code, dev->key, KEY_CNT) { in input_dev_release_keys()
682 input_handle_event(dev, EV_KEY, code, 0); in input_dev_release_keys()
2105 void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code) in input_set_capability() argument
2108 code > input_max_code[type]) { in input_set_capability()
2109 pr_err("%s: invalid code %u for type %u\n", __func__, code, in input_set_capability()
2117 __set_bit(code, dev->keybit); in input_set_capability()
2121 __set_bit(code, dev->relbit); in input_set_capability()
2126 __set_bit(code, dev->absbit); in input_set_capability()
2130 __set_bit(code, dev->mscbit); in input_set_capability()
2134 __set_bit(code, dev->swbit); in input_set_capability()
2138 __set_bit(code, dev->ledbit); in input_set_capability()
2142 __set_bit(code, dev->sndbit); in input_set_capability()
2146 __set_bit(code, dev->ffbit); in input_set_capability()
2154 pr_err("%s: unknown type %u (code %u)\n", __func__, type, code); in input_set_capability()
2575 handler->event(handle, v->type, v->code, v->value); in input_handle_events_default()
2594 if (handler->filter(handle, v->type, v->code, v->value)) in input_handle_events_filter()