Commit 0f6d08ca authored by Jaroslav Kysela's avatar Jaroslav Kysela

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

Documentation,ALS4000 driver,AZT3328 driver,CMIPCI driver
ENS1370/1+ driver,VIA82xx driver,YMFPCI driver
- use consistent values for specifying the port address
  (0 = disable, 1 = auto-detect, others = manual)
- fixed the auto-detection of joystick port.
parent 65c0e6a9
...@@ -198,6 +198,8 @@ Module parameters ...@@ -198,6 +198,8 @@ Module parameters
Module for soundcards based on Aztech AZF3328 PCI chip. Module for soundcards based on Aztech AZF3328 PCI chip.
joystick - Enable joystick (default off)
Module supports up to 8 cards. Module supports up to 8 cards.
Module snd-cmi8330 Module snd-cmi8330
...@@ -220,8 +222,8 @@ Module parameters ...@@ -220,8 +222,8 @@ Module parameters
Module for C-Media CMI8338 and 8738 PCI soundcards. Module for C-Media CMI8338 and 8738 PCI soundcards.
mpu_port - 0x300 (default),0x310,0x320,0x330, -1 (diable) mpu_port - 0x300,0x310,0x320,0x330, 0 = disable (default)
fm_port - 0x388 (default), -1 (disable) fm_port - 0x388 (default), 0 = disable (default)
soft_ac3 - Sofware-conversion of raw SPDIF packets (model 033 only) soft_ac3 - Sofware-conversion of raw SPDIF packets (model 033 only)
(default = 1) (default = 1)
joystick - Enable joystick (default off) joystick - Enable joystick (default off)
...@@ -1124,17 +1126,16 @@ Module parameters ...@@ -1124,17 +1126,16 @@ Module parameters
Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x). Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x).
mpu_port - 0x300,0x330,0x332,0x334, 0 (disable) by default mpu_port - 0x300,0x330,0x332,0x334, 0 (disable) by default,
1 (auto-detect for YMF744/754 only)
fm_port - 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default fm_port - 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default
1 (auto-detect for YMF744/754 only)
joystick_port - 0x201,0x202,0x204,0x205, 0 (disable) by default, joystick_port - 0x201,0x202,0x204,0x205, 0 (disable) by default,
1 (auto-detect) 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).
With YMF744/754 chips, the MPU401/FM/joystick port addresses are
chosen automatically, and enabled by default.
The power-management is supported. The power-management is supported.
......
...@@ -655,9 +655,12 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci, ...@@ -655,9 +655,12 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
if (joystick_port[dev] == 1) { if (joystick_port[dev] == 1) {
/* auto-detect */ /* auto-detect */
long p; long p;
for (p = 0x200; p <= 0x218; p += 8) for (p = 0x200; p <= 0x218; p += 8) {
if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL) if ((acard->res_joystick = request_region(p, 8, "ALS4000 gameport")) != NULL) {
joystick_port[dev] = p;
break; break;
}
}
} else if (joystick_port[dev] > 0) } else if (joystick_port[dev] > 0)
acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport"); acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport");
if (acard->res_joystick) if (acard->res_joystick)
......
...@@ -164,8 +164,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ ...@@ -164,8 +164,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 char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
static int joystick[SNDRV_CARDS] = static int joystick[SNDRV_CARDS];
{-1}; /* "unset" as default */
#endif #endif
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
...@@ -179,8 +178,8 @@ MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard."); ...@@ -179,8 +178,8 @@ MODULE_PARM_DESC(enable, "Enable AZF3328 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC); MODULE_PARM_SYNTAX(enable, SNDRV_INDEX_DESC);
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 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_DESC(joystick, "Enable joystick for AZF3328 soundcard.");
MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED); MODULE_PARM_SYNTAX(joystick, SNDRV_BOOLEAN_FALSE_DESC);
#endif #endif
typedef struct _snd_azf3328 azf3328_t; typedef struct _snd_azf3328 azf3328_t;
...@@ -1445,47 +1444,21 @@ static int __devinit snd_azf3328_create(snd_card_t * card, ...@@ -1445,47 +1444,21 @@ static int __devinit snd_azf3328_create(snd_card_t * card,
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
static void __devinit snd_azf3328_config_joystick(azf3328_t *chip, int joystick) static void __devinit snd_azf3328_config_joystick(azf3328_t *chip, int joystick)
{ {
int i, activate = 0;
char *msg = NULL;
unsigned char val; unsigned char val;
if (joystick == -1) /* auto detection/activation */ if (joystick == 1) {
{ if ((chip->res_joystick = request_region(0x200, 8, "AZF3328 gameport")) != NULL)
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) {
chip->gameport.io = 0x200; 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); val = inb(chip->io2_port + IDX_IO2_LEGACY_ADDR);
if (activate) if (chip->res_joystick)
val |= LEGACY_JOY; val |= LEGACY_JOY;
else else
val &= ~LEGACY_JOY; val &= ~LEGACY_JOY;
outb(val, chip->io2_port + IDX_IO2_LEGACY_ADDR); outb(val, chip->io2_port + IDX_IO2_LEGACY_ADDR);
#ifdef MODULE if (chip->res_joystick)
printk("azt3328: Joystick port: %s.\n", msg);
#endif
if (activate)
gameport_register_port(&chip->gameport); gameport_register_port(&chip->gameport);
} }
#endif #endif
......
...@@ -60,8 +60,8 @@ MODULE_DEVICES("{{C-Media,CMI8738}," ...@@ -60,8 +60,8 @@ MODULE_DEVICES("{{C-Media,CMI8738},"
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */ 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 mpu_port[SNDRV_CARDS];
static long fm_port[SNDRV_CARDS] = {0x388, [1 ... (SNDRV_CARDS-1)]=-1}; static long fm_port[SNDRV_CARDS];
#ifdef DO_SOFT_AC3 #ifdef DO_SOFT_AC3
static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1}; static int soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
#endif #endif
...@@ -80,10 +80,10 @@ MODULE_PARM_DESC(enable, "Enable C-Media PCI soundcard."); ...@@ -80,10 +80,10 @@ MODULE_PARM_DESC(enable, "Enable C-Media PCI soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM(mpu_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(mpu_port, "MPU-401 port."); 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(fm_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(fm_port, "FM port."); 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 #ifdef DO_SOFT_AC3
MODULE_PARM(soft_ac3, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM(soft_ac3, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only)."); MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only).");
...@@ -2958,8 +2958,8 @@ static int __devinit snd_cmipci_create(snd_card_t *card, struct pci_dev *pci, ...@@ -2958,8 +2958,8 @@ static int __devinit snd_cmipci_create(snd_card_t *card, struct pci_dev *pci,
.dev_free = snd_cmipci_dev_free, .dev_free = snd_cmipci_dev_free,
}; };
unsigned int val = 0; unsigned int val = 0;
unsigned long iomidi = mpu_port[dev]; long iomidi = mpu_port[dev];
unsigned long iosynth = fm_port[dev]; long iosynth = fm_port[dev];
int pcm_index, pcm_spdif_index; int pcm_index, pcm_spdif_index;
*rcmipci = NULL; *rcmipci = NULL;
......
...@@ -100,7 +100,7 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); ...@@ -100,7 +100,7 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
#ifdef CHIP1371 #ifdef CHIP1371
MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(joystick_port, "Joystick port address."); 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 #else
MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(joystick, "Enable joystick."); MODULE_PARM_DESC(joystick, "Enable joystick.");
......
...@@ -77,7 +77,7 @@ MODULE_DEVICES("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}"); ...@@ -77,7 +77,7 @@ MODULE_DEVICES("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 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 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 #ifdef SUPPORT_JOYSTICK
static int joystick[SNDRV_CARDS]; static int joystick[SNDRV_CARDS];
#endif #endif
...@@ -1625,7 +1625,7 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev) ...@@ -1625,7 +1625,7 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev)
"VIA82xx MPU401")) != NULL) { "VIA82xx MPU401")) != NULL) {
legacy |= VIA_FUNC_ENABLE_MIDI; legacy |= VIA_FUNC_ENABLE_MIDI;
} else { } else {
mpu_port[dev] = -1; mpu_port[dev] = 0;
legacy &= ~VIA_FUNC_ENABLE_MIDI; legacy &= ~VIA_FUNC_ENABLE_MIDI;
} }
} else { } else {
...@@ -1652,7 +1652,7 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev) ...@@ -1652,7 +1652,7 @@ static int snd_via686_init_misc(via82xx_t *chip, int dev)
if (rev_h) if (rev_h)
legacy &= ~VIA_FUNC_MIDI_PNP; /* disable PCI I/O 2 */ legacy &= ~VIA_FUNC_MIDI_PNP; /* disable PCI I/O 2 */
legacy &= ~VIA_FUNC_ENABLE_MIDI; legacy &= ~VIA_FUNC_ENABLE_MIDI;
mpu_port[dev] = -1; mpu_port[dev] = 0;
} }
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
......
...@@ -128,7 +128,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -128,7 +128,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
legacy_ctrl2 = 0x0800; /* SBEN = 0, SMOD = 01, LAD = 0 */ legacy_ctrl2 = 0x0800; /* SBEN = 0, SMOD = 01, LAD = 0 */
if (pci_id->device >= 0x0010) { /* YMF 744/754 */ 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); fm_port[dev] = pci_resource_start(pci, 1);
} }
if (fm_port[dev] > 0 && if (fm_port[dev] > 0 &&
...@@ -136,7 +137,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -136,7 +137,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
legacy_ctrl |= YMFPCI_LEGACY_FMEN; legacy_ctrl |= YMFPCI_LEGACY_FMEN;
pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]); 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; mpu_port[dev] = pci_resource_start(pci, 1) + 0x20;
} }
if (mpu_port[dev] > 0 && if (mpu_port[dev] > 0 &&
...@@ -146,6 +148,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -146,6 +148,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
} }
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
if (joystick_port[dev] == 1) { if (joystick_port[dev] == 1) {
/* auto-detect */
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 &&
...@@ -160,28 +163,28 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -160,28 +163,28 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
case 0x398: legacy_ctrl2 |= 1; break; case 0x398: legacy_ctrl2 |= 1; break;
case 0x3a0: legacy_ctrl2 |= 2; break; case 0x3a0: legacy_ctrl2 |= 2; break;
case 0x3a8: legacy_ctrl2 |= 3; break; case 0x3a8: legacy_ctrl2 |= 3; break;
default: fm_port[dev] = -1; break; default: fm_port[dev] = 0; break;
} }
if (fm_port[dev] > 0 && if (fm_port[dev] > 0 &&
(fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) { (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) {
legacy_ctrl |= YMFPCI_LEGACY_FMEN; legacy_ctrl |= YMFPCI_LEGACY_FMEN;
} else { } else {
legacy_ctrl2 &= ~YMFPCI_LEGACY2_FMIO; legacy_ctrl2 &= ~YMFPCI_LEGACY2_FMIO;
fm_port[dev] = -1; fm_port[dev] = 0;
} }
switch (mpu_port[dev]) { switch (mpu_port[dev]) {
case 0x330: legacy_ctrl2 |= 0 << 4; break; case 0x330: legacy_ctrl2 |= 0 << 4; break;
case 0x300: legacy_ctrl2 |= 1 << 4; break; case 0x300: legacy_ctrl2 |= 1 << 4; break;
case 0x332: legacy_ctrl2 |= 2 << 4; break; case 0x332: legacy_ctrl2 |= 2 << 4; break;
case 0x334: legacy_ctrl2 |= 3 << 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 && if (mpu_port[dev] > 0 &&
(mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) { (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) {
legacy_ctrl |= YMFPCI_LEGACY_MEN; legacy_ctrl |= YMFPCI_LEGACY_MEN;
} else { } else {
legacy_ctrl2 &= ~YMFPCI_LEGACY2_MPUIO; legacy_ctrl2 &= ~YMFPCI_LEGACY2_MPUIO;
mpu_port[dev] = -1; mpu_port[dev] = 0;
} }
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
if (joystick_port[dev] == 1) { if (joystick_port[dev] == 1) {
...@@ -200,7 +203,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -200,7 +203,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
case 0x202: legacy_ctrl2 |= 1 << 6; break; case 0x202: legacy_ctrl2 |= 1 << 6; break;
case 0x204: legacy_ctrl2 |= 2 << 6; break; case 0x204: legacy_ctrl2 |= 2 << 6; break;
case 0x205: legacy_ctrl2 |= 3 << 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) if (! joystick_res && joystick_port[dev] > 0)
joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport"); joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport");
...@@ -208,7 +211,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci, ...@@ -208,7 +211,7 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
legacy_ctrl |= YMFPCI_LEGACY_JPEN; legacy_ctrl |= YMFPCI_LEGACY_JPEN;
} else { } else {
legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO; legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO;
joystick_port[dev] = -1; joystick_port[dev] = 0;
} }
#endif #endif
} }
......
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