Update of /cvsroot/alsa/alsa-kernel/pci/trident
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23362/pci/trident

Modified Files:
        trident_main.c trident_memory.c 
Log Message:
- clean up the DMA code again.
  now only struct device pointer is handled for every BUS type.
  the pointer must be given via the corresponding macro snd_dma_xxx_data().
- added the hack for dma_alloc_coherent() to accept dev = NULL for ISA
  buffers.
- added the missing include files.


Index: trident_main.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/trident/trident_main.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- trident_main.c      2 Mar 2004 15:32:38 -0000       1.54
+++ trident_main.c      6 Mar 2004 16:51:31 -0000       1.55
@@ -1009,8 +1009,6 @@
        snd_trident_voice_t *voice = (snd_trident_voice_t *) runtime->private_data;
        unsigned int val, ESO_bytes;
 
-       snd_assert(substream->dma_device.type == SNDRV_DMA_TYPE_PCI, return -EIO);
-
        spin_lock(&trident->reg_lock);
 
        // Initilize the channel and set channel Mode
@@ -2189,10 +2187,15 @@
        if (trident->tlb.entries) {
                snd_pcm_substream_t *substream;
                for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; 
substream; substream = substream->next)
-                       snd_pcm_lib_preallocate_pages(substream, 
SNDRV_DMA_TYPE_PCI_SG, trident->pci, 64*1024, 128*1024);
-               
snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, 
SNDRV_DMA_TYPE_PCI, trident->pci, 64*1024, 128*1024);
+                       snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG,
+                                                     snd_dma_pci_data(trident->pci),
+                                                     64*1024, 128*1024);
+               
snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
+                                             SNDRV_DMA_TYPE_DEV, 
snd_dma_pci_data(trident->pci),
+                                             64*1024, 128*1024);
        } else {
-               snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI, 
trident->pci, 64*1024, 128*1024);
+               snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
+                                                     snd_dma_pci_data(trident->pci), 
64*1024, 128*1024);
        }
 
        if (rpcm)
@@ -2246,9 +2249,11 @@
        trident->foldback = foldback;
 
        if (trident->tlb.entries)
-               snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_PCI_SG, 
trident->pci, 0, 128*1024);
+               snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_DEV_SG,
+                                                     snd_dma_pci_data(trident->pci), 
0, 128*1024);
        else
-               snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_PCI, 
trident->pci, 64*1024, 128*1024);
+               snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_DEV,
+                                                     snd_dma_pci_data(trident->pci), 
64*1024, 128*1024);
 
        if (rpcm)
                *rpcm = foldback;
@@ -2287,7 +2292,7 @@
        strcpy(spdif->name, "Trident 4DWave IEC958");
        trident->spdif = spdif;
 
-       snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_PCI, trident->pci, 
64*1024, 128*1024);
+       snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_DEV, 
snd_dma_pci_data(trident->pci), 64*1024, 128*1024);
 
        if (rpcm)
                *rpcm = spdif;
@@ -3584,8 +3589,8 @@
        trident->irq = pci->irq;
 
        memset(&trident->dma_dev, 0, sizeof(trident->dma_dev));
-       trident->dma_dev.type = SNDRV_DMA_TYPE_PCI;
-       trident->dma_dev.dev.pci = pci;
+       trident->dma_dev.type = SNDRV_DMA_TYPE_DEV;
+       trident->dma_dev.dev = snd_dma_pci_data(pci);
 
        /* allocate 16k-aligned TLB for NX cards */
        trident->tlb.entries = NULL;

Index: trident_memory.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/trident/trident_memory.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- trident_memory.c    2 Mar 2004 15:32:38 -0000       1.12
+++ trident_memory.c    6 Mar 2004 16:51:31 -0000       1.13
@@ -191,7 +191,6 @@
        int idx, page;
        struct snd_sg_buf *sgbuf = runtime->dma_private;
 
-       snd_assert(substream->dma_device.type == SNDRV_DMA_TYPE_PCI_SG, return NULL);
        snd_assert(runtime->dma_bytes > 0 && runtime->dma_bytes <= 
SNDRV_TRIDENT_MAX_PAGES * SNDRV_TRIDENT_PAGE_SIZE, return NULL);
        hdr = trident->tlb.memhdr;
        snd_assert(hdr != NULL, return NULL);
@@ -240,7 +239,6 @@
        dma_addr_t addr;
        unsigned long ptr;
 
-       snd_assert(substream->dma_device.type == SNDRV_DMA_TYPE_PCI, return NULL);
        snd_assert(runtime->dma_bytes> 0 && runtime->dma_bytes <= 
SNDRV_TRIDENT_MAX_PAGES * SNDRV_TRIDENT_PAGE_SIZE, return NULL);
        hdr = trident->tlb.memhdr;
        snd_assert(hdr != NULL, return NULL);
@@ -276,7 +274,7 @@
 {
        snd_assert(trident != NULL, return NULL);
        snd_assert(substream != NULL, return NULL);
-       if (substream->dma_device.type == SNDRV_DMA_TYPE_PCI_SG)
+       if (substream->dma_device.type == SNDRV_DMA_TYPE_DEV_SG)
                return snd_trident_alloc_sg_pages(trident, substream);
        else
                return snd_trident_alloc_cont_pages(trident, substream);



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to