Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] PNP quirks
@ 2000-03-05 14:20 Alessandro Zummo
  2000-03-05 14:24 ` Alessandro Zummo
  0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Zummo @ 2000-03-05 14:20 UTC (permalink / raw)
  To: linux-sound


 Here is a patch which solves some troubles with the CMI8330
 sound card.

 Patch is against 2.3.49.
-- 

   - *Alex* -

  http://freepage.logicom.it/azummo/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] PNP quirks
  2000-03-05 14:20 [PATCH] PNP quirks Alessandro Zummo
@ 2000-03-05 14:24 ` Alessandro Zummo
  0 siblings, 0 replies; 2+ messages in thread
From: Alessandro Zummo @ 2000-03-05 14:24 UTC (permalink / raw)
  To: linux-sound

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

  Amiga............: YAM          http://www.yam.ch/
  Unix.............: Metamail     ftp://ftp.bellcore.com/nsb/
  Windows/Macintosh: Eudora       http://www.qualcomm.com/

General info about MIME can be found at:

http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/mime-faq/top.html


[-- Attachment #2: Type: text/plain, Size: 222 bytes --]


 Here is a patch which solves some troubles with the CMI8330
 sound card.

 Patch is against 2.3.49.

 sorry..i always forget to include the patch in the mail *:-)
-- 

   - *Alex* -

  http://freepage.logicom.it/azummo/

[-- Attachment #3: patch-cmi --]
[-- Type: text/plain, Size: 2231 bytes --]

--- linux/drivers/sound/sb_card.c	Mon Feb 28 21:18:09 2000
+++ sb-linux/drivers/sound/sb_card.c	Sun Mar  5 16:13:15 2000
@@ -290,29 +290,8 @@
 	if((sb_dev = isapnp_find_dev(bus,
 		ISAPNP_VENDOR('@','X','@'), ISAPNP_FUNCTION(0x0001), NULL)))
 	{
-#ifdef CMI8330_DMA0BAD
-		int dmahack = 0;
-#endif
 		sb_dev->prepare(sb_dev);
 		
-		/*  This device doesn't work with DMA 0, so we must allocate
-		 *  it to prevent PnP routines to assign it to the card.
-		 *
-		 *  I know i could have inlined the following lines, but it's cleaner
-		 *  this way.
-		 */
-	
-#ifdef CMI8330_DMA0BAD
-		if(sb_dev->dma_resource[0].start == 0)
-		{
-			if(!request_dma(0, "cmi8330 dma hack"))
-			{
-				/* DMA was free, we now have it */
-				dmahack = 1;
-			}
-		}
-#endif
-
 		if((sb_dev = activate_dev("CMI8330", "sb", sb_dev)))
 		{
 			hw_config->io_base 	= sb_dev->resource[0].start;
@@ -323,9 +302,6 @@
 			show_base("CMI8330", "sb", &sb_dev->resource[0]);
 		}
 
-#ifdef CMI8330_DMA0BAD
-		if(dmahack) free_dma(0);
-#endif
 		if(!sb_dev) return(NULL);
 	}
 	else
--- linux/drivers/pnp/quirks.c	Mon Feb 28 21:16:56 2000
+++ sb-linux/drivers/pnp/quirks.c	Sun Mar  5 15:56:48 2000
@@ -45,7 +45,26 @@
 		port3->min += 0x800;
 		port3->max += 0x800;
 	}
	printk(KERN_INFO "ISAPnP: AWE32 quirk - adding two ports\n");
+}
+
+static void __init quirk_cmi8330_resources(struct pci_dev *dev)
+{
+	struct isapnp_resources *res = dev->sysdata;
+
+	for ( ; res ; res = res->alt ) {
+
+		struct isapnp_irq *irq;
+		struct isapnp_dma *dma;
+	
+		for( irq = res->irq; irq; irq = irq->next )	// Valid irqs are 5, 7, 10
+			irq->map = 0x04A0;						// 0000 0100 1010 0000
+
+		for( dma = res->dma; dma; dma = dma->next ) // Valid 8bit dma channels are 1,3
+			if( ( dma->flags & IORESOURCE_DMA_TYPE_MASK ) == IORESOURCE_DMA_8BIT )
+				dma->map = 0x000A;
+	}
+	printk(KERN_INFO "isapnp: CMI8330 quirk - fixing interrupts and dma\n");
 }
 
 
@@ -61,6 +80,8 @@
 		quirk_awe32_resources },
 	{ ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x0023),
 		quirk_awe32_resources },
+	{ ISAPNP_VENDOR('@','X','@'), ISAPNP_DEVICE(0x0001), // CMI8330 
+		quirk_cmi8330_resources },
 	{ 0 }
 };

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-03-05 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-05 14:20 [PATCH] PNP quirks Alessandro Zummo
2000-03-05 14:24 ` Alessandro Zummo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox