V4L/DVB (10190): cx88: Fix some Kbuild troubles
[safe/jmp/linux-2.6] / drivers / media / video / cx88 / cx88-input.c
index f79a1c7..8683d10 100644 (file)
@@ -57,7 +57,7 @@ struct cx88_IR {
        u32 mask_keyup;
 };
 
-static int ir_debug = 0;
+static int ir_debug;
 module_param(ir_debug, int, 0644);     /* debug level [IR] */
 MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
 
@@ -224,7 +224,8 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
        case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR3000:
-       case CX88_BOARD_PINNACLE_PCTV_HD_800i:
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
                ir_codes = ir_codes_hauppauge_new;
                ir_type = IR_TYPE_RC5;
                ir->sampling = 1;
@@ -259,6 +260,14 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
                ir->mask_keyup = 0x80;
                ir->polling = 1; /* ms */
                break;
+       case CX88_BOARD_PROLINK_PV_8000GT:
+       case CX88_BOARD_PROLINK_PV_GLOBAL_XTREME:
+               ir_codes = ir_codes_pixelview_new;
+               ir->gpio_addr = MO_GP1_IO;
+               ir->mask_keycode = 0x3f;
+               ir->mask_keyup = 0x80;
+               ir->polling = 1; /* ms */
+               break;
        case CX88_BOARD_KWORLD_LTV883:
                ir_codes = ir_codes_pixelview;
                ir->gpio_addr = MO_GP1_IO;
@@ -306,6 +315,17 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
                ir->mask_keycode = 0xfa;
                ir->polling = 50; /* ms */
                break;
+       case CX88_BOARD_PINNACLE_PCTV_HD_800i:
+               ir_codes = ir_codes_pinnacle_pctv_hd;
+               ir_type = IR_TYPE_RC5;
+               ir->sampling = 1;
+               break;
+       case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
+               ir_codes = ir_codes_powercolor_real_angel;
+               ir->gpio_addr = MO_GP2_IO;
+               ir->mask_keycode = 0x7e;
+               ir->polling = 100; /* ms */
+               break;
        }
 
        if (NULL == ir_codes) {
@@ -375,7 +395,7 @@ void cx88_ir_irq(struct cx88_core *core)
 {
        struct cx88_IR *ir = core->ir;
        u32 samples, ircode;
-       int i;
+       int i, start, range, toggle, dev, code;
 
        if (NULL == ir)
                return;
@@ -444,6 +464,34 @@ void cx88_ir_irq(struct cx88_core *core)
        case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR3000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
+               ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
+               ir_dprintk("biphase decoded: %x\n", ircode);
+               /*
+                * RC5 has an extension bit which adds a new range
+                * of available codes, this is detected here. Also
+                * hauppauge remotes (black/silver) always use
+                * specific device ids. If we do not filter the
+                * device ids then messages destined for devices
+                * such as TVs (id=0) will get through to the
+                * device causing mis-fired events.
+                */
+               /* split rc5 data block ... */
+               start = (ircode & 0x2000) >> 13;
+               range = (ircode & 0x1000) >> 12;
+               toggle= (ircode & 0x0800) >> 11;
+               dev   = (ircode & 0x07c0) >> 6;
+               code  = (ircode & 0x003f) | ((range << 6) ^ 0x0040);
+               if( start != 1)
+                       /* no key pressed */
+                       break;
+               if ( dev != 0x1e && dev != 0x1f )
+                       /* not a hauppauge remote */
+                       break;
+               ir_input_keydown(ir->input, &ir->ir, code, ircode);
+               ir->release = jiffies + msecs_to_jiffies(120);
+               break;
        case CX88_BOARD_PINNACLE_PCTV_HD_800i:
                ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
                ir_dprintk("biphase decoded: %x\n", ircode);