Lines Matching full:scancode

167  * scancode_to_u64() - converts scancode in &struct input_keymap_entry
168 * @ke: keymap entry containing scancode to be converted.
169 * @scancode: pointer to the location where converted scancode should
175 static int scancode_to_u64(const struct input_keymap_entry *ke, u64 *scancode) in scancode_to_u64() argument
179 *scancode = *((u8 *)ke->scancode); in scancode_to_u64()
183 *scancode = *((u16 *)ke->scancode); in scancode_to_u64()
187 *scancode = *((u32 *)ke->scancode); in scancode_to_u64()
191 *scancode = *((u64 *)ke->scancode); in scancode_to_u64()
202 * ir_create_table() - initializes a scancode table
236 * ir_free_table() - frees memory allocated by a scancode table
240 * scancode table.
252 * ir_resize_table() - resizes a scancode table if necessary
301 * ir_update_mapping() - set a keycode in the scancode->keycode table
303 * @rc_map: scancode table to be adjusted
307 * This routine is used to update scancode->keycode mapping at given
324 index, rc_map->scan[index].scancode); in ir_update_mapping()
332 rc_map->scan[index].scancode, new_keycode); in ir_update_mapping()
340 /* ... but another scancode might use the same keycode */ in ir_update_mapping()
356 * ir_establish_scancode() - set a keycode in the scancode->keycode table
358 * @rc_map: scancode table to be searched
359 * @scancode: the desired scancode
363 * This routine is used to locate given scancode in rc_map.
364 * If scancode is not yet present the routine will allocate a new slot
367 * return: index of the mapping containing scancode in question
372 u64 scancode, bool resize) in ir_establish_scancode() argument
385 scancode &= dev->scancode_mask; in ir_establish_scancode()
389 if (rc_map->scan[i].scancode == scancode) in ir_establish_scancode()
392 /* Keytable is sorted from lowest to highest scancode */ in ir_establish_scancode()
393 if (rc_map->scan[i].scancode >= scancode) in ir_establish_scancode()
407 rc_map->scan[i].scancode = scancode; in ir_establish_scancode()
415 * ir_setkeycode() - set a keycode in the scancode->keycode table
431 u64 scancode; in ir_setkeycode() local
444 retval = scancode_to_u64(ke, &scancode); in ir_setkeycode()
448 index = ir_establish_scancode(rdev, rc_map, scancode, true); in ir_setkeycode()
463 * ir_setkeytable() - sets several entries in the scancode->keycode table
484 from->scan[i].scancode, false); in ir_setkeytable()
502 const u64 *scancode = key; in rc_map_cmp() local
505 if (*scancode < e->scancode) in rc_map_cmp()
507 else if (*scancode > e->scancode) in rc_map_cmp()
513 * ir_lookup_by_scancode() - locate mapping by scancode
515 * @scancode: scancode to look for in the table
518 * given scancode.
523 u64 scancode) in ir_lookup_by_scancode() argument
527 res = bsearch(&scancode, rc_map->scan, rc_map->len, in ir_lookup_by_scancode()
536 * ir_getkeycode() - get a keycode from the scancode->keycode table
552 u64 scancode; in ir_getkeycode() local
560 retval = scancode_to_u64(ke, &scancode); in ir_getkeycode()
564 index = ir_lookup_by_scancode(rc_map, scancode); in ir_getkeycode()
572 ke->len = sizeof(entry->scancode); in ir_getkeycode()
573 memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); in ir_getkeycode()
595 * rc_g_keycode_from_table() - gets the keycode that corresponds to a scancode
597 * @scancode: the scancode to look for
599 * This routine is used by drivers which need to convert a scancode to a
605 u32 rc_g_keycode_from_table(struct rc_dev *dev, u64 scancode) in rc_g_keycode_from_table() argument
614 index = ir_lookup_by_scancode(rc_map, scancode); in rc_g_keycode_from_table()
621 dev_dbg(&dev->dev, "%s: scancode 0x%04llx keycode 0x%02x\n", in rc_g_keycode_from_table()
622 dev->device_name, scancode, keycode); in rc_g_keycode_from_table()
734 * not include the necessary bits to reproduce the scancode has been
743 .scancode = dev->last_scancode, .rc_proto = dev->last_protocol, in rc_repeat()
773 * @scancode: the scancode of the keypress
781 u64 scancode, u32 keycode, u8 toggle) in ir_do_keydown() argument
785 dev->last_scancode != scancode || in ir_do_keydown()
788 .scancode = scancode, .rc_proto = protocol, in ir_do_keydown()
800 if (scancode <= U32_MAX) in ir_do_keydown()
801 input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode); in ir_do_keydown()
804 dev->last_scancode = scancode; in ir_do_keydown()
812 dev_dbg(&dev->dev, "%s: key down event, key 0x%04x, protocol 0x%04x, scancode 0x%08llx\n", in ir_do_keydown()
813 dev->device_name, keycode, protocol, scancode); in ir_do_keydown()
842 * @scancode: the scancode for the keypress
849 void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u64 scancode, in rc_keydown() argument
853 u32 keycode = rc_g_keycode_from_table(dev, scancode); in rc_keydown()
856 ir_do_keydown(dev, protocol, scancode, keycode, toggle); in rc_keydown()
872 * @scancode: the scancode for the keypress
880 u64 scancode, u8 toggle) in rc_keydown_notimeout() argument
883 u32 keycode = rc_g_keycode_from_table(dev, scancode); in rc_keydown_notimeout()
886 ir_do_keydown(dev, protocol, scancode, keycode, toggle); in rc_keydown_notimeout()
892 * rc_validate_scancode() - checks that a scancode is valid for a protocol.
895 * @scancode: scancode
897 bool rc_validate_scancode(enum rc_proto proto, u32 scancode) in rc_validate_scancode() argument
905 if ((((scancode >> 16) ^ ~(scancode >> 8)) & 0xff) == 0) in rc_validate_scancode()
914 if ((((scancode >> 8) ^ ~scancode) & 0xff) == 0) in rc_validate_scancode()
922 if ((scancode & 0xffff0000) != 0x800f0000) in rc_validate_scancode()
926 if ((scancode & 0xffff0000) == 0x800f0000) in rc_validate_scancode()
937 * rc_validate_filter() - checks that the scancode and mask are valid and
940 * @filter: the scancode and mask
1351 * show_filter() - shows the current scancode filter value or mask
1356 * This routine is a callback routine to read a scancode filter value or mask.
1358 * It prints the current scancode filter value or mask of the appropriate filter
1393 * store_filter() - changes the scancode filter value
1399 * This routine is for changing a scancode filter value or mask.
1402 * specified or if scancode filtering is not supported by the driver, otherwise