Update of /cvsroot/alsa/alsa-kernel/parisc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6776

Modified Files:
        harmony.c 
Log Message:
fixed compilation - using struct parisc_device for DMA allocation.


Index: harmony.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/parisc/harmony.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- harmony.c   24 Apr 2004 14:57:33 -0000      1.8
+++ harmony.c   24 Apr 2004 20:01:49 -0000      1.9
@@ -56,11 +56,7 @@
  * also controls for enabling/disabling internal speaker and line
  * input.
  *
- * Buffers used by this driver are all DMA consistent. Since harmony is
- * not "real" pci device, we use a fake struct pci_dev for
- * pci_alloc_consistent().
- * (note that some machines -712 for ex.- don't implement DMA consistent
- * memory, so we will need to use kmalloc instead)
+ * Buffers used by this driver are all DMA consistent.
  */
 
 #include <linux/delay.h>
@@ -202,8 +198,7 @@
        int cap_stopped;
        int cap_total;
 
-       struct pci_dev *fake_pci_dev; /* The fake pci_dev needed for 
-                                       pci_* functions under ccio. */
+       struct parisc_device *pa_dev;
 
        /* the graveyard buffer is used as recording buffer when playback, 
         * because harmony always want a buffer to put recorded data */
@@ -720,13 +715,6 @@
        snd_pcm_runtime_t *runtime = substream->runtime;
        int err;
        
-       /*
-        * harmony is not "real" pci, but we need a pci_dev
-        * to alloc PCI DMA pages
-        */
-       substream->runtime->dma_private = harmony->fake_pci_dev;
-//     substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI;
-       
        harmony->playback_substream = substream;
        runtime->hw = snd_card_harmony_playback;
        snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 
&hw_constraint_rates);
@@ -743,14 +731,6 @@
        snd_pcm_runtime_t *runtime = substream->runtime;
        int err;
        
-       
-       /*
-        * harmony is not "real" pci, but we need a pci_dev
-        * to alloc PCI DMA pages
-        */
-       substream->runtime->dma_private = harmony->fake_pci_dev;
-//     substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI;
-
        harmony->capture_substream = substream;
        runtime->hw = snd_card_harmony_capture;
        snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, 
&hw_constraint_rates);
@@ -796,12 +776,11 @@
 static int snd_card_harmony_hw_params(snd_pcm_substream_t *substream, 
                           snd_pcm_hw_params_t * hw_params)
 {
-       snd_pcm_runtime_t *runtime = substream->runtime;
        int err;
        
        err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
        DPRINTK(KERN_INFO PFX "HW Params returned %d, dma_addr %lx\n", err,
-                       (unsigned long)runtime->dma_addr);
+                       (unsigned long)substream->runtime->dma_addr);
        return err;
 }
 
@@ -859,7 +838,7 @@
        
        /* initialize graveyard buffer */
        harmony->dma_dev.type = SNDRV_DMA_TYPE_DEV;
-       harmony->dma_dev.dev = snd_dma_pci_data(harmony->fake_pci_dev); 
+       harmony->dma_dev.dev = &harmony->pa_dev->dev;
        harmony->graveyard_addr = snd_dma_alloc_pages(&chip->dma_dev,
                        HARMONY_BUF_SIZE*GRAVEYARD_BUFS, &harmony->graveyard_dma);
        harmony->graveyard_count = 0;
@@ -876,7 +855,7 @@
        harmony->graveyard_count = 0;
        
        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-                                             snd_dma_pci_data(harmony->fake_pci_dev),
+                                             &harmony->pa_dev->dev,
                                              64 * 1024, 128 * 1024);
 
        return 0;
@@ -1020,10 +999,11 @@
        
        harmony->card = card;
        
+       harmony->pa_dev = pa_dev;
+
        /* Set the HPA of harmony */
        harmony->hpa = pa_dev->hpa;
        
-
        harmony->irq = pa_dev->irq;
        if (!harmony->irq) {
                printk(KERN_ERR PFX "no irq found\n");
@@ -1049,8 +1029,6 @@
                return -EBUSY;
        }
        
-       /* a fake pci_dev is needed for pci_* functions under ccio */
-       harmony->fake_pci_dev = ccio_get_fake(pa_dev);
        return 0;
 }
        



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to