Update of /cvsroot/alsa/alsa-kernel/pci/emu10k1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23362/pci/emu10k1
Modified Files: emu10k1_main.c emufx.c emupcm.c 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: emu10k1_main.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- emu10k1_main.c 2 Mar 2004 15:32:37 -0000 1.31 +++ emu10k1_main.c 6 Mar 2004 16:51:30 -0000 1.32 @@ -640,8 +640,8 @@ emu->irq = pci->irq; memset(&emu->dma_dev, 0, sizeof(emu->dma_dev)); - emu->dma_dev.type = SNDRV_DMA_TYPE_PCI; - emu->dma_dev.dev.pci = pci; + emu->dma_dev.type = SNDRV_DMA_TYPE_DEV; + emu->dma_dev.dev = snd_dma_pci_data(pci); emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT; if (snd_dma_alloc_pages(&emu->dma_dev, 32 * 1024, &emu->ptb_pages) < 0) { Index: emufx.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emufx.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- emufx.c 2 Mar 2004 15:32:37 -0000 1.50 +++ emufx.c 6 Mar 2004 16:51:30 -0000 1.51 @@ -26,6 +26,7 @@ */ #include <sound/driver.h> +#include <linux/pci.h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/init.h> @@ -760,7 +761,7 @@ strcpy(pcm->name, "EMU10K1 FX8010"); emu->pcm_fx8010 = pcm; - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI, emu->pci, 64*1024, 0); + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 0); if (rpcm) *rpcm = pcm; Index: emupcm.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emupcm.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- emupcm.c 2 Mar 2004 15:32:37 -0000 1.24 +++ emupcm.c 6 Mar 2004 16:51:30 -0000 1.25 @@ -26,6 +26,7 @@ */ #include <sound/driver.h> +#include <linux/pci.h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/time.h> @@ -998,11 +999,11 @@ emu->pcm = pcm; for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) - if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_PCI_SG, emu->pci, 64*1024, 64*1024)) < 0) + if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0) return err; for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next) - snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_PCI, emu->pci, 64*1024, 64*1024); + snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); if (rpcm) *rpcm = pcm; @@ -1048,7 +1049,7 @@ strcpy(pcm->name, "EMU10K1 MIC"); emu->pcm_mic = pcm; - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI, emu->pci, 64*1024, 64*1024); + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); if (rpcm) *rpcm = pcm; @@ -1157,7 +1158,7 @@ emu->efx_voices_mask[1] = 0; snd_ctl_add(emu->card, snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu)); - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI, emu->pci, 64*1024, 64*1024); + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); return 0; } Index: memory.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/memory.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- memory.c 2 Mar 2004 15:32:37 -0000 1.15 +++ memory.c 6 Mar 2004 16:51:30 -0000 1.16 @@ -297,7 +297,6 @@ int page, err, idx; snd_assert(emu, return NULL); - snd_assert(substream->dma_device.type == SNDRV_DMA_TYPE_PCI_SG, return NULL); snd_assert(runtime->dma_bytes > 0 && runtime->dma_bytes < MAXPAGES * EMUPAGESIZE, return NULL); hdr = emu->memhdr; snd_assert(hdr, return NULL); ------------------------------------------------------- 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