12 #include <linux/bitops.h>
13 #include <linux/input.h>
14 #include <linux/kernel.h>
15 #include <linux/slab.h>
16 #include <linux/string.h>
17 #include <linux/types.h>
23 static const u16 oldtable[] = {
67 static const u16 keytable[] = {
131 struct input_dev *
idev;
134 idev = input_allocate_device();
139 idev->name =
"FireDTV remote control";
140 idev->dev.parent =
dev;
143 if (!idev->keycode) {
147 idev->keycodesize =
sizeof(keytable[0]);
151 set_bit(keytable[i], idev->keybit);
153 err = input_register_device(idev);
155 goto fail_free_keymap;
160 kfree(idev->keycode);
162 input_free_device(idev);
178 if (code >= 0x0300 && code <= 0x031f)
179 code = keycode[code - 0x0300];
180 else if (code >= 0x0340 && code <= 0x0354)
181 code = keycode[code - 0x0320];
182 else if (code >= 0x4501 && code <= 0x451f)
183 code = oldtable[code - 0x4501];
184 else if (code >= 0x4540 && code <= 0x4542)
185 code = oldtable[code - 0x4521];
188 "from remote control\n", code);
192 input_report_key(idev, code, 1);
194 input_report_key(idev, code, 0);