--- v4l-dvb/linux/drivers/media/video/cx88/cx88-input.c 2006-04-24 14:34:44.000000000 -0700 +++ v4l-dvb_72/linux/drivers/media/video/cx88/cx88-input.c 2006-04-28 21:42:17.000000000 -0700 @@ -39,7 +39,7 @@ struct cx88_core *core; struct input_dev *input; struct ir_input_state ir; - char name[32]; + char name[72]; char phys[32]; /* sample from gpio pin 16 */ @@ -63,6 +63,10 @@ module_param(ir_debug, int, 0644); /* debug level [IR] */ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); + static int ir_any_address = 0; + module_param(ir_any_address, int, 0644); + MODULE_PARM_DESC(ir_any_address, "allow any address code [IR]"); + #define ir_dprintk(fmt, arg...) if (ir_debug) \ printk(KERN_DEBUG "%s IR: " fmt , ir->core->name , ##arg) @@ -171,7 +175,7 @@ case CX88_BOARD_HAUPPAUGE_HVR1100: ir_codes = ir_codes_hauppauge_new; ir_type = IR_TYPE_RC5; - ir->sampling = 1; + ir->sampling = (0x1E<<6) | 1; break; case CX88_BOARD_WINFAST2000XP_EXPERT: ir_codes = ir_codes_winfast; @@ -363,7 +367,9 @@ break; } - if ((ircode & 0xffff) != (ir->sampling & 0xffff)) { /* wrong address */ + + if (!ir_any_address && + (ircode & 0xffff) != (ir->sampling & 0xffff)) { ir_dprintk("pulse distance decoded wrong address\n"); break; } @@ -387,6 +393,19 @@ ir_dprintk("biphase decoded: %x\n", ircode); if ((ircode & 0xfffff000) != 0x3000) break; + if (!ir_any_address && + ((ircode ^ ir->sampling) & (0x1E << 6))) + break; + + /* if either the new-keypress edge signal is changed or the + * RC5 address doesn't match that of the previous keypress, + * say "key-up" + */ + if (((ircode ^ ir->last_gpio) & (1 << 11)) || + ((ircode ^ ir->last_gpio) & (0x1F << 6))) + ir_input_nokey(ir->input, &ir->ir); + + ir->last_gpio = ircode; ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode); ir->release = jiffies + msecs_to_jiffies(120); break;