aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus/gusextreme.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/gus/gusextreme.c')
-rw-r--r--sound/isa/gus/gusextreme.c49
1 files changed, 18 insertions, 31 deletions
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index bc6fecb18dcf..d2e7cb1df537 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -87,6 +87,7 @@ MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver.");
87 87
88static snd_card_t *snd_gusextreme_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 88static snd_card_t *snd_gusextreme_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
89 89
90#define PFX "gusextreme: "
90 91
91static int __init snd_gusextreme_detect(int dev, 92static int __init snd_gusextreme_detect(int dev,
92 snd_card_t * card, 93 snd_card_t * card,
@@ -94,6 +95,7 @@ static int __init snd_gusextreme_detect(int dev,
94 es1688_t *es1688) 95 es1688_t *es1688)
95{ 96{
96 unsigned long flags; 97 unsigned long flags;
98 unsigned char d;
97 99
98 /* 100 /*
99 * This is main stuff - enable access to GF1 chip... 101 * This is main stuff - enable access to GF1 chip...
@@ -123,36 +125,17 @@ static int __init snd_gusextreme_detect(int dev,
123 udelay(100); 125 udelay(100);
124 126
125 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */ 127 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 0); /* reset GF1 */
126#ifdef CONFIG_SND_DEBUG_DETECT 128 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 0) {
127 { 129 snd_printdd("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
128 unsigned char d;
129
130 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 0) {
131 snd_printk("[0x%lx] check 1 failed - 0x%x\n", gus->gf1.port, d);
132 return -EIO;
133 }
134 }
135#else
136 if ((snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET) & 0x07) != 0)
137 return -EIO; 130 return -EIO;
138#endif 131 }
139 udelay(160); 132 udelay(160);
140 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */ 133 snd_gf1_i_write8(gus, SNDRV_GF1_GB_RESET, 1); /* release reset */
141 udelay(160); 134 udelay(160);
142#ifdef CONFIG_SND_DEBUG_DETECT 135 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) {
143 { 136 snd_printdd("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
144 unsigned char d;
145
146 if (((d = snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)) & 0x07) != 1) {
147 snd_printk("[0x%lx] check 2 failed - 0x%x\n", gus->gf1.port, d);
148 return -EIO;
149 }
150 }
151#else
152 if ((snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET) & 0x07) != 1)
153 return -EIO; 137 return -EIO;
154#endif 138 }
155
156 return 0; 139 return 0;
157} 140}
158 141
@@ -205,7 +188,7 @@ static int __init snd_gusextreme_probe(int dev)
205 xgf1_irq = gf1_irq[dev]; 188 xgf1_irq = gf1_irq[dev];
206 if (xgf1_irq == SNDRV_AUTO_IRQ) { 189 if (xgf1_irq == SNDRV_AUTO_IRQ) {
207 if ((xgf1_irq = snd_legacy_find_free_irq(possible_gf1_irqs)) < 0) { 190 if ((xgf1_irq = snd_legacy_find_free_irq(possible_gf1_irqs)) < 0) {
208 snd_printk("unable to find a free IRQ for GF1\n"); 191 snd_printk(KERN_ERR PFX "unable to find a free IRQ for GF1\n");
209 err = -EBUSY; 192 err = -EBUSY;
210 goto out; 193 goto out;
211 } 194 }
@@ -213,7 +196,7 @@ static int __init snd_gusextreme_probe(int dev)
213 xess_irq = irq[dev]; 196 xess_irq = irq[dev];
214 if (xess_irq == SNDRV_AUTO_IRQ) { 197 if (xess_irq == SNDRV_AUTO_IRQ) {
215 if ((xess_irq = snd_legacy_find_free_irq(possible_ess_irqs)) < 0) { 198 if ((xess_irq = snd_legacy_find_free_irq(possible_ess_irqs)) < 0) {
216 snd_printk("unable to find a free IRQ for ES1688\n"); 199 snd_printk(KERN_ERR PFX "unable to find a free IRQ for ES1688\n");
217 err = -EBUSY; 200 err = -EBUSY;
218 goto out; 201 goto out;
219 } 202 }
@@ -226,7 +209,7 @@ static int __init snd_gusextreme_probe(int dev)
226 xgf1_dma = dma1[dev]; 209 xgf1_dma = dma1[dev];
227 if (xgf1_dma == SNDRV_AUTO_DMA) { 210 if (xgf1_dma == SNDRV_AUTO_DMA) {
228 if ((xgf1_dma = snd_legacy_find_free_dma(possible_gf1_dmas)) < 0) { 211 if ((xgf1_dma = snd_legacy_find_free_dma(possible_gf1_dmas)) < 0) {
229 snd_printk("unable to find a free DMA for GF1\n"); 212 snd_printk(KERN_ERR PFX "unable to find a free DMA for GF1\n");
230 err = -EBUSY; 213 err = -EBUSY;
231 goto out; 214 goto out;
232 } 215 }
@@ -234,7 +217,7 @@ static int __init snd_gusextreme_probe(int dev)
234 xess_dma = dma8[dev]; 217 xess_dma = dma8[dev];
235 if (xess_dma == SNDRV_AUTO_DMA) { 218 if (xess_dma == SNDRV_AUTO_DMA) {
236 if ((xess_dma = snd_legacy_find_free_dma(possible_ess_dmas)) < 0) { 219 if ((xess_dma = snd_legacy_find_free_dma(possible_ess_dmas)) < 0) {
237 snd_printk("unable to find a free DMA for ES1688\n"); 220 snd_printk(KERN_ERR PFX "unable to find a free DMA for ES1688\n");
238 err = -EBUSY; 221 err = -EBUSY;
239 goto out; 222 goto out;
240 } 223 }
@@ -264,7 +247,7 @@ static int __init snd_gusextreme_probe(int dev)
264 goto out; 247 goto out;
265 248
266 if (!gus->ess_flag) { 249 if (!gus->ess_flag) {
267 snd_printdd("GUS Extreme soundcard was not detected at 0x%lx\n", gus->gf1.port); 250 snd_printk(KERN_ERR PFX "GUS Extreme soundcard was not detected at 0x%lx\n", gus->gf1.port);
268 err = -ENODEV; 251 err = -ENODEV;
269 goto out; 252 goto out;
270 } 253 }
@@ -287,7 +270,7 @@ static int __init snd_gusextreme_probe(int dev)
287 270
288 if (snd_opl3_create(card, es1688->port, es1688->port + 2, 271 if (snd_opl3_create(card, es1688->port, es1688->port + 2,
289 OPL3_HW_OPL3, 0, &opl3) < 0) { 272 OPL3_HW_OPL3, 0, &opl3) < 0) {
290 printk(KERN_ERR "gusextreme: opl3 not detected at 0x%lx\n", es1688->port); 273 printk(KERN_ERR PFX "gusextreme: opl3 not detected at 0x%lx\n", es1688->port);
291 } else { 274 } else {
292 if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0) 275 if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0)
293 goto out; 276 goto out;
@@ -303,6 +286,10 @@ static int __init snd_gusextreme_probe(int dev)
303 286
304 sprintf(card->longname, "Gravis UltraSound Extreme at 0x%lx, irq %i&%i, dma %i&%i", 287 sprintf(card->longname, "Gravis UltraSound Extreme at 0x%lx, irq %i&%i, dma %i&%i",
305 es1688->port, xgf1_irq, xess_irq, xgf1_dma, xess_dma); 288 es1688->port, xgf1_irq, xess_irq, xgf1_dma, xess_dma);
289
290 if ((err = snd_card_set_generic_dev(card)) < 0)
291 goto out;
292
306 if ((err = snd_card_register(card)) < 0) 293 if ((err = snd_card_register(card)) < 0)
307 goto out; 294 goto out;
308 295