aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/es18xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/es18xx.c')
-rw-r--r--sound/isa/es18xx.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index d0ea19f42703..970e2aaade27 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -173,7 +173,7 @@ static int snd_es18xx_dsp_command(es18xx_t *chip, unsigned char val)
173 outb(val, chip->port + 0x0C); 173 outb(val, chip->port + 0x0C);
174 return 0; 174 return 0;
175 } 175 }
176 snd_printk("dsp_command: timeout (0x%x)\n", val); 176 snd_printk(KERN_ERR "dsp_command: timeout (0x%x)\n", val);
177 return -EINVAL; 177 return -EINVAL;
178} 178}
179 179
@@ -184,7 +184,8 @@ static int snd_es18xx_dsp_get_byte(es18xx_t *chip)
184 for(i = MILLISECOND/10; i; i--) 184 for(i = MILLISECOND/10; i; i--)
185 if (inb(chip->port + 0x0C) & 0x40) 185 if (inb(chip->port + 0x0C) & 0x40)
186 return inb(chip->port + 0x0A); 186 return inb(chip->port + 0x0A);
187 snd_printk("dsp_get_byte failed: 0x%lx = 0x%x!!!\n", chip->port + 0x0A, inb(chip->port + 0x0A)); 187 snd_printk(KERN_ERR "dsp_get_byte failed: 0x%lx = 0x%x!!!\n",
188 chip->port + 0x0A, inb(chip->port + 0x0A));
188 return -ENODEV; 189 return -ENODEV;
189} 190}
190 191
@@ -204,7 +205,7 @@ static int snd_es18xx_write(es18xx_t *chip,
204 end: 205 end:
205 spin_unlock_irqrestore(&chip->reg_lock, flags); 206 spin_unlock_irqrestore(&chip->reg_lock, flags);
206#ifdef REG_DEBUG 207#ifdef REG_DEBUG
207 snd_printk("Reg %02x set to %02x\n", reg, data); 208 snd_printk(KERN_DEBUG "Reg %02x set to %02x\n", reg, data);
208#endif 209#endif
209 return ret; 210 return ret;
210} 211}
@@ -223,7 +224,7 @@ static int snd_es18xx_read(es18xx_t *chip, unsigned char reg)
223 data = snd_es18xx_dsp_get_byte(chip); 224 data = snd_es18xx_dsp_get_byte(chip);
224 ret = data; 225 ret = data;
225#ifdef REG_DEBUG 226#ifdef REG_DEBUG
226 snd_printk("Reg %02x now is %02x (%d)\n", reg, data, ret); 227 snd_printk(KERN_DEBUG "Reg %02x now is %02x (%d)\n", reg, data, ret);
227#endif 228#endif
228 end: 229 end:
229 spin_unlock_irqrestore(&chip->reg_lock, flags); 230 spin_unlock_irqrestore(&chip->reg_lock, flags);
@@ -259,7 +260,8 @@ static int snd_es18xx_bits(es18xx_t *chip, unsigned char reg,
259 if (ret < 0) 260 if (ret < 0)
260 goto end; 261 goto end;
261#ifdef REG_DEBUG 262#ifdef REG_DEBUG
262 snd_printk("Reg %02x was %02x, set to %02x (%d)\n", reg, old, new, ret); 263 snd_printk(KERN_DEBUG "Reg %02x was %02x, set to %02x (%d)\n",
264 reg, old, new, ret);
263#endif 265#endif
264 } 266 }
265 ret = oval; 267 ret = oval;
@@ -277,7 +279,7 @@ static inline void snd_es18xx_mixer_write(es18xx_t *chip,
277 outb(data, chip->port + 0x05); 279 outb(data, chip->port + 0x05);
278 spin_unlock_irqrestore(&chip->mixer_lock, flags); 280 spin_unlock_irqrestore(&chip->mixer_lock, flags);
279#ifdef REG_DEBUG 281#ifdef REG_DEBUG
280 snd_printk("Mixer reg %02x set to %02x\n", reg, data); 282 snd_printk(KERN_DEBUG "Mixer reg %02x set to %02x\n", reg, data);
281#endif 283#endif
282} 284}
283 285
@@ -290,7 +292,7 @@ static inline int snd_es18xx_mixer_read(es18xx_t *chip, unsigned char reg)
290 data = inb(chip->port + 0x05); 292 data = inb(chip->port + 0x05);
291 spin_unlock_irqrestore(&chip->mixer_lock, flags); 293 spin_unlock_irqrestore(&chip->mixer_lock, flags);
292#ifdef REG_DEBUG 294#ifdef REG_DEBUG
293 snd_printk("Mixer reg %02x now is %02x\n", reg, data); 295 snd_printk(KERN_DEBUG "Mixer reg %02x now is %02x\n", reg, data);
294#endif 296#endif
295 return data; 297 return data;
296} 298}
@@ -309,7 +311,8 @@ static inline int snd_es18xx_mixer_bits(es18xx_t *chip, unsigned char reg,
309 new = (old & ~mask) | (val & mask); 311 new = (old & ~mask) | (val & mask);
310 outb(new, chip->port + 0x05); 312 outb(new, chip->port + 0x05);
311#ifdef REG_DEBUG 313#ifdef REG_DEBUG
312 snd_printk("Mixer reg %02x was %02x, set to %02x\n", reg, old, new); 314 snd_printk(KERN_DEBUG "Mixer reg %02x was %02x, set to %02x\n",
315 reg, old, new);
313#endif 316#endif
314 } 317 }
315 spin_unlock_irqrestore(&chip->mixer_lock, flags); 318 spin_unlock_irqrestore(&chip->mixer_lock, flags);
@@ -329,7 +332,8 @@ static inline int snd_es18xx_mixer_writable(es18xx_t *chip, unsigned char reg,
329 new = inb(chip->port + 0x05); 332 new = inb(chip->port + 0x05);
330 spin_unlock_irqrestore(&chip->mixer_lock, flags); 333 spin_unlock_irqrestore(&chip->mixer_lock, flags);
331#ifdef REG_DEBUG 334#ifdef REG_DEBUG
332 snd_printk("Mixer reg %02x was %02x, set to %02x, now is %02x\n", reg, old, expected, new); 335 snd_printk(KERN_DEBUG "Mixer reg %02x was %02x, set to %02x, now is %02x\n",
336 reg, old, expected, new);
333#endif 337#endif
334 return expected == new; 338 return expected == new;
335} 339}
@@ -1281,7 +1285,7 @@ static void __devinit snd_es18xx_config_write(es18xx_t *chip,
1281 outb(reg, chip->ctrl_port); 1285 outb(reg, chip->ctrl_port);
1282 outb(data, chip->ctrl_port + 1); 1286 outb(data, chip->ctrl_port + 1);
1283#ifdef REG_DEBUG 1287#ifdef REG_DEBUG
1284 snd_printk("Config reg %02x set to %02x\n", reg, data); 1288 snd_printk(KERN_DEBUG "Config reg %02x set to %02x\n", reg, data);
1285#endif 1289#endif
1286} 1290}
1287 1291
@@ -1346,7 +1350,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1346 irqmask = 3; 1350 irqmask = 3;
1347 break; 1351 break;
1348 default: 1352 default:
1349 snd_printk("invalid irq %d\n", chip->irq); 1353 snd_printk(KERN_ERR "invalid irq %d\n", chip->irq);
1350 return -ENODEV; 1354 return -ENODEV;
1351 } 1355 }
1352 switch (chip->dma1) { 1356 switch (chip->dma1) {
@@ -1360,7 +1364,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1360 dma1mask = 3; 1364 dma1mask = 3;
1361 break; 1365 break;
1362 default: 1366 default:
1363 snd_printk("invalid dma1 %d\n", chip->dma1); 1367 snd_printk(KERN_ERR "invalid dma1 %d\n", chip->dma1);
1364 return -ENODEV; 1368 return -ENODEV;
1365 } 1369 }
1366 switch (chip->dma2) { 1370 switch (chip->dma2) {
@@ -1377,7 +1381,7 @@ static int __devinit snd_es18xx_initialize(es18xx_t *chip)
1377 dma2mask = 3; 1381 dma2mask = 3;
1378 break; 1382 break;
1379 default: 1383 default:
1380 snd_printk("invalid dma2 %d\n", chip->dma2); 1384 snd_printk(KERN_ERR "invalid dma2 %d\n", chip->dma2);
1381 return -ENODEV; 1385 return -ENODEV;
1382 } 1386 }
1383 1387
@@ -1440,7 +1444,7 @@ static int __devinit snd_es18xx_identify(es18xx_t *chip)
1440 1444
1441 /* reset */ 1445 /* reset */
1442 if (snd_es18xx_reset(chip) < 0) { 1446 if (snd_es18xx_reset(chip) < 0) {
1443 snd_printk("reset at 0x%lx failed!!!\n", chip->port); 1447 snd_printk(KERN_ERR "reset at 0x%lx failed!!!\n", chip->port);
1444 return -ENODEV; 1448 return -ENODEV;
1445 } 1449 }
1446 1450
@@ -1527,7 +1531,7 @@ static int __devinit snd_es18xx_probe(es18xx_t *chip)
1527 chip->caps = ES18XX_PCM2 | ES18XX_RECMIX | ES18XX_AUXB | ES18XX_DUPLEX_SAME | ES18XX_HWV; 1531 chip->caps = ES18XX_PCM2 | ES18XX_RECMIX | ES18XX_AUXB | ES18XX_DUPLEX_SAME | ES18XX_HWV;
1528 break; 1532 break;
1529 default: 1533 default:
1530 snd_printk("[0x%lx] unsupported chip ES%x\n", 1534 snd_printk(KERN_ERR "[0x%lx] unsupported chip ES%x\n",
1531 chip->port, chip->version); 1535 chip->port, chip->version);
1532 return -ENODEV; 1536 return -ENODEV;
1533 } 1537 }
@@ -1640,18 +1644,9 @@ static int snd_es18xx_resume(snd_card_t *card)
1640 1644
1641static int snd_es18xx_free(es18xx_t *chip) 1645static int snd_es18xx_free(es18xx_t *chip)
1642{ 1646{
1643 if (chip->res_port) { 1647 release_and_free_resource(chip->res_port);
1644 release_resource(chip->res_port); 1648 release_and_free_resource(chip->res_ctrl_port);
1645 kfree_nocheck(chip->res_port); 1649 release_and_free_resource(chip->res_mpu_port);
1646 }
1647 if (chip->res_ctrl_port) {
1648 release_resource(chip->res_ctrl_port);
1649 kfree_nocheck(chip->res_ctrl_port);
1650 }
1651 if (chip->res_mpu_port) {
1652 release_resource(chip->res_mpu_port);
1653 kfree_nocheck(chip->res_mpu_port);
1654 }
1655 if (chip->irq >= 0) 1650 if (chip->irq >= 0)
1656 free_irq(chip->irq, (void *) chip); 1651 free_irq(chip->irq, (void *) chip);
1657 if (chip->dma1 >= 0) { 1652 if (chip->dma1 >= 0) {