Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[sfrench/cifs-2.6.git] / drivers / media / video / cx88 / cx88-alsa.c
index 40ffd7a5579a6f49347263cb21ad287b0ec1e6b7..e976fc6bef7ccc7c6ec747fc5594f7a720aff505 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/pci.h>
 
 #include <asm/delay.h>
-#include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -284,7 +283,7 @@ static int dsp_buffer_free(snd_cx88_card_t *chip)
        BUG_ON(!chip->dma_size);
 
        dprintk(2,"Freeing buffer\n");
-       videobuf_pci_dma_unmap(chip->pci, chip->dma_risc);
+       videobuf_sg_dma_unmap(&chip->pci->dev, chip->dma_risc);
        videobuf_dma_free(chip->dma_risc);
        btcx_riscmem_free(chip->pci,&chip->buf->risc);
        kfree(chip->buf);
@@ -386,7 +385,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
        BUG_ON(!chip->dma_size);
        BUG_ON(chip->num_periods & (chip->num_periods-1));
 
-       buf = videobuf_pci_alloc(sizeof(*buf));
+       buf = videobuf_sg_alloc(sizeof(*buf));
        if (NULL == buf)
                return -ENOMEM;
 
@@ -397,14 +396,14 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
        buf->vb.height = chip->num_periods;
        buf->vb.size   = chip->dma_size;
 
-       dma=videobuf_to_dma(&buf->vb);
+       dma = videobuf_to_dma(&buf->vb);
        videobuf_dma_init(dma);
        ret = videobuf_dma_init_kernel(dma, PCI_DMA_FROMDEVICE,
                        (PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT));
        if (ret < 0)
                goto error;
 
-       ret = videobuf_pci_dma_map(chip->pci,dma);
+       ret = videobuf_sg_dma_map(&chip->pci->dev, dma);
        if (ret < 0)
                goto error;
 
@@ -417,7 +416,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
        buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC);
        buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
 
-       buf->vb.state = STATE_PREPARED;
+       buf->vb.state = VIDEOBUF_PREPARED;
 
        chip->buf = buf;
        chip->dma_risc = dma;
@@ -495,7 +494,7 @@ static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream)
 
        count = atomic_read(&chip->count);
 
-//     dprintk(2, "%s - count %d (+%u), period %d, frame %lu\n", __FUNCTION__,
+//     dprintk(2, "%s - count %d (+%u), period %d, frame %lu\n", __func__,
 //             count, new, count & (runtime->periods-1),
 //             runtime->period_size * (count & (runtime->periods-1)));
        return runtime->period_size * (count & (runtime->periods-1));
@@ -691,10 +690,8 @@ MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl);
 static int snd_cx88_free(snd_cx88_card_t *chip)
 {
 
-       if (chip->irq >= 0){
-               synchronize_irq(chip->irq);
+       if (chip->irq >= 0)
                free_irq(chip->irq, chip);
-       }
 
        cx88_core_put(chip->core,chip->pci);