]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cx88/cx88-input.c
Merge branch 'linus' into x86/xen
[linux-2.6-omap-h63xx.git] / drivers / media / video / cx88 / cx88-input.c
index f5d4a565346e30cb43c2d7d41b5c07b9cee7a9ae..53526d997a4e97923231ead7736fa2f9c9c089cf 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/input.h>
 #include <linux/pci.h>
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 
 #include "cx88.h"
 #include <media/ir-common.h>
@@ -58,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]");
 
@@ -74,7 +73,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
 
        /* read gpio value */
        gpio = cx_read(ir->gpio_addr);
-       switch (core->board) {
+       switch (core->boardnr) {
        case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
                /* This board apparently uses a combination of 2 GPIO
                   to represent the keys. Additionally, the second GPIO
@@ -113,7 +112,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
                   (gpio & ir->mask_keydown) ? " down" : "",
                   (gpio & ir->mask_keyup) ? " up" : "");
 
-       if (ir->core->board == CX88_BOARD_NORWOOD_MICRO) {
+       if (ir->core->boardnr == CX88_BOARD_NORWOOD_MICRO) {
                u32 gpio_key = cx_read(MO_GP0_IO);
 
                data = (data << 4) | ((gpio_key & 0xf0) >> 4);
@@ -159,7 +158,7 @@ static void cx88_ir_work(struct work_struct *work)
        mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
 }
 
-static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
+void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
 {
        if (ir->polling) {
                setup_timer(&ir->timer, ir_timer, (unsigned long)ir);
@@ -167,17 +166,17 @@ static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
                schedule_work(&ir->work);
        }
        if (ir->sampling) {
-               core->pci_irqmask |= (1 << 18); /* IR_SMP_INT */
+               core->pci_irqmask |= PCI_INT_IR_SMPINT;
                cx_write(MO_DDS_IO, 0xa80a80);  /* 4 kHz sample rate */
                cx_write(MO_DDSCFG_IO, 0x5);    /* enable */
        }
 }
 
-static void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
+void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
 {
        if (ir->sampling) {
                cx_write(MO_DDSCFG_IO, 0x0);
-               core->pci_irqmask &= ~(1 << 18);
+               core->pci_irqmask &= ~PCI_INT_IR_SMPINT;
        }
 
        if (ir->polling) {
@@ -204,7 +203,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
        ir->input = input_dev;
 
        /* detect & configure */
-       switch (core->board) {
+       switch (core->boardnr) {
        case CX88_BOARD_DNTV_LIVE_DVB_T:
        case CX88_BOARD_KWORLD_DVB_T:
        case CX88_BOARD_KWORLD_DVB_T_CX22702:
@@ -259,6 +258,13 @@ 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:
+               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 +312,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) {
@@ -314,8 +331,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
        }
 
        /* init input device */
-       snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)",
-                cx88_boards[core->board].name);
+       snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
        snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
 
        ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
@@ -406,7 +422,7 @@ void cx88_ir_irq(struct cx88_core *core)
                ir_dump_samples(ir->samples, ir->scount);
 
        /* decode it */
-       switch (core->board) {
+       switch (core->boardnr) {
        case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1:
        case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
                ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4);
@@ -445,6 +461,7 @@ 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_PINNACLE_PCTV_HD_800i:
                ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
                ir_dprintk("biphase decoded: %x\n", ircode);
                if ((ircode & 0xfffff000) != 0x3000)