diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-01-30 13:20:29 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-30 13:55:37 -0500 |
commit | 880abd42d0891635e988b0a2cfb0942cf79fa2c3 (patch) | |
tree | 8e19075fd9cce681dd2eb399383a8223ad99ac4a /sound/isa/es1688 | |
parent | 9e128fddcc589db4e7d9e8328f656ae4a21a2808 (diff) |
ALSA: ess1688: fix OPL3 port setting
The ess1688 driver uses the same port
for PCM audio (SB compatible) and OPL3
synthesis. It is not always right so allow to
choose a different port for OPL3 synthesis.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/es1688')
-rw-r--r-- | sound/isa/es1688/es1688.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index b46377139cf8..b0eb0cf6050e 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c | |||
@@ -49,6 +49,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | |||
49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 49 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
50 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ | 50 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ |
51 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ | 51 | static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ |
52 | static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */ | ||
52 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; | 53 | static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; |
53 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ | 54 | static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ |
54 | static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ | 55 | static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ |
@@ -65,6 +66,8 @@ MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); | |||
65 | module_param_array(mpu_port, long, NULL, 0444); | 66 | module_param_array(mpu_port, long, NULL, 0444); |
66 | MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); | 67 | MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); |
67 | module_param_array(irq, int, NULL, 0444); | 68 | module_param_array(irq, int, NULL, 0444); |
69 | module_param_array(fm_port, long, NULL, 0444); | ||
70 | MODULE_PARM_DESC(fm_port, "FM port # for ES1688 driver."); | ||
68 | MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); | 71 | MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); |
69 | module_param_array(mpu_irq, int, NULL, 0444); | 72 | module_param_array(mpu_irq, int, NULL, 0444); |
70 | MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); | 73 | MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); |
@@ -143,13 +146,19 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n) | |||
143 | sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, | 146 | sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", pcm->name, |
144 | chip->port, chip->irq, chip->dma8); | 147 | chip->port, chip->irq, chip->dma8); |
145 | 148 | ||
146 | if (snd_opl3_create(card, chip->port, chip->port + 2, | 149 | if (fm_port[n] == SNDRV_AUTO_PORT) |
147 | OPL3_HW_OPL3, 0, &opl3) < 0) | 150 | fm_port[n] = port[n]; /* share the same port */ |
148 | dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port); | 151 | |
149 | else { | 152 | if (fm_port[n] > 0) { |
150 | error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); | 153 | if (snd_opl3_create(card, fm_port[n], fm_port[n] + 2, |
151 | if (error < 0) | 154 | OPL3_HW_OPL3, 0, &opl3) < 0) |
152 | goto out; | 155 | dev_warn(dev, |
156 | "opl3 not detected at 0x%lx\n", fm_port[n]); | ||
157 | else { | ||
158 | error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); | ||
159 | if (error < 0) | ||
160 | goto out; | ||
161 | } | ||
153 | } | 162 | } |
154 | 163 | ||
155 | if (mpu_irq[n] >= 0 && mpu_irq[n] != SNDRV_AUTO_IRQ && | 164 | if (mpu_irq[n] >= 0 && mpu_irq[n] != SNDRV_AUTO_IRQ && |