diff options
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-mpeg.c | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index f5fb18ee8..eca7b012a 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-mpeg.c,v 1.1 2004/07/29 21:35:48 kraxel Exp $ + * $Id: cx88-mpeg.c,v 1.2 2004/07/30 11:14:05 kraxel Exp $ * * Support for the mpeg transport stream transfers * PCI function #2 of the cx2388x. @@ -426,9 +426,9 @@ static void cx8802_timeout(unsigned long data) spin_unlock_irqrestore(&dev->slock,flags); } -#if 0 static void cx8802_mpeg_irq(struct cx8802_dev *dev) { + struct cx88_core *core = dev->core; u32 status, mask, count; status = cx_read(MO_TS_INTSTAT); @@ -437,34 +437,32 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev) return; cx_write(MO_TS_INTSTAT, status); - //if (irq_debug || (status & mask & ~0xff)) - cx88_print_irqbits(dev->name, "irq mpegport ", + if (mpeg_debug || (status & mask & ~0xff)) + cx88_print_irqbits(core->name, "irq mpeg ", cx88_vid_irqs, status, mask); /* risc op code error */ if (status & (1 << 16)) { - printk(KERN_WARNING "%s: mpegport risc op code error\n",dev->name); + printk(KERN_WARNING "%s: mpeg risc op code error\n",core->name); cx_clear(MO_TS_DMACNTRL, 0x11); - //cx_clear(VID_CAPTURE_CONTROL, 0x06); - cx88_sram_channel_dump(dev, &cx88_sram_channels[SRAM_CH28]); + cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); } /* risc1 y */ if (status & 0x01) { spin_lock(&dev->slock); count = cx_read(MO_TS_GPCNT); - cx8802_wakeup(dev, &dev->mpegq, count); + cx88_wakeup(dev->core, &dev->mpegq, count); spin_unlock(&dev->slock); } /* risc2 y */ if (status & 0x10) { /* I don't know what this does/when it's needed */ spin_lock(&dev->slock); - cx8802_restart_mpegport_queue(dev,&dev->mpegq); + cx8802_restart_queue(dev,&dev->mpegq); spin_unlock(&dev->slock); } } -#endif static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) { @@ -474,17 +472,17 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id, struct pt_regs *regs) int loop, handled = 0; for (loop = 0; loop < 10; loop++) { - status = cx_read(MO_PCI_INTSTAT); + status = cx_read(MO_PCI_INTSTAT) & (~0x1f | 0x04); mask = cx_read(MO_PCI_INTMSK); if (0 == (status & mask)) goto out; handled = 1; cx_write(MO_PCI_INTSTAT, status); -#if 0 /* FIXME */ - if (status & 1) - cx8800_mpeg_irq(dev); -#endif + if (status & mask & ~0x1f) + cx88_irq(core,status,mask); + if (status & 0x04) + cx8802_mpeg_irq(dev); }; if (10 == loop) { printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", @@ -534,19 +532,6 @@ static int __devinit cx8802_initdev(struct pci_dev *pci_dev, } dev->core = core; - /* look what exactly we have ... */ - if (cx88_boards[core->board].blackbird) { - printk("%s/2: cx23416 based mpeg encoder (blackbird design)\n", - core->name); - /* todo */ - } else { - printk("%s/2: don't what the mpeg port on this card is used for\n" - "%s/2: going to ignore it, sorry\n", - core->name, core->name); - err = -EINVAL; - goto fail_core; - } - /* print pci info */ pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); @@ -562,6 +547,23 @@ static int __devinit cx8802_initdev(struct pci_dev *pci_dev, goto fail_core; } + /* look what exactly we have ... */ + if (cx88_boards[core->board].blackbird) { + printk("%s/2: cx23416 based mpeg encoder (blackbird design)\n", + core->name); + /* todo */ + } else if (cx88_boards[core->board].dvb) { + printk("%s/2: has DVB support\n", + core->name); + /* todo */ + } else { + printk("%s/2: don't what the mpeg port on this card is used for\n" + "%s/2: going to ignore it, sorry\n", + core->name, core->name); + err = -EINVAL; + goto fail_core; + } + /* initialize driver struct */ init_MUTEX(&dev->lock); dev->slock = SPIN_LOCK_UNLOCKED; |