Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Alessandro Zummo <azummo@ita.flashnet.it>
To: linux-sound@vger.kernel.org
Subject: [PATCH] PNP quirks
Date: Sun, 05 Mar 2000 14:24:20 +0000	[thread overview]
Message-ID: <marc-linux-sound-95227016421731@msgid-missing> (raw)
In-Reply-To: <marc-linux-sound-95227016321725@msgid-missing>

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

      reply	other threads:[~2000-03-05 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-05 14:20 [PATCH] PNP quirks Alessandro Zummo
2000-03-05 14:24 ` Alessandro Zummo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-sound-95227016421731@msgid-missing \
    --to=azummo@ita.flashnet.it \
    --cc=linux-sound@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox