[parisc-linux-cvs] linux deller

Helge Deller deller@gmx.de
Sat, 5 Jan 2002 00:54:20 +0100


--------------Boundary-00=_KEUFOEPBLVA1U9O493J1
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

On Saturday 05 January 2002 00:51, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux
> Changes by:	deller	02/01/04 16:51:16
>
> Modified files:
> 	drivers/sound  : harmony.c
>
> Log message:
> - this should fix the assert() with harmony and ccio based machines

--------------Boundary-00=_KEUFOEPBLVA1U9O493J1
Content-Type: text/plain;
  charset="iso-8859-1";
  name="diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="diff"

Index: drivers/sound/harmony.c
===================================================================
RCS file: /var/cvs/linux/drivers/sound/harmony.c,v
retrieving revision 1.17
diff -u -p -r1.17 harmony.c
--- drivers/sound/harmony.c	2002/01/03 23:20:31	1.17
+++ drivers/sound/harmony.c	2002/01/04 23:50:05
@@ -201,6 +201,9 @@ struct harmony_dev {
 		
 	int audio_open, mixer_open;
 	int dsp_unit, mixer_unit;
+
+	struct pci_dev *fake_pci_dev; /* The fake pci_dev needed for 
+					pci_* functions under ccio. */
 };
 
 
@@ -232,7 +235,8 @@ static int __init harmony_alloc_buffer(s
 {
 	b->len = buffer_count * HARMONY_BUF_SIZE;
 	if (prefer_consistent)
-	  b->addr = pci_alloc_consistent(NULL, b->len, &b->dma_handle);
+	  b->addr = pci_alloc_consistent(harmony.fake_pci_dev, 
+			  b->len, &b->dma_handle);
 	else
 	  b->addr = NULL; /* don't use DMA consistent memory */
 	if (b->addr) {
@@ -257,7 +261,8 @@ static void __exit harmony_free_buffer(s
 		return;
 
 	if (b->dma_consistent)
-		pci_free_consistent(NULL, b->len, b->addr, b->dma_handle);
+		pci_free_consistent(harmony.fake_pci_dev,
+				b->len, b->addr, b->dma_handle);
 	else
 		kfree(b->addr);
 	b->addr = NULL;
@@ -1215,6 +1220,9 @@ harmony_driver_callback(struct parisc_de
 		return -EBUSY;
 	}
 
+	/* a fake pci_dev is needed for pci_* functions under ccio */
+	harmony.fake_pci_dev = ccio_get_fake(dev);
+	
 	/* Initialize the memory buffers, 
 	 * graveyard and silent buffers don't really need consistent memory */
 	if (harmony_alloc_buffer(&played_buf, MAX_BUFS, 1) || 

--------------Boundary-00=_KEUFOEPBLVA1U9O493J1--