Update of /cvsroot/alsa/alsa-kernel/pci In directory sc8-pr-cvs1:/tmp/cvs-serv24429/pci
Modified Files: als4000.c azt3328.c cmipci.c ens1370.c via82xx.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: als4000.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/als4000.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- als4000.c 24 Oct 2003 13:42:41 -0000 1.23 +++ als4000.c 28 Oct 2003 11:28:01 -0000 1.24 @@ -655,9 +655,12 @@ if (joystick_port[dev] == 1) { /* auto-detect */ long p; - for (p = 0x200; p <= 0x218; p += 8) - if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL) + for (p = 0x200; p <= 0x218; p += 8) { + if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL) { + joystick_port[dev] = p; break; + } + } } else if (joystick_port[dev] > 0) acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport"); if (acard->res_joystick) Index: azt3328.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/azt3328.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- azt3328.c 14 Oct 2003 13:59:20 -0000 1.5 +++ azt3328.c 28 Oct 2003 11:28:01 -0000 1.6 @@ -164,8 +164,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ #ifdef SUPPORT_JOYSTICK -static int joystick[SNDRV_CARDS] = - {-1}; /* "unset" as default */ +static int joystick[SNDRV_CARDS]; #endif MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); @@ -179,8 +178,8 @@ MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC); #ifdef SUPPORT_JOYSTICK MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); -MODULE_PARM_DESC(joystick, "Forced joystick port enable for AZF3328 soundcard. (0 = force disable)"); -MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED); +MODULE_PARM_DESC(joystick, "Enable joystick for AZF3328 soundcard."); +MODULE_PARM_SYNTAX(joystick, SNDRV_BOOLEAN_FALSE_DESC); #endif typedef struct _snd_azf3328 azf3328_t; @@ -1445,47 +1444,21 @@ #ifdef SUPPORT_JOYSTICK static void __devinit snd_azf3328_config_joystick(azf3328_t *chip, int joystick) { - int i, activate = 0; - char *msg = NULL; unsigned char val; - if (joystick == -1) /* auto detection/activation */ - { - activate = 1; - for (i=0x200; i <= 0x207; i++) - if (inb(i) != 0xff) { - activate = 0; - break; - } - } - - if (activate || joystick == 1) { - if ((chip->res_joystick = request_region(0x200, 8, "AZF3328 gameport")) != NULL) { + if (joystick == 1) { + if ((chip->res_joystick = request_region(0x200, 8, "AZF3328 gameport")) != NULL) chip->gameport.io = 0x200; - activate = 1; - } else - activate = 0; - } - if (joystick == 0) - msg = "DISABLED (forced)"; - else if (joystick == 1 && activate) - msg = "ENABLED (Warning: forced!)"; - else if (activate) - msg = "ENABLED (via autodetect)"; - else - msg = "DISABLED (address occupied by another joystick port)"; + } val = inb(chip->io2_port + IDX_IO2_LEGACY_ADDR); - if (activate) + if (chip->res_joystick) val |= LEGACY_JOY; else val &= ~LEGACY_JOY; outb(val, chip->io2_port + IDX_IO2_LEGACY_ADDR); -#ifdef MODULE - printk("azt3328: Joystick port: %s.\n", msg); -#endif - if (activate) + if (chip->res_joystick) gameport_register_port(&chip->gameport); } #endif Index: cmipci.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/cmipci.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- cmipci.c 23 Oct 2003 14:34:52 -0000 1.51 +++ cmipci.c 28 Oct 2003 11:28:01 -0000 1.52 @@ -60,8 +60,8 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ -static long mpu_port[SNDRV_CARDS] = {0x330, [1 ... (SNDRV_CARDS-1)]=-1}; -static long fm_port[SNDRV_CARDS] = {0x388, [1 ... (SNDRV_CARDS-1)]=-1}; +static long mpu_port[SNDRV_CARDS]; +static long fm_port[SNDRV_CARDS]; #ifdef DO_SOFT_AC3 static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; #endif @@ -80,10 +80,10 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM_DESC(mpu_port, "MPU-401 port."); -MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{-1},{0x330},{0x320},{0x310},{0x300}},dialog:list"); +MODULE_PARM_SYNTAX(mpu_port, SNDRV_ENABLED ",allows:{{0},{0x330},{0x320},{0x310},{0x300}},dialog:list"); MODULE_PARM(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM_DESC(fm_port, "FM port."); -MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list"); +MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED ",allows:{{0},{0x388},{0x3c8},{0x3e0},{0x3e8}},dialog:list"); #ifdef DO_SOFT_AC3 MODULE_PARM(soft_ac3, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only)."); @@ -2954,8 +2954,8 @@ .dev_free = snd_cmipci_dev_free, }; unsigned int val = 0; - unsigned long iomidi = mpu_port[dev]; - unsigned long iosynth = fm_port[dev]; + long iomidi = mpu_port[dev]; + long iosynth = fm_port[dev]; int pcm_index, pcm_spdif_index; *rcmipci = NULL; Index: ens1370.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/ens1370.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- ens1370.c 24 Oct 2003 13:42:41 -0000 1.53 +++ ens1370.c 28 Oct 2003 11:28:01 -0000 1.54 @@ -100,7 +100,7 @@ #ifdef CHIP1371 MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(joystick_port, "Joystick port address."); -MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{0x200},{0x208},{0x210},{0x218}},dialog:list"); +MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED ",allows:{{0},{1},{0x200},{0x208},{0x210},{0x218}},dialog:list"); #else MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM_DESC(joystick, "Enable joystick."); Index: via82xx.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/via82xx.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- via82xx.c 23 Oct 2003 16:46:14 -0000 1.64 +++ via82xx.c 28 Oct 2003 11:28:01 -0000 1.65 @@ -77,7 +77,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ -static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; +static long mpu_port[SNDRV_CARDS]; #ifdef SUPPORT_JOYSTICK static int joystick[SNDRV_CARDS]; #endif @@ -1639,7 +1639,7 @@ "VIA82xx MPU401")) != NULL) { legacy |= VIA_FUNC_ENABLE_MIDI; } else { - mpu_port[dev] = -1; + mpu_port[dev] = 0; legacy &= ~VIA_FUNC_ENABLE_MIDI; } } else { @@ -1666,7 +1666,7 @@ if (rev_h) legacy &= ~VIA_FUNC_MIDI_PNP; /* disable PCI I/O 2 */ legacy &= ~VIA_FUNC_ENABLE_MIDI; - mpu_port[dev] = -1; + mpu_port[dev] = 0; } #ifdef SUPPORT_JOYSTICK ------------------------------------------------------- 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