aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/wss/wss_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/wss/wss_lib.c')
-rw-r--r--sound/isa/wss/wss_lib.c76
1 files changed, 53 insertions, 23 deletions
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 3d6c5f2838af..8de5deda7ad6 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -219,7 +219,8 @@ void snd_wss_out(struct snd_wss *chip, unsigned char reg, unsigned char value)
219 snd_wss_wait(chip); 219 snd_wss_wait(chip);
220#ifdef CONFIG_SND_DEBUG 220#ifdef CONFIG_SND_DEBUG
221 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 221 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
222 snd_printk("out: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value); 222 snd_printk(KERN_DEBUG "out: auto calibration time out "
223 "- reg = 0x%x, value = 0x%x\n", reg, value);
223#endif 224#endif
224 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 225 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
225 wss_outb(chip, CS4231P(REG), value); 226 wss_outb(chip, CS4231P(REG), value);
@@ -235,7 +236,8 @@ unsigned char snd_wss_in(struct snd_wss *chip, unsigned char reg)
235 snd_wss_wait(chip); 236 snd_wss_wait(chip);
236#ifdef CONFIG_SND_DEBUG 237#ifdef CONFIG_SND_DEBUG
237 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 238 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
238 snd_printk("in: auto calibration time out - reg = 0x%x\n", reg); 239 snd_printk(KERN_DEBUG "in: auto calibration time out "
240 "- reg = 0x%x\n", reg);
239#endif 241#endif
240 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 242 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
241 mb(); 243 mb();
@@ -252,7 +254,7 @@ void snd_cs4236_ext_out(struct snd_wss *chip, unsigned char reg,
252 wss_outb(chip, CS4231P(REG), val); 254 wss_outb(chip, CS4231P(REG), val);
253 chip->eimage[CS4236_REG(reg)] = val; 255 chip->eimage[CS4236_REG(reg)] = val;
254#if 0 256#if 0
255 printk("ext out : reg = 0x%x, val = 0x%x\n", reg, val); 257 printk(KERN_DEBUG "ext out : reg = 0x%x, val = 0x%x\n", reg, val);
256#endif 258#endif
257} 259}
258EXPORT_SYMBOL(snd_cs4236_ext_out); 260EXPORT_SYMBOL(snd_cs4236_ext_out);
@@ -268,7 +270,8 @@ unsigned char snd_cs4236_ext_in(struct snd_wss *chip, unsigned char reg)
268 { 270 {
269 unsigned char res; 271 unsigned char res;
270 res = wss_inb(chip, CS4231P(REG)); 272 res = wss_inb(chip, CS4231P(REG));
271 printk("ext in : reg = 0x%x, val = 0x%x\n", reg, res); 273 printk(KERN_DEBUG "ext in : reg = 0x%x, val = 0x%x\n",
274 reg, res);
272 return res; 275 return res;
273 } 276 }
274#endif 277#endif
@@ -394,13 +397,16 @@ void snd_wss_mce_up(struct snd_wss *chip)
394 snd_wss_wait(chip); 397 snd_wss_wait(chip);
395#ifdef CONFIG_SND_DEBUG 398#ifdef CONFIG_SND_DEBUG
396 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 399 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
397 snd_printk("mce_up - auto calibration time out (0)\n"); 400 snd_printk(KERN_DEBUG
401 "mce_up - auto calibration time out (0)\n");
398#endif 402#endif
399 spin_lock_irqsave(&chip->reg_lock, flags); 403 spin_lock_irqsave(&chip->reg_lock, flags);
400 chip->mce_bit |= CS4231_MCE; 404 chip->mce_bit |= CS4231_MCE;
401 timeout = wss_inb(chip, CS4231P(REGSEL)); 405 timeout = wss_inb(chip, CS4231P(REGSEL));
402 if (timeout == 0x80) 406 if (timeout == 0x80)
403 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 407 snd_printk(KERN_DEBUG "mce_up [0x%lx]: "
408 "serious init problem - codec still busy\n",
409 chip->port);
404 if (!(timeout & CS4231_MCE)) 410 if (!(timeout & CS4231_MCE))
405 wss_outb(chip, CS4231P(REGSEL), 411 wss_outb(chip, CS4231P(REGSEL),
406 chip->mce_bit | (timeout & 0x1f)); 412 chip->mce_bit | (timeout & 0x1f));
@@ -419,7 +425,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
419 425
420#ifdef CONFIG_SND_DEBUG 426#ifdef CONFIG_SND_DEBUG
421 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 427 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
422 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", (long)CS4231P(REGSEL)); 428 snd_printk(KERN_DEBUG "mce_down [0x%lx] - "
429 "auto calibration time out (0)\n",
430 (long)CS4231P(REGSEL));
423#endif 431#endif
424 spin_lock_irqsave(&chip->reg_lock, flags); 432 spin_lock_irqsave(&chip->reg_lock, flags);
425 chip->mce_bit &= ~CS4231_MCE; 433 chip->mce_bit &= ~CS4231_MCE;
@@ -427,7 +435,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
427 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 435 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
428 spin_unlock_irqrestore(&chip->reg_lock, flags); 436 spin_unlock_irqrestore(&chip->reg_lock, flags);
429 if (timeout == 0x80) 437 if (timeout == 0x80)
430 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); 438 snd_printk(KERN_DEBUG "mce_down [0x%lx]: "
439 "serious init problem - codec still busy\n",
440 chip->port);
431 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask)) 441 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask))
432 return; 442 return;
433 443
@@ -565,7 +575,7 @@ static unsigned char snd_wss_get_format(struct snd_wss *chip,
565 if (channels > 1) 575 if (channels > 1)
566 rformat |= CS4231_STEREO; 576 rformat |= CS4231_STEREO;
567#if 0 577#if 0
568 snd_printk("get_format: 0x%x (mode=0x%x)\n", format, mode); 578 snd_printk(KERN_DEBUG "get_format: 0x%x (mode=0x%x)\n", format, mode);
569#endif 579#endif
570 return rformat; 580 return rformat;
571} 581}
@@ -774,7 +784,7 @@ static void snd_wss_init(struct snd_wss *chip)
774 snd_wss_mce_down(chip); 784 snd_wss_mce_down(chip);
775 785
776#ifdef SNDRV_DEBUG_MCE 786#ifdef SNDRV_DEBUG_MCE
777 snd_printk("init: (1)\n"); 787 snd_printk(KERN_DEBUG "init: (1)\n");
778#endif 788#endif
779 snd_wss_mce_up(chip); 789 snd_wss_mce_up(chip);
780 spin_lock_irqsave(&chip->reg_lock, flags); 790 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -789,7 +799,7 @@ static void snd_wss_init(struct snd_wss *chip)
789 snd_wss_mce_down(chip); 799 snd_wss_mce_down(chip);
790 800
791#ifdef SNDRV_DEBUG_MCE 801#ifdef SNDRV_DEBUG_MCE
792 snd_printk("init: (2)\n"); 802 snd_printk(KERN_DEBUG "init: (2)\n");
793#endif 803#endif
794 804
795 snd_wss_mce_up(chip); 805 snd_wss_mce_up(chip);
@@ -800,7 +810,7 @@ static void snd_wss_init(struct snd_wss *chip)
800 snd_wss_mce_down(chip); 810 snd_wss_mce_down(chip);
801 811
802#ifdef SNDRV_DEBUG_MCE 812#ifdef SNDRV_DEBUG_MCE
803 snd_printk("init: (3) - afei = 0x%x\n", 813 snd_printk(KERN_DEBUG "init: (3) - afei = 0x%x\n",
804 chip->image[CS4231_ALT_FEATURE_1]); 814 chip->image[CS4231_ALT_FEATURE_1]);
805#endif 815#endif
806 816
@@ -817,7 +827,7 @@ static void snd_wss_init(struct snd_wss *chip)
817 snd_wss_mce_down(chip); 827 snd_wss_mce_down(chip);
818 828
819#ifdef SNDRV_DEBUG_MCE 829#ifdef SNDRV_DEBUG_MCE
820 snd_printk("init: (4)\n"); 830 snd_printk(KERN_DEBUG "init: (4)\n");
821#endif 831#endif
822 832
823 snd_wss_mce_up(chip); 833 snd_wss_mce_up(chip);
@@ -829,7 +839,7 @@ static void snd_wss_init(struct snd_wss *chip)
829 snd_wss_mce_down(chip); 839 snd_wss_mce_down(chip);
830 840
831#ifdef SNDRV_DEBUG_MCE 841#ifdef SNDRV_DEBUG_MCE
832 snd_printk("init: (5)\n"); 842 snd_printk(KERN_DEBUG "init: (5)\n");
833#endif 843#endif
834} 844}
835 845
@@ -1278,7 +1288,8 @@ static int snd_wss_probe(struct snd_wss *chip)
1278 } else if (rev == 0x03) { 1288 } else if (rev == 0x03) {
1279 chip->hardware = WSS_HW_CS4236B; 1289 chip->hardware = WSS_HW_CS4236B;
1280 } else { 1290 } else {
1281 snd_printk("unknown CS chip with version 0x%x\n", rev); 1291 snd_printk(KERN_ERR
1292 "unknown CS chip with version 0x%x\n", rev);
1282 return -ENODEV; /* unknown CS4231 chip? */ 1293 return -ENODEV; /* unknown CS4231 chip? */
1283 } 1294 }
1284 } 1295 }
@@ -1342,7 +1353,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1342 case 6: 1353 case 6:
1343 break; 1354 break;
1344 default: 1355 default:
1345 snd_printk("unknown CS4235 chip (enhanced version = 0x%x)\n", id); 1356 snd_printk(KERN_WARNING
1357 "unknown CS4235 chip "
1358 "(enhanced version = 0x%x)\n",
1359 id);
1346 } 1360 }
1347 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */ 1361 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */
1348 switch (id >> 5) { 1362 switch (id >> 5) {
@@ -1353,7 +1367,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1353 chip->hardware = WSS_HW_CS4236B; 1367 chip->hardware = WSS_HW_CS4236B;
1354 break; 1368 break;
1355 default: 1369 default:
1356 snd_printk("unknown CS4236 chip (enhanced version = 0x%x)\n", id); 1370 snd_printk(KERN_WARNING
1371 "unknown CS4236 chip "
1372 "(enhanced version = 0x%x)\n",
1373 id);
1357 } 1374 }
1358 } else if ((id & 0x1f) == 0x08) { /* CS4237B */ 1375 } else if ((id & 0x1f) == 0x08) { /* CS4237B */
1359 chip->hardware = WSS_HW_CS4237B; 1376 chip->hardware = WSS_HW_CS4237B;
@@ -1364,7 +1381,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1364 case 7: 1381 case 7:
1365 break; 1382 break;
1366 default: 1383 default:
1367 snd_printk("unknown CS4237B chip (enhanced version = 0x%x)\n", id); 1384 snd_printk(KERN_WARNING
1385 "unknown CS4237B chip "
1386 "(enhanced version = 0x%x)\n",
1387 id);
1368 } 1388 }
1369 } else if ((id & 0x1f) == 0x09) { /* CS4238B */ 1389 } else if ((id & 0x1f) == 0x09) { /* CS4238B */
1370 chip->hardware = WSS_HW_CS4238B; 1390 chip->hardware = WSS_HW_CS4238B;
@@ -1374,7 +1394,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1374 case 7: 1394 case 7:
1375 break; 1395 break;
1376 default: 1396 default:
1377 snd_printk("unknown CS4238B chip (enhanced version = 0x%x)\n", id); 1397 snd_printk(KERN_WARNING
1398 "unknown CS4238B chip "
1399 "(enhanced version = 0x%x)\n",
1400 id);
1378 } 1401 }
1379 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */ 1402 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */
1380 chip->hardware = WSS_HW_CS4239; 1403 chip->hardware = WSS_HW_CS4239;
@@ -1384,10 +1407,15 @@ static int snd_wss_probe(struct snd_wss *chip)
1384 case 6: 1407 case 6:
1385 break; 1408 break;
1386 default: 1409 default:
1387 snd_printk("unknown CS4239 chip (enhanced version = 0x%x)\n", id); 1410 snd_printk(KERN_WARNING
1411 "unknown CS4239 chip "
1412 "(enhanced version = 0x%x)\n",
1413 id);
1388 } 1414 }
1389 } else { 1415 } else {
1390 snd_printk("unknown CS4236/CS423xB chip (enhanced version = 0x%x)\n", id); 1416 snd_printk(KERN_WARNING
1417 "unknown CS4236/CS423xB chip "
1418 "(enhanced version = 0x%x)\n", id);
1391 } 1419 }
1392 } 1420 }
1393 } 1421 }
@@ -1618,7 +1646,8 @@ static void snd_wss_resume(struct snd_wss *chip)
1618 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 1646 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
1619 spin_unlock_irqrestore(&chip->reg_lock, flags); 1647 spin_unlock_irqrestore(&chip->reg_lock, flags);
1620 if (timeout == 0x80) 1648 if (timeout == 0x80)
1621 snd_printk("down [0x%lx]: serious init problem - codec still busy\n", chip->port); 1649 snd_printk(KERN_ERR "down [0x%lx]: serious init problem "
1650 "- codec still busy\n", chip->port);
1622 if ((timeout & CS4231_MCE) == 0 || 1651 if ((timeout & CS4231_MCE) == 0 ||
1623 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) { 1652 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) {
1624 return; 1653 return;
@@ -1820,7 +1849,8 @@ int snd_wss_create(struct snd_card *card,
1820#if 0 1849#if 0
1821 if (chip->hardware & WSS_HW_CS4232_MASK) { 1850 if (chip->hardware & WSS_HW_CS4232_MASK) {
1822 if (chip->res_cport == NULL) 1851 if (chip->res_cport == NULL)
1823 snd_printk("CS4232 control port features are not accessible\n"); 1852 snd_printk(KERN_ERR "CS4232 control port features are "
1853 "not accessible\n");
1824 } 1854 }
1825#endif 1855#endif
1826 1856