Skip to contentSkip to conversation

PNP quirks

PATCH New Alessandro Zummo 1 participant 2 messages Mar 5, 2000

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PNP quirks

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

Patch is against 2.3.49.

Signature · 3 lines
   - *Alex* -

  http://freepage.logicom.it/azummo/
#1 lore raw

PATCH 1/1 PNP quirks

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 *:-)

Signature · 3 lines
   - *Alex* -

  http://freepage.logicom.it/azummo/
drivers/sound/sb_card.c +0 -24
@@ -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
drivers/pnp/quirks.c +0 -0
@@ -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 }
};