aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/es1688/es1688.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/es1688/es1688.c')
-rw-r--r--sound/isa/es1688/es1688.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index b46377139cf8..442b081cafb7 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 */
49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
51static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 51static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
52static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */
52static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 53static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
53static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ 54static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
54static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ 55static 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.");
65module_param_array(mpu_port, long, NULL, 0444); 66module_param_array(mpu_port, long, NULL, 0444);
66MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver."); 67MODULE_PARM_DESC(mpu_port, "MPU-401 port # for " CRD_NAME " driver.");
67module_param_array(irq, int, NULL, 0444); 68module_param_array(irq, int, NULL, 0444);
69module_param_array(fm_port, long, NULL, 0444);
70MODULE_PARM_DESC(fm_port, "FM port # for ES1688 driver.");
68MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver."); 71MODULE_PARM_DESC(irq, "IRQ # for " CRD_NAME " driver.");
69module_param_array(mpu_irq, int, NULL, 0444); 72module_param_array(mpu_irq, int, NULL, 0444);
70MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver."); 73MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for " CRD_NAME " driver.");
@@ -122,9 +125,9 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
122 struct snd_pcm *pcm; 125 struct snd_pcm *pcm;
123 int error; 126 int error;
124 127
125 card = snd_card_new(index[n], id[n], THIS_MODULE, 0); 128 error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
126 if (!card) 129 if (error < 0)
127 return -EINVAL; 130 return error;
128 131
129 error = snd_es1688_legacy_create(card, dev, n, &chip); 132 error = snd_es1688_legacy_create(card, dev, n, &chip);
130 if (error < 0) 133 if (error < 0)
@@ -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 &&