/* This routine is used by the input routines when a key is pressed at the IR. The scancode is received and needs to be converted into a keycode. If the key is not found, it returns KEY_UNKNOWN. Otherwise, returns the corresponding keycode from the table.  */
u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
/* This routine is used by the input routines when a key is pressed at the IR. The scancode is received and needs to be converted into a keycode. If the key is not found, it returns KEY_UNKNOWN. Otherwise, returns the corresponding keycode from the table.  */
u32 ir_g_keycode_from_table(struct input_dev *dev, u32 scancode)
{
	struct ir_input_dev *ir_dev = input_get_drvdata(dev);
	struct ir_scancode_table *rc_tab = &ir_dev->rc_tab;
	struct ir_scancode *keymap = rc_tab->scan;
	int elem;
	elem = ir_seek_table(rc_tab, scancode);
	if (elem >= 0) {
		IR_dprintk(1, "%s: scancode 0x%04x keycode 0x%02x\n",
			   dev->name, scancode, keymap[elem].keycode);
		return rc_tab->scan[elem].keycode;
	}
	printk(KERN_INFO "%s: unknown key for scancode 0x%04x\n",
	       dev->name, scancode);
	return KEY_RESERVED;
}