diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-13 22:59:37 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-13 22:59:37 +0000 |
commit | ac4e05df065bba889cae236d96371a3f170b1eb4 (patch) | |
tree | 5768824394b881df711a561a56f3fec035729aaa /linux/drivers/media/video/cx88 | |
parent | 8944384ab4b1ee62190e3da6da4d17413e423adc (diff) | |
download | mediapointer-dvb-s2-ac4e05df065bba889cae236d96371a3f170b1eb4.tar.gz mediapointer-dvb-s2-ac4e05df065bba889cae236d96371a3f170b1eb4.tar.bz2 |
several fixes at videobuf stuff.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-alsa.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c index 6e7a1d5e4..74ca95624 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.15 2005/12/13 22:14:01 mchehab Exp $ + * $Id: cx88-alsa.c,v 1.16 2005/12/13 22:59:37 mchehab Exp $ * * Support for audio capture * PCI function #1 of the cx2388x. @@ -67,7 +67,6 @@ enum { DEVICE_DIGITAL, DEVICE_ANALOG }; struct cx88_audio_dev { struct cx88_core *core; - struct cx88_buffer *buf; struct cx88_dmaqueue q; /* pci i/o */ @@ -161,13 +160,20 @@ MODULE_PARM_DESC(debug,"enable debug messages"); * BOARD Specific: Sets audio DMA */ -int _cx88_start_audio_dma(snd_cx88_card_t *chip) +int _cx88_start_audio_dma(snd_cx88_card_t *chip, + struct cx88_dmaqueue *q, + struct cx88_buffer *buf) { struct cx88_core *core=chip->core; dprintk(1, "Starting audio DMA\n"); + + /* setup fifo + format - out channel */ + cx88_sram_channel_setup(chip->core, &cx88_sram_channels[SRAM_CH25], + buf->bpl, buf->risc.dma); + /* sets bpl size */ - cx_write(MO_AUDD_LNGTH, chip->buf->bpl); + cx_write(MO_AUDD_LNGTH, buf->bpl); /* reset counter */ cx_write(MO_AUDD_GPCNTRL,GP_COUNT_CONTROL_RESET); @@ -185,6 +191,8 @@ int _cx88_start_audio_dma(snd_cx88_card_t *chip) cx_set(MO_DEV_CNTRL2, (1<<5)); /* Enables Risc Processor */ cx_set(MO_AUD_DMACNTRL, 0x11); /* audio downstream FIFO and RISC enable */ + q->count = 1; + return 0; } @@ -290,7 +298,7 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs) for (loop = 0; loop < MAX_IRQ_LOOP; loop++) { status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x02); if (0 == status) - goto out; + goto out; dprintk( 1, "cx8801_irq\n" ); dprintk( 1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); dprintk( 1, " status: %d\n", status ); @@ -300,12 +308,12 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id, struct pt_regs *regs) if (status & core->pci_irqmask) { dprintk( 1, " passing to core\n" ); - cx88_core_irq(core,status); + cx88_core_irq(core,status); } if (status & 0x02) { dprintk( 1, " ALSA IRQ handling\n" ); - cx8801_aud_irq(chip); + cx8801_aud_irq(chip); } }; @@ -421,7 +429,6 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) struct cx88_buffer *prev; struct cx8801_fh *fh = vq->priv_data; struct cx88_audio_dev *chip = fh->dev; - struct cx88_core *core = chip->core; struct cx88_dmaqueue *q = &chip->q; /* add jump to stopper */ @@ -436,7 +443,9 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) } else if (list_empty(&q->active)) { list_add_tail(&buf->vb.queue,&q->active); - start_video_dma(chip, q, buf); + + _cx88_start_audio_dma(chip, q, buf); + buf->vb.state = STATE_ACTIVE; buf->count = q->count++; mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); @@ -623,11 +632,6 @@ static int snd_cx88_prepare(snd_pcm_substream_t *substream) chip->dma_size = snd_pcm_lib_buffer_bytes(substream); chip->period_size = snd_pcm_lib_period_bytes(substream); - - /* setup fifo + format - out channel */ - cx88_sram_channel_setup(chip->core, &cx88_sram_channels[SRAM_CH25], - chip->buf->bpl, chip->buf->risc.dma); - spin_unlock_irq(&chip->reg_lock); return 0; } @@ -645,9 +649,9 @@ static int snd_cx88_card_trigger(snd_pcm_substream_t *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: - err=_cx88_start_audio_dma(chip); +// err=_cx88_start_audio_dma(chip); case SNDRV_PCM_TRIGGER_STOP: - err=_cx88_stop_audio_dma(chip); +// err=_cx88_stop_audio_dma(chip); default: err=-EINVAL; } @@ -665,7 +669,7 @@ static snd_pcm_uframes_t snd_cx88_pointer(snd_pcm_substream_t *substream) snd_cx88_card_t *chip = snd_pcm_substream_chip(substream); snd_pcm_runtime_t *runtime = substream->runtime; - //return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes); +// return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes); } /* @@ -911,8 +915,8 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci, #if 0 if (!request_mem_region(pci_resource_start(pci,0), - pci_resource_len(pci,0), - "CX88 audio")) { + pci_resource_len(pci,0), + "CX88 audio")) { err = -EBUSY; printk(KERN_ERR "%s: can't get MMIO memory @ 0x%lx\n", "CX88 audio",pci_resource_start(pci,0)); |