summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-12-10 11:15:54 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-12-10 11:15:54 +0000
commitf17d20b881ba3ed38555933302304aca3623647b (patch)
tree483cabb15d5742a19f33f52d56ccb90969245b83 /linux/drivers/media
parentc62472999e6519d60fee667f4c3c8162a45c0c55 (diff)
downloadmediapointer-dvb-s2-f17d20b881ba3ed38555933302304aca3623647b.tar.gz
mediapointer-dvb-s2-f17d20b881ba3ed38555933302304aca3623647b.tar.bz2
Fixed some DMA handlers. Yet to be tested.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c79
1 files changed, 31 insertions, 48 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index 21f915754..ecc289433 100644
--- a/linux/drivers/media/video/cx88/cx88-alsa.c
+++ b/linux/drivers/media/video/cx88/cx88-alsa.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-alsa.c,v 1.12 2005/12/10 03:41:57 mchehab Exp $
+ * $Id: cx88-alsa.c,v 1.13 2005/12/10 11:15:54 mchehab Exp $
*
* Support for audio capture
* PCI function #1 of the cx2388x.
@@ -141,18 +141,22 @@ int _cx88_start_audio_dma(snd_cx88_card_t *chip)
struct cx88_core *core=chip->core;
/* setup fifo + format - out channel */
- cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26],
+ cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25],
chip->buf->bpl, chip->buf->risc.dma);
- /* FIXME reset counter */
- cx_write(MO_VIDY_GPCNTRL,GP_COUNT_CONTROL_RESET);
+ /* sets bpl size */
+ cx_write(MO_AUDD_LNGTH, chip->buf->bpl);
+
+ /* reset counter */
+ cx_write(MO_AUDD_GPCNTRL,GP_COUNT_CONTROL_RESET);
/* enable irqs */
cx_set(MO_PCI_INTMSK, chip->core->pci_irqmask | 0x02);
/* Enables corresponding bits at AUD_INT_STAT */
-#if 1
- cx_set(MO_AUD_INTMSK, (1<<21)||(1<<19));
+#if 1 /*keep*/
+ /* Maybe necessary to enable other errors */
+ cx_set(MO_AUD_INTMSK, (1<<21)||(1<<19)||(1<<16)||1);
#endif
/* start dma */
@@ -173,7 +177,6 @@ int _cx88_stop_audio_dma(snd_cx88_card_t *chip)
/* disable irqs */
cx_clear(MO_PCI_INTMSK, 0x000002);
-
cx_set(MO_AUD_INTMSK, 0);
return 0;
}
@@ -194,23 +197,25 @@ static void cx8801_timeout(unsigned long data)
#endif
}
-/* FIXME: Wrong values*/
static char *cx88_aud_irqs[32] = {
- "y_risci1", "u_risci1", "v_risci1", "vbi_risc1",
- "y_risci2", "u_risci2", "v_risci2", "vbi_risc2",
- "y_oflow", "u_oflow", "v_oflow", "vbi_oflow",
- "y_sync", "u_sync", "v_sync", "vbi_sync",
- "opc_err", "par_err", "rip_err", "pci_abort",
+ "dn_risci1", "up_risci1", "rds_dn_risc1", /* 0-2 */
+ "", /* reserved */
+ "dn_risci2", "up_risci2", "rds_dn_risc2", /* 4-6 */
+ "", /* reserved */
+ "dnf_of", "upf_uf", "rds_dnf_uf", /* 8-10 */
+ "", /* reserved */
+ "dn_sync", "up_sync", "rds_dn_sync", /* 12-14 */
+ "", /* reserved */
+ "opc_err", "par_err", "rip_err", /* 16-18 */
+ "pci_abort", "ber_irq", "mchg_irq" /* 19-21 */
};
-
static void cx8801_aud_irq(snd_cx88_card_t *chip)
{
struct cx88_core *core = chip->core;
u32 status, mask;
-#if 0
u32 count;
-#endif
+
status = cx_read(MO_AUD_INTSTAT);
mask = cx_read(MO_AUD_INTMSK);
if (0 == (status & mask))
@@ -219,47 +224,25 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
if (debug || (status & mask & ~0xff))
cx88_print_irqbits(core->name, "irq aud",
cx88_aud_irqs, status, mask);
-#if 0 /* FIXME */
/* risc op code error */
if (status & (1 << 16)) {
printk(KERN_WARNING "%s/0: video risc op code error\n",core->name);
- cx_clear(MO_VID_DMACNTRL, 0x11);
+ cx_clear(MO_AUD_DMACNTRL, 0x11);
+#if 0 /* FIXME: anything else? */
cx_clear(VID_CAPTURE_CONTROL, 0x06);
- cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH21]);
+#endif
+ cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]);
}
- /* risc1 y */
+ /* risc1 downstream */
if (status & 0x01) {
- spin_lock(&dev->slock);
- count = cx_read(MO_VIDY_GPCNT);
- cx88_wakeup(dev->core, &dev->vidq, count);
- spin_unlock(&dev->slock);
- }
-
- /* risc1 vbi */
- if (status & 0x08) {
- spin_lock(&dev->slock);
- count = cx_read(MO_VBI_GPCNT);
- cx88_wakeup(dev->core, &dev->vbiq, count);
- spin_unlock(&dev->slock);
+ spin_lock_irq(&chip->reg_lock);
+ count = cx_read(MO_AUDD_GPCNT);
+ cx88_wakeup(core, &chip->q, count);
+ spin_unlock_irq(&chip->reg_lock);
}
- /* risc2 y */
- if (status & 0x10) {
- dprintk(2,"stopper video\n");
- spin_lock(&dev->slock);
- restart_video_queue(dev,&dev->vidq);
- spin_unlock(&dev->slock);
- }
-
- /* risc2 vbi */
- if (status & 0x80) {
- dprintk(2,"stopper vbi\n");
- spin_lock(&dev->slock);
- cx8800_restart_vbi_queue(dev,&dev->vbiq);
- spin_unlock(&dev->slock);
- }
-#endif
+ /* FIXME: Any other status should deserve a special handling? */
}
static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs)