Commit 3b43c523 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,ALS4000 driver,ENS1370/1+ driver,YMFPCI driver
added auto-detection of joystick port.
parent 142ee1b7
...@@ -173,7 +173,7 @@ Module parameters ...@@ -173,7 +173,7 @@ Module parameters
Module for soundcards based on Avance Logic ALS4000 PCI chip. Module for soundcards based on Avance Logic ALS4000 PCI chip.
joystick_port - port # for legacy joystick support. joystick_port - port # for legacy joystick support.
0 = disabled (default) 0 = disabled (default), 1 = auto-detect
Module supports up to 8 cards, autoprobe and PnP. Module supports up to 8 cards, autoprobe and PnP.
...@@ -390,7 +390,7 @@ Module parameters ...@@ -390,7 +390,7 @@ Module parameters
* SoundBlaster Vibra PCI * SoundBlaster Vibra PCI
joystick_port - port # for joystick (0x200,0x208,0x210,0x218), joystick_port - port # for joystick (0x200,0x208,0x210,0x218),
0 = disable (default) 0 = disable (default), 1 = auto-detect
Module supports up to 8 cards and autoprobe. Module supports up to 8 cards and autoprobe.
...@@ -1124,9 +1124,10 @@ Module parameters ...@@ -1124,9 +1124,10 @@ Module parameters
Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x). Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x).
mpu_port - 0x300,0x330,0x332,0x334, -1 (disable) by default mpu_port - 0x300,0x330,0x332,0x334, 0 (disable) by default
fm_port - 0x388,0x398,0x3a0,0x3a8, -1 (disable) by default fm_port - 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default
joystick_port - 0x201,0x202,0x204,0x205, -1 (disable) by default joystick_port - 0x201,0x202,0x204,0x205, 0 (disable) by default,
1 (auto-detect)
rear_switch - enable shared rear/line-in switch (bool) rear_switch - enable shared rear/line-in switch (bool)
Module supports autoprobe and multiple chips (max 8). Module supports autoprobe and multiple chips (max 8).
......
...@@ -36,11 +36,13 @@ The following PCI drivers support the joystick natively. ...@@ -36,11 +36,13 @@ The following PCI drivers support the joystick natively.
Driver Module Option Available Values Driver Module Option Available Values
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
als4000 joystick_port any address (e.g. 0x200), 0 = disable (default) als4000 joystick_port 0 = disable (default), 1 = auto-detect,
manual: any address (e.g. 0x200)
au88x0 N/A N/A au88x0 N/A N/A
azf3328 joystick 0 = disable, 1 = enable, -1 = auto (default) azf3328 joystick 0 = disable, 1 = enable, -1 = auto (default)
ens1370 joystick 0 = disable (default), 1 = enable ens1370 joystick 0 = disable (default), 1 = enable
ens1371 joystick_port 0 = disable (default), 0x200,0x208,0x210,0x218 ens1371 joystick_port 0 = disable (default), 1 = auto-detect,
manual: 0x200, 0x208, 0x210, 0x218
cmipci joystick 0 = disable (default), 1 = enable cmipci joystick 0 = disable (default), 1 = enable
cs4281 N/A N/A cs4281 N/A N/A
cs46xx N/A N/A cs46xx N/A N/A
...@@ -50,13 +52,13 @@ The following PCI drivers support the joystick natively. ...@@ -50,13 +52,13 @@ The following PCI drivers support the joystick natively.
sonicvibes N/A N/A sonicvibes N/A N/A
trident N/A N/A trident N/A N/A
via82xx(*2) joystick 0 = disable (default), 1 = enable via82xx(*2) joystick 0 = disable (default), 1 = enable
ymfpci(*3) joystick_port 0 = disable (default), 0x201,0x202,0x204,0x205 ymfpci joystick_port 0 = disable (default), 1 = auto-detect,
manual: 0x201, 0x202, 0x204, 0x205(*3)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
*1) not all chips support joystick *1) not all chips support joystick
*2) VIA686A/B only *2) VIA686A/B only
*3) With YMF744/754 chips, the port address is chosen automatically *3) With YMF744/754 chips, the port address can be chosen arbitrarily
and enabled by default
The following drivers don't support gameport natively, but there are The following drivers don't support gameport natively, but there are
additional modules. Load the corresponding module to add the gameport additional modules. Load the corresponding module to add the gameport
......
...@@ -652,9 +652,18 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci, ...@@ -652,9 +652,18 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
/* disable all legacy ISA stuff except for joystick */ /* disable all legacy ISA stuff except for joystick */
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
if (joystick_port[dev] > 0 && if (joystick_port[dev] == 1) {
(acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport")) != NULL) /* auto-detect */
long p;
for (p = 0x200; p <= 0x218; p += 8)
if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL)
break;
} else if (joystick_port[dev] > 0)
acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport");
if (acard->res_joystick)
joystick = joystick_port[dev]; joystick = joystick_port[dev];
else
joystick = 0;
#endif #endif
snd_als4000_set_addr(gcr, 0, 0, 0, joystick); snd_als4000_set_addr(gcr, 0, 0, 0, joystick);
......
...@@ -1680,11 +1680,24 @@ static int __devinit snd_ensoniq_1370_mixer(ensoniq_t * ensoniq) ...@@ -1680,11 +1680,24 @@ static int __devinit snd_ensoniq_1370_mixer(ensoniq_t * ensoniq)
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
static int snd_ensoniq_joystick(ensoniq_t *ensoniq, long port) static int snd_ensoniq_joystick(ensoniq_t *ensoniq, long port)
{ {
ensoniq->gameport.io = port; #ifdef CHIP1371
if (!request_region(ensoniq->gameport.io, 8, "ens137x: gameport")) { if (port == 1) { /* auto-detect */
for (port = 0x200; port <= 0x218; port += 8)
if (request_region(port, 8, "ens137x: gameport"))
break;
if (port > 0x218) {
snd_printk("no gameport available\n");
return -EBUSY;
}
} else
#endif
{
if (!request_region(port, 8, "ens137x: gameport")) {
snd_printk("gameport io port 0x%03x in use", ensoniq->gameport.io); snd_printk("gameport io port 0x%03x in use", ensoniq->gameport.io);
return -EBUSY; return -EBUSY;
} }
}
ensoniq->gameport.io = port;
ensoniq->ctrl |= ES_JYSTK_EN; ensoniq->ctrl |= ES_JYSTK_EN;
#ifdef CHIP1371 #ifdef CHIP1371
ensoniq->ctrl &= ~ES_1371_JOY_ASELM; ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
...@@ -2246,6 +2259,7 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci, ...@@ -2246,6 +2259,7 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci,
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
#ifdef CHIP1371 #ifdef CHIP1371
switch (joystick_port[dev]) { switch (joystick_port[dev]) {
case 1: /* auto-detect */
case 0x200: case 0x200:
case 0x208: case 0x208:
case 0x210: case 0x210:
......
...@@ -145,10 +145,10 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -145,10 +145,10 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]); pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]);
} }
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
if (joystick_port[dev] < 0) { if (joystick_port[dev] == 1) {
joystick_port[dev] = pci_resource_start(pci, 2); joystick_port[dev] = pci_resource_start(pci, 2);
} }
if (joystick_port[dev] >= 0 && if (joystick_port[dev] > 0 &&
(joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) { (joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) {
legacy_ctrl |= YMFPCI_LEGACY_JPEN; legacy_ctrl |= YMFPCI_LEGACY_JPEN;
pci_write_config_word(pci, PCIR_DSXG_JOYBASE, joystick_port[dev]); pci_write_config_word(pci, PCIR_DSXG_JOYBASE, joystick_port[dev]);
...@@ -184,6 +184,17 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -184,6 +184,17 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
mpu_port[dev] = -1; mpu_port[dev] = -1;
} }
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
if (joystick_port[dev] == 1) {
/* auto-detect */
long p;
for (p = 0x201; p <= 0x205; p++) {
if (p == 0x203) continue;
if ((joystick_res = request_region(p, 1, "YMFPCI gameport")) != NULL)
break;
}
if (joystick_res)
joystick_port[dev] = p;
} else {
switch (joystick_port[dev]) { switch (joystick_port[dev]) {
case 0x201: legacy_ctrl2 |= 0 << 6; break; case 0x201: legacy_ctrl2 |= 0 << 6; break;
case 0x202: legacy_ctrl2 |= 1 << 6; break; case 0x202: legacy_ctrl2 |= 1 << 6; break;
...@@ -191,8 +202,10 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -191,8 +202,10 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
case 0x205: legacy_ctrl2 |= 3 << 6; break; case 0x205: legacy_ctrl2 |= 3 << 6; break;
default: joystick_port[dev] = -1; break; default: joystick_port[dev] = -1; break;
} }
if (joystick_port[dev] > 0 && if (joystick_port[dev] > 0)
(joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) { joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport");
}
if (joystick_res) {
legacy_ctrl |= YMFPCI_LEGACY_JPEN; legacy_ctrl |= YMFPCI_LEGACY_JPEN;
} else { } else {
legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO; legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment