Lines Matching refs: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)
179 *scancode = *((u8 *)ke->scancode);
183 *scancode = *((u16 *)ke->scancode);
187 *scancode = *((u32 *)ke->scancode);
191 *scancode = *((u64 *)ke->scancode);
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);
332 rc_map->scan[index].scancode, new_keycode);
340 /* ... but another scancode might use the same keycode */
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)
385 scancode &= dev->scancode_mask;
389 if (rc_map->scan[i].scancode == scancode)
392 /* Keytable is sorted from lowest to highest scancode */
393 if (rc_map->scan[i].scancode >= scancode)
407 rc_map->scan[i].scancode = scancode;
415 * ir_setkeycode() - set a keycode in the scancode->keycode table
431 u64 scancode;
444 retval = scancode_to_u64(ke, &scancode);
448 index = ir_establish_scancode(rdev, rc_map, scancode, true);
463 * ir_setkeytable() - sets several entries in the scancode->keycode table
484 from->scan[i].scancode, false);
502 const u64 *scancode = key;
505 if (*scancode < e->scancode)
507 else if (*scancode > e->scancode)
513 * ir_lookup_by_scancode() - locate mapping by scancode
515 * @scancode: scancode to look for in the table
518 * given scancode.
523 u64 scancode)
527 res = bsearch(&scancode, rc_map->scan, rc_map->len,
536 * ir_getkeycode() - get a keycode from the scancode->keycode table
552 u64 scancode;
560 retval = scancode_to_u64(ke, &scancode);
564 index = ir_lookup_by_scancode(rc_map, scancode);
572 ke->len = sizeof(entry->scancode);
573 memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
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)
614 index = ir_lookup_by_scancode(rc_map, scancode);
621 dev_dbg(&dev->dev, "%s: scancode 0x%04llx keycode 0x%02x\n",
622 dev->device_name, scancode, keycode);
734 * not include the necessary bits to reproduce the scancode has been
743 .scancode = dev->last_scancode, .rc_proto = dev->last_protocol,
773 * @scancode: the scancode of the keypress
781 u64 scancode, u32 keycode, u8 toggle)
785 dev->last_scancode != scancode ||
788 .scancode = scancode, .rc_proto = protocol,
799 if (scancode <= U32_MAX)
800 input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode);
803 dev->last_scancode = scancode;
811 dev_dbg(&dev->dev, "%s: key down event, key 0x%04x, protocol 0x%04x, scancode 0x%08llx\n",
812 dev->device_name, keycode, protocol, scancode);
841 * @scancode: the scancode for the keypress
848 void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u64 scancode,
852 u32 keycode = rc_g_keycode_from_table(dev, scancode);
855 ir_do_keydown(dev, protocol, scancode, keycode, toggle);
871 * @scancode: the scancode for the keypress
879 u64 scancode, u8 toggle)
882 u32 keycode = rc_g_keycode_from_table(dev, scancode);
885 ir_do_keydown(dev, protocol, scancode, keycode, toggle);
891 * rc_validate_scancode() - checks that a scancode is valid for a protocol.
894 * @scancode: scancode
896 bool rc_validate_scancode(enum rc_proto proto, u32 scancode)
904 if ((((scancode >> 16) ^ ~(scancode >> 8)) & 0xff) == 0)
913 if ((((scancode >> 8) ^ ~scancode) & 0xff) == 0)
921 if ((scancode & 0xffff0000) != 0x800f0000)
925 if ((scancode & 0xffff0000) == 0x800f0000)
936 * rc_validate_filter() - checks that the scancode and mask are valid and
939 * @filter: the scancode and mask
1350 * show_filter() - shows the current scancode filter value or mask
1355 * This routine is a callback routine to read a scancode filter value or mask.
1357 * It prints the current scancode filter value or mask of the appropriate filter
1392 * store_filter() - changes the scancode filter value
1398 * This routine is for changing a scancode filter value or mask.
1401 * specified or if scancode filtering is not supported by the driver, otherwise