28 static int dvb_usb_af9005_remote_debug;
31 "enable (1) or disable (0) debug messages."
34 #define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args)
79 static int repeatable_keys[] = {
95 mark = (
u16) (data[0] << 8) + data[1];
96 space = (
u16) (data[2] << 8) + data[3];
97 if (space * 3 < mark) {
98 for (i = 0; i <
ARRAY_SIZE(repeatable_keys); i++) {
107 deb_decode(
"repeated key ignored (non repeatable)\n");
109 }
else if (len >= 33 * 4) {
111 for (i = 4; i < 4 + 32 * 4; i += 4) {
113 mark = (
u16) (data[i] << 8) + data[i + 1];
115 space = (
u16) (data[i + 2] << 8) + data[i + 3];
117 if (mark * 2 > space)
120 deb_decode(
"key pressed, raw value %x\n", result);
121 if ((result & 0xff000000) != 0xfe000000) {
123 (
"doesn't start with 0xfe, ignored\n");
126 cust = (result >> 16) & 0xff;
127 dat = (result >> 8) & 0xff;
128 invdat = (~result) & 0xff;
134 if (rc5_custom(&rc_map_af9005_table[i]) == cust
135 && rc5_data(&rc_map_af9005_table[i]) == dat) {
136 *
event = rc_map_af9005_table[
i].
keycode;
139 (
"key pressed, event %x\n", *event);
155 (
"Standard remote control decoder for Afatech 9005 DVB-T USB1.1 stick");