Getting Leadtek WinFast TV2000 XP remote RM-0010 to work on kernel 2.6.39

Well, it is always tricky to upgrade the kernel on our TV machine, and this time it was even trickier.
like always, had to modify /usr/src/linux/drivers/media/video/bt8xx/bttv-input.c and change the ir->mask_keycode from 0x1f8 to 0x8f8

case BTTV_BOARD_WINFAST2000:
ir_codes = RC_MAP_WINFAST;
ir->mask_keycode = 0x8f8;
break;

Failing to do this results in a remote that has a few duplicate keys, I don’t know why this was never patched upstream, but that’s life.

The second part involved testing with IRW, which surprisingly failed this time to detect a few important keys such as POWER, CH+, CH- and more. Turns out I had to update the lircd.conf manually this time, as a few event codes has changed. This was done with the help of a small program called evtest.c (compiling with gcc was really straight forward). Hitting the missing keys on the remote resulted in the event codes showing up which I had to replace in the file. (the right and left keys are switched for some reason between their description in the event and their real placement).

I really hope this information will help someone lose a bit less hair on this.