[PATCH] Sound Blaster AWE64 PnP detection

From: Andrey Panin (pazke@orbita.don.sitek.net)
Date: Mon Feb 14 2000 - 06:03:46 EST


Hi all,

this small patch fixes detection problem for my Sound Blaster AWE64 PnP (PNPID
CTL00E4).

Best wishes,
                Andrey

--- /mnt/c/linux/drivers/sound/sb_card.c Sun Feb 13 23:48:26 2000
+++ /linux/drivers/sound/sb_card.c Sat Feb 12 00:56:21 2000
@@ -388,37 +388,50 @@
        return(sb_dev);
 }

+static struct { unsigned short vendor, function; } awe64_audio_tbl[] __initdata
= {
+ { ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0042) },
+ { ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0045) },
+ { 0 }
+};
+
 static struct pci_dev *sb_init_awe64(struct pci_bus *card, struct address_info
*hw_config, struct address_info *mpu_config)
 {
- printk(KERN_INFO "sb: SoundBlaster AWE 64 detected\n");
+ int i;
+
+ printk(KERN_INFO "sb: %s detected\n", card->name);

        /* CTL0042:Audio. */

- if((sb_dev = isapnp_find_dev(card,
- ISAPNP_VENDOR('C','T','L'),
ISAPNP_FUNCTION(0x0042), NULL)))
- {
- sb_dev->prepare(sb_dev);
+ for (i = 0; awe64_audio_tbl[i].vendor != 0; i++) {
+ if ((sb_dev = isapnp_find_dev(card,
+ awe64_audio_tbl[i].vendor,
+ awe64_audio_tbl[i].function,
+ NULL))) {
+ sb_dev->prepare(sb_dev);

- if(sb_dev->activate(sb_dev) >= 0)
- {
- hw_config->io_base = sb_dev->resource[0].start;
- hw_config->irq = sb_dev->irq_resource[0].start;
- hw_config->dma = sb_dev->dma_resource[0].start;
- hw_config->dma2 = sb_dev->dma_resource[1].start;
-
- mpu_config->io_base = sb_dev->resource[1].start;
-
- check_base("AWE64", "sb", &sb_dev->resource[0]);
- check_base("AWE64", "mpu", &sb_dev->resource[1]);
- check_base("AWE64", "opl3", &sb_dev->resource[2]);
+ if(sb_dev->activate(sb_dev) >= 0)
+ {
+ hw_config->io_base =
sb_dev->resource[0].start;
+ hw_config->irq =
sb_dev->irq_resource[0].start;
+ hw_config->dma =
sb_dev->dma_resource[0].start;
+ hw_config->dma2 =
sb_dev->dma_resource[1].start;
+
+ mpu_config->io_base =
sb_dev->resource[1].start;
+
+ check_base("AWE64", "sb",
&sb_dev->resource[0]);
+ check_base("AWE64", "mpu",
&sb_dev->resource[1]);
+ check_base("AWE64", "opl3",
&sb_dev->resource[2]);
+ }
+ else
+ printk(KERN_ERR "sb: AWE64 sb config failed (out
of resources?)\n");
+
+ goto found;
                }
- else
- printk(KERN_ERR "sb: AWE64 sb config failed (out of
resources?)\n");
        }
- else
- printk(KERN_ERR "sb: AWE64 panic! sb base not found\n");
-
+
+ printk(KERN_ERR "sb: AWE64 panic! sb base not found\n");

+found:
        /* CTL7002:Game */

        if((jp_dev = isapnp_find_dev(card,
@@ -471,6 +484,7 @@
        {ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0043), &sb_init_generic,
"Sound Blaster 16" },
        {ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0044), &sb_init_generic,
"Sound Blaster 16" },
        {ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x0045), &sb_init_generic,
"Sound Blaster 16" },
+ {ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x00e4), &sb_init_awe64,
"Sound Blaster AWE 64" },
        {ISAPNP_VENDOR('C','T','L'), ISAPNP_FUNCTION(0x009D), &sb_init_awe64,
"Sound Blaster AWE 64" },
        {ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x1868),
&sb_init_ess, "ESS 1868" },
        {ISAPNP_VENDOR('E','S','S'), ISAPNP_FUNCTION(0x8611),
&sb_init_ess, "ESS 1868" },
@@ -500,10 +514,10 @@
                printk(KERN_ERR "sb: Valid range for isapnpjump is 0-%d.
Adjusted to 0.\n", i-1);
                isapnpjump = 0;
        }
-
+
        for (i = isapnpjump; isapnp_sb_list[i].vendor != 0; i++) {
                struct pci_bus *card = NULL;
-
+
                while ((card = isapnp_find_card(
                                               isapnp_sb_list[i].vendor,
                                               isapnp_sb_list[i].function,

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:26 EST