Update of /cvsroot/alsa/alsa-kernel/isa/cs423x
In directory sc8-pr-cvs1:/tmp/cvs-serv30435/isa/cs423x

Modified Files:
        cs4231.c cs4236.c pc98.c 
Log Message:
use the standard port address, 0 = disable, 1 = auto-probe, others manual.
negative values are accepted as disable, too.


Index: cs4231.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/isa/cs423x/cs4231.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- cs4231.c    14 Oct 2003 13:08:15 -0000      1.10
+++ cs4231.c    30 Oct 2003 14:21:08 -0000      1.11
@@ -103,8 +103,6 @@
        if (card == NULL)
                return -ENOMEM;
        acard = (struct snd_card_cs4231 *)card->private_data;
-       if (mpu_port[dev] < 0)
-               mpu_port[dev] = SNDRV_AUTO_PORT;
        if ((err = snd_cs4231_create(card, port[dev], -1,
                                     irq[dev],
                                     dma1[dev],
@@ -128,10 +126,13 @@
                return err;
        }
 
-       if (mpu_irq[dev] >= 0 && mpu_irq[dev] != SNDRV_AUTO_IRQ) {
+       if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+               if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+                       mpu_irq[dev] = -1;
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
                                        mpu_port[dev], 0,
-                                       mpu_irq[dev], SA_INTERRUPT,
+                                       mpu_irq[dev],
+                                       mpu_irq[dev] >= 0 ? SA_INTERRUPT : 0,
                                        NULL) < 0)
                        printk(KERN_ERR "cs4231: MPU401 not detected\n");
        }

Index: cs4236.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/isa/cs423x/cs4236.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- cs4236.c    14 Oct 2003 13:08:15 -0000      1.37
+++ cs4236.c    30 Oct 2003 14:21:08 -0000      1.38
@@ -307,7 +307,7 @@
        pnp_init_resource_table(cfg);
        if (port[dev] != SNDRV_AUTO_PORT)
                pnp_resource_change(&cfg->port_resource[0], port[dev], 4);
-       if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] >= 0)
+       if (fm_port[dev] != SNDRV_AUTO_PORT && fm_port[dev] > 0)
                pnp_resource_change(&cfg->port_resource[1], fm_port[dev], 4);
        if (sb_port[dev] != SNDRV_AUTO_PORT)
                pnp_resource_change(&cfg->port_resource[2], sb_port[dev], 16);
@@ -327,7 +327,7 @@
                return -EBUSY;
        }
        port[dev] = pnp_port_start(pdev, 0);
-       if (fm_port[dev] >= 0)
+       if (fm_port[dev] > 0)
                fm_port[dev] = pnp_port_start(pdev, 1);
        sb_port[dev] = pnp_port_start(pdev, 2);
        irq[dev] = pnp_irq(pdev, 0);
@@ -338,7 +338,7 @@
        snd_printdd("isapnp WSS: irq=%i, dma1=%i, dma2=%i\n",
                        irq[dev], dma1[dev], dma2[dev]);
        /* CTRL initialization */
-       if (acard->ctrl && cport[dev] >= 0) {
+       if (acard->ctrl && cport[dev] > 0) {
                pdev = acard->ctrl;
                pnp_init_resource_table(cfg);
                if (cport[dev] != SNDRV_AUTO_PORT)
@@ -356,12 +356,13 @@
                snd_printdd("isapnp CTRL: control port=0x%lx\n", cport[dev]);
        }
        /* MPU initialization */
-       if (acard->mpu && mpu_port[dev] >= 0) {
+       if (acard->mpu && mpu_port[dev] > 0) {
                pdev = acard->mpu;
                pnp_init_resource_table(cfg);
                if (mpu_port[dev] != SNDRV_AUTO_PORT)
                        pnp_resource_change(&cfg->port_resource[0], mpu_port[dev], 2);
-               if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0)
+               if (mpu_irq[dev] != SNDRV_AUTO_IRQ && mpu_irq[dev] >= 0 &&
+                   pnp_irq_valid(pdev, 0))
                        pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
                err = pnp_manual_config_dev(pdev, cfg, 0);
                if (err < 0)
@@ -373,7 +374,8 @@
                        mpu_irq[dev] = SNDRV_AUTO_IRQ;
                } else {
                        mpu_port[dev] = pnp_port_start(pdev, 0);
-                       if (pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
+                       if (mpu_irq[dev] >= 0 &&
+                           pnp_irq_valid(pdev, 0) && pnp_irq(pdev, 0) >= 0) {
                                mpu_irq[dev] = pnp_irq(pdev, 0);
                        } else {
                                mpu_irq[dev] = -1;      /* disable interrupt */
@@ -435,13 +437,7 @@
                return -ENXIO;
        }
 #endif
-       if (mpu_port[dev] < 0)
-               mpu_port[dev] = SNDRV_AUTO_PORT;
-       if (fm_port[dev] < 0)
-               fm_port[dev] = SNDRV_AUTO_PORT;
-       if (sb_port[dev] < 0)
-               sb_port[dev] = SNDRV_AUTO_PORT;
-       if (sb_port[dev] != SNDRV_AUTO_PORT)
+       if (sb_port[dev] > 0 && sb_port[dev] != SNDRV_AUTO_PORT)
                if ((acard->res_sb_port = request_region(sb_port[dev], 16, IDENT " 
SB")) == NULL) {
                        printk(KERN_ERR IDENT ": unable to register SB port at 
0x%lx\n", sb_port[dev]);
                        snd_card_free(card);
@@ -498,7 +494,7 @@
                return err;
        }
 
-       if (fm_port[dev] != SNDRV_AUTO_PORT) {
+       if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
                if (snd_opl3_create(card,
                                    fm_port[dev], fm_port[dev] + 2,
                                    OPL3_HW_OPL3_CS, 0, &opl3) < 0) {
@@ -511,7 +507,9 @@
                }
        }
 
-       if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+       if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
+               if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
+                       mpu_irq[dev] = -1;
                if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
                                        mpu_port[dev], 0,
                                        mpu_irq[dev],

Index: pc98.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/isa/cs423x/pc98.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pc98.c      14 Oct 2003 13:08:15 -0000      1.6
+++ pc98.c      30 Oct 2003 14:21:08 -0000      1.7
@@ -327,10 +327,6 @@
        card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
        if (card == NULL)
                return -ENOMEM;
-       if (mpu_port[dev] < 0 || mpu_irq[dev] < 0)
-               mpu_port[dev] = SNDRV_AUTO_PORT;
-       if (fm_port[dev] < 0)
-               fm_port[dev] = SNDRV_AUTO_PORT;
 
        if ((err = pc98_cs4231_chip_init(dev)) < 0) {
                snd_card_free(card);
@@ -363,7 +359,7 @@
                return err;
        }
 
-       if (fm_port[dev] != SNDRV_AUTO_PORT) {
+       if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
                /* ??? */
                outb(0x00, fm_port[dev] + 6);
                inb(fm_port[dev] + 7);
@@ -381,7 +377,7 @@
                }
        }
 
-       if (mpu_port[dev] != SNDRV_AUTO_PORT) {
+       if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
                err = pc98_mpu401_init(mpu_irq[dev]);
                if (! err) {
                        err = snd_mpu401_uart_new(card, 0,



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to