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/
--- 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 }
};