Update of /cvsroot/alsa/alsa-kernel/pci/ymfpci
In directory sc8-pr-cvs1:/tmp/cvs-serv24429/pci/ymfpci

Modified Files:
        ymfpci.c 
Log Message:
- use consistent values for specifying the port address
  (0 = disable, 1 = auto-detect, others = manual)
- fixed the auto-detection of joystick port.


Index: ymfpci.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ymfpci/ymfpci.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ymfpci.c    27 Oct 2003 11:30:18 -0000      1.31
+++ ymfpci.c    28 Oct 2003 11:28:01 -0000      1.32
@@ -128,7 +128,8 @@
        legacy_ctrl2 = 0x0800;  /* SBEN = 0, SMOD = 01, LAD = 0 */
 
        if (pci_id->device >= 0x0010) { /* YMF 744/754 */
-               if (fm_port[dev] <= 0) {
+               if (fm_port[dev] == 1) {
+                       /* auto-detect */
                        fm_port[dev] = pci_resource_start(pci, 1);
                }
                if (fm_port[dev] > 0 &&
@@ -136,7 +137,8 @@
                        legacy_ctrl |= YMFPCI_LEGACY_FMEN;
                        pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]);
                }
-               if (mpu_port[dev] <= 0) {
+               if (mpu_port[dev] == 1) {
+                       /* auto-detect */
                        mpu_port[dev] = pci_resource_start(pci, 1) + 0x20;
                }
                if (mpu_port[dev] > 0 &&
@@ -146,6 +148,7 @@
                }
 #ifdef SUPPORT_JOYSTICK
                if (joystick_port[dev] == 1) {
+                       /* auto-detect */
                        joystick_port[dev] = pci_resource_start(pci, 2);
                }
                if (joystick_port[dev] > 0 &&
@@ -160,28 +163,28 @@
                case 0x398: legacy_ctrl2 |= 1; break;
                case 0x3a0: legacy_ctrl2 |= 2; break;
                case 0x3a8: legacy_ctrl2 |= 3; break;
-               default: fm_port[dev] = -1; break;
+               default: fm_port[dev] = 0; break;
                }
                if (fm_port[dev] > 0 &&
                    (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) 
{
                        legacy_ctrl |= YMFPCI_LEGACY_FMEN;
                } else {
                        legacy_ctrl2 &= ~YMFPCI_LEGACY2_FMIO;
-                       fm_port[dev] = -1;
+                       fm_port[dev] = 0;
                }
                switch (mpu_port[dev]) {
                case 0x330: legacy_ctrl2 |= 0 << 4; break;
                case 0x300: legacy_ctrl2 |= 1 << 4; break;
                case 0x332: legacy_ctrl2 |= 2 << 4; break;
                case 0x334: legacy_ctrl2 |= 3 << 4; break;
-               default: mpu_port[dev] = -1; break;
+               default: mpu_port[dev] = 0; break;
                }
                if (mpu_port[dev] > 0 &&
                    (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != 
NULL) {
                        legacy_ctrl |= YMFPCI_LEGACY_MEN;
                } else {
                        legacy_ctrl2 &= ~YMFPCI_LEGACY2_MPUIO;
-                       mpu_port[dev] = -1;
+                       mpu_port[dev] = 0;
                }
 #ifdef SUPPORT_JOYSTICK
                if (joystick_port[dev] == 1) {
@@ -200,7 +203,7 @@
                case 0x202: legacy_ctrl2 |= 1 << 6; break;
                case 0x204: legacy_ctrl2 |= 2 << 6; break;
                case 0x205: legacy_ctrl2 |= 3 << 6; break;
-               default: joystick_port[dev] = -1; break;
+               default: joystick_port[dev] = 0; break;
                }
                if (! joystick_res && joystick_port[dev] > 0)
                        joystick_res = request_region(joystick_port[dev], 1, "YMFPCI 
gameport");
@@ -208,7 +211,7 @@
                        legacy_ctrl |= YMFPCI_LEGACY_JPEN;
                } else {
                        legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO;
-                       joystick_port[dev] = -1;
+                       joystick_port[dev] = 0;
                }
 #endif
        }



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to