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.c160
1 files changed, 108 insertions, 52 deletions
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 3d6c5f2838af..5d2ba1b749ab 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -181,25 +181,6 @@ static void snd_wss_wait(struct snd_wss *chip)
181 udelay(100); 181 udelay(100);
182} 182}
183 183
184static void snd_wss_outm(struct snd_wss *chip, unsigned char reg,
185 unsigned char mask, unsigned char value)
186{
187 unsigned char tmp = (chip->image[reg] & mask) | value;
188
189 snd_wss_wait(chip);
190#ifdef CONFIG_SND_DEBUG
191 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
192 snd_printk("outm: auto calibration time out - reg = 0x%x, value = 0x%x\n", reg, value);
193#endif
194 chip->image[reg] = tmp;
195 if (!chip->calibrate_mute) {
196 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
197 wmb();
198 wss_outb(chip, CS4231P(REG), tmp);
199 mb();
200 }
201}
202
203static void snd_wss_dout(struct snd_wss *chip, unsigned char reg, 184static void snd_wss_dout(struct snd_wss *chip, unsigned char reg,
204 unsigned char value) 185 unsigned char value)
205{ 186{
@@ -219,7 +200,8 @@ void snd_wss_out(struct snd_wss *chip, unsigned char reg, unsigned char value)
219 snd_wss_wait(chip); 200 snd_wss_wait(chip);
220#ifdef CONFIG_SND_DEBUG 201#ifdef CONFIG_SND_DEBUG
221 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 202 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); 203 snd_printk(KERN_DEBUG "out: auto calibration time out "
204 "- reg = 0x%x, value = 0x%x\n", reg, value);
223#endif 205#endif
224 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 206 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
225 wss_outb(chip, CS4231P(REG), value); 207 wss_outb(chip, CS4231P(REG), value);
@@ -235,7 +217,8 @@ unsigned char snd_wss_in(struct snd_wss *chip, unsigned char reg)
235 snd_wss_wait(chip); 217 snd_wss_wait(chip);
236#ifdef CONFIG_SND_DEBUG 218#ifdef CONFIG_SND_DEBUG
237 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 219 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
238 snd_printk("in: auto calibration time out - reg = 0x%x\n", reg); 220 snd_printk(KERN_DEBUG "in: auto calibration time out "
221 "- reg = 0x%x\n", reg);
239#endif 222#endif
240 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg); 223 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | reg);
241 mb(); 224 mb();
@@ -252,7 +235,7 @@ void snd_cs4236_ext_out(struct snd_wss *chip, unsigned char reg,
252 wss_outb(chip, CS4231P(REG), val); 235 wss_outb(chip, CS4231P(REG), val);
253 chip->eimage[CS4236_REG(reg)] = val; 236 chip->eimage[CS4236_REG(reg)] = val;
254#if 0 237#if 0
255 printk("ext out : reg = 0x%x, val = 0x%x\n", reg, val); 238 printk(KERN_DEBUG "ext out : reg = 0x%x, val = 0x%x\n", reg, val);
256#endif 239#endif
257} 240}
258EXPORT_SYMBOL(snd_cs4236_ext_out); 241EXPORT_SYMBOL(snd_cs4236_ext_out);
@@ -268,7 +251,8 @@ unsigned char snd_cs4236_ext_in(struct snd_wss *chip, unsigned char reg)
268 { 251 {
269 unsigned char res; 252 unsigned char res;
270 res = wss_inb(chip, CS4231P(REG)); 253 res = wss_inb(chip, CS4231P(REG));
271 printk("ext in : reg = 0x%x, val = 0x%x\n", reg, res); 254 printk(KERN_DEBUG "ext in : reg = 0x%x, val = 0x%x\n",
255 reg, res);
272 return res; 256 return res;
273 } 257 }
274#endif 258#endif
@@ -394,13 +378,16 @@ void snd_wss_mce_up(struct snd_wss *chip)
394 snd_wss_wait(chip); 378 snd_wss_wait(chip);
395#ifdef CONFIG_SND_DEBUG 379#ifdef CONFIG_SND_DEBUG
396 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 380 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
397 snd_printk("mce_up - auto calibration time out (0)\n"); 381 snd_printk(KERN_DEBUG
382 "mce_up - auto calibration time out (0)\n");
398#endif 383#endif
399 spin_lock_irqsave(&chip->reg_lock, flags); 384 spin_lock_irqsave(&chip->reg_lock, flags);
400 chip->mce_bit |= CS4231_MCE; 385 chip->mce_bit |= CS4231_MCE;
401 timeout = wss_inb(chip, CS4231P(REGSEL)); 386 timeout = wss_inb(chip, CS4231P(REGSEL));
402 if (timeout == 0x80) 387 if (timeout == 0x80)
403 snd_printk("mce_up [0x%lx]: serious init problem - codec still busy\n", chip->port); 388 snd_printk(KERN_DEBUG "mce_up [0x%lx]: "
389 "serious init problem - codec still busy\n",
390 chip->port);
404 if (!(timeout & CS4231_MCE)) 391 if (!(timeout & CS4231_MCE))
405 wss_outb(chip, CS4231P(REGSEL), 392 wss_outb(chip, CS4231P(REGSEL),
406 chip->mce_bit | (timeout & 0x1f)); 393 chip->mce_bit | (timeout & 0x1f));
@@ -419,7 +406,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
419 406
420#ifdef CONFIG_SND_DEBUG 407#ifdef CONFIG_SND_DEBUG
421 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) 408 if (wss_inb(chip, CS4231P(REGSEL)) & CS4231_INIT)
422 snd_printk("mce_down [0x%lx] - auto calibration time out (0)\n", (long)CS4231P(REGSEL)); 409 snd_printk(KERN_DEBUG "mce_down [0x%lx] - "
410 "auto calibration time out (0)\n",
411 (long)CS4231P(REGSEL));
423#endif 412#endif
424 spin_lock_irqsave(&chip->reg_lock, flags); 413 spin_lock_irqsave(&chip->reg_lock, flags);
425 chip->mce_bit &= ~CS4231_MCE; 414 chip->mce_bit &= ~CS4231_MCE;
@@ -427,7 +416,9 @@ void snd_wss_mce_down(struct snd_wss *chip)
427 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 416 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
428 spin_unlock_irqrestore(&chip->reg_lock, flags); 417 spin_unlock_irqrestore(&chip->reg_lock, flags);
429 if (timeout == 0x80) 418 if (timeout == 0x80)
430 snd_printk("mce_down [0x%lx]: serious init problem - codec still busy\n", chip->port); 419 snd_printk(KERN_DEBUG "mce_down [0x%lx]: "
420 "serious init problem - codec still busy\n",
421 chip->port);
431 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask)) 422 if ((timeout & CS4231_MCE) == 0 || !(chip->hardware & hw_mask))
432 return; 423 return;
433 424
@@ -565,7 +556,7 @@ static unsigned char snd_wss_get_format(struct snd_wss *chip,
565 if (channels > 1) 556 if (channels > 1)
566 rformat |= CS4231_STEREO; 557 rformat |= CS4231_STEREO;
567#if 0 558#if 0
568 snd_printk("get_format: 0x%x (mode=0x%x)\n", format, mode); 559 snd_printk(KERN_DEBUG "get_format: 0x%x (mode=0x%x)\n", format, mode);
569#endif 560#endif
570 return rformat; 561 return rformat;
571} 562}
@@ -587,7 +578,15 @@ static void snd_wss_calibrate_mute(struct snd_wss *chip, int mute)
587 chip->image[CS4231_RIGHT_INPUT]); 578 chip->image[CS4231_RIGHT_INPUT]);
588 snd_wss_dout(chip, CS4231_LOOPBACK, 579 snd_wss_dout(chip, CS4231_LOOPBACK,
589 chip->image[CS4231_LOOPBACK]); 580 chip->image[CS4231_LOOPBACK]);
581 } else {
582 snd_wss_dout(chip, CS4231_LEFT_INPUT,
583 0);
584 snd_wss_dout(chip, CS4231_RIGHT_INPUT,
585 0);
586 snd_wss_dout(chip, CS4231_LOOPBACK,
587 0xfd);
590 } 588 }
589
591 snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT, 590 snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT,
592 mute | chip->image[CS4231_AUX1_LEFT_INPUT]); 591 mute | chip->image[CS4231_AUX1_LEFT_INPUT]);
593 snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT, 592 snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT,
@@ -630,7 +629,6 @@ static void snd_wss_playback_format(struct snd_wss *chip,
630 int full_calib = 1; 629 int full_calib = 1;
631 630
632 mutex_lock(&chip->mce_mutex); 631 mutex_lock(&chip->mce_mutex);
633 snd_wss_calibrate_mute(chip, 1);
634 if (chip->hardware == WSS_HW_CS4231A || 632 if (chip->hardware == WSS_HW_CS4231A ||
635 (chip->hardware & WSS_HW_CS4232_MASK)) { 633 (chip->hardware & WSS_HW_CS4232_MASK)) {
636 spin_lock_irqsave(&chip->reg_lock, flags); 634 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -646,6 +644,24 @@ static void snd_wss_playback_format(struct snd_wss *chip,
646 full_calib = 0; 644 full_calib = 0;
647 } 645 }
648 spin_unlock_irqrestore(&chip->reg_lock, flags); 646 spin_unlock_irqrestore(&chip->reg_lock, flags);
647 } else if (chip->hardware == WSS_HW_AD1845) {
648 unsigned rate = params_rate(params);
649
650 /*
651 * Program the AD1845 correctly for the playback stream.
652 * Note that we do NOT need to toggle the MCE bit because
653 * the PLAYBACK_ENABLE bit of the Interface Configuration
654 * register is set.
655 *
656 * NOTE: We seem to need to write to the MSB before the LSB
657 * to get the correct sample frequency.
658 */
659 spin_lock_irqsave(&chip->reg_lock, flags);
660 snd_wss_out(chip, CS4231_PLAYBK_FORMAT, (pdfr & 0xf0));
661 snd_wss_out(chip, AD1845_UPR_FREQ_SEL, (rate >> 8) & 0xff);
662 snd_wss_out(chip, AD1845_LWR_FREQ_SEL, rate & 0xff);
663 full_calib = 0;
664 spin_unlock_irqrestore(&chip->reg_lock, flags);
649 } 665 }
650 if (full_calib) { 666 if (full_calib) {
651 snd_wss_mce_up(chip); 667 snd_wss_mce_up(chip);
@@ -663,7 +679,6 @@ static void snd_wss_playback_format(struct snd_wss *chip,
663 udelay(100); /* this seems to help */ 679 udelay(100); /* this seems to help */
664 snd_wss_mce_down(chip); 680 snd_wss_mce_down(chip);
665 } 681 }
666 snd_wss_calibrate_mute(chip, 0);
667 mutex_unlock(&chip->mce_mutex); 682 mutex_unlock(&chip->mce_mutex);
668} 683}
669 684
@@ -675,7 +690,6 @@ static void snd_wss_capture_format(struct snd_wss *chip,
675 int full_calib = 1; 690 int full_calib = 1;
676 691
677 mutex_lock(&chip->mce_mutex); 692 mutex_lock(&chip->mce_mutex);
678 snd_wss_calibrate_mute(chip, 1);
679 if (chip->hardware == WSS_HW_CS4231A || 693 if (chip->hardware == WSS_HW_CS4231A ||
680 (chip->hardware & WSS_HW_CS4232_MASK)) { 694 (chip->hardware & WSS_HW_CS4232_MASK)) {
681 spin_lock_irqsave(&chip->reg_lock, flags); 695 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -690,6 +704,24 @@ static void snd_wss_capture_format(struct snd_wss *chip,
690 full_calib = 0; 704 full_calib = 0;
691 } 705 }
692 spin_unlock_irqrestore(&chip->reg_lock, flags); 706 spin_unlock_irqrestore(&chip->reg_lock, flags);
707 } else if (chip->hardware == WSS_HW_AD1845) {
708 unsigned rate = params_rate(params);
709
710 /*
711 * Program the AD1845 correctly for the capture stream.
712 * Note that we do NOT need to toggle the MCE bit because
713 * the PLAYBACK_ENABLE bit of the Interface Configuration
714 * register is set.
715 *
716 * NOTE: We seem to need to write to the MSB before the LSB
717 * to get the correct sample frequency.
718 */
719 spin_lock_irqsave(&chip->reg_lock, flags);
720 snd_wss_out(chip, CS4231_REC_FORMAT, (cdfr & 0xf0));
721 snd_wss_out(chip, AD1845_UPR_FREQ_SEL, (rate >> 8) & 0xff);
722 snd_wss_out(chip, AD1845_LWR_FREQ_SEL, rate & 0xff);
723 full_calib = 0;
724 spin_unlock_irqrestore(&chip->reg_lock, flags);
693 } 725 }
694 if (full_calib) { 726 if (full_calib) {
695 snd_wss_mce_up(chip); 727 snd_wss_mce_up(chip);
@@ -714,7 +746,6 @@ static void snd_wss_capture_format(struct snd_wss *chip,
714 spin_unlock_irqrestore(&chip->reg_lock, flags); 746 spin_unlock_irqrestore(&chip->reg_lock, flags);
715 snd_wss_mce_down(chip); 747 snd_wss_mce_down(chip);
716 } 748 }
717 snd_wss_calibrate_mute(chip, 0);
718 mutex_unlock(&chip->mce_mutex); 749 mutex_unlock(&chip->mce_mutex);
719} 750}
720 751
@@ -771,10 +802,11 @@ static void snd_wss_init(struct snd_wss *chip)
771{ 802{
772 unsigned long flags; 803 unsigned long flags;
773 804
805 snd_wss_calibrate_mute(chip, 1);
774 snd_wss_mce_down(chip); 806 snd_wss_mce_down(chip);
775 807
776#ifdef SNDRV_DEBUG_MCE 808#ifdef SNDRV_DEBUG_MCE
777 snd_printk("init: (1)\n"); 809 snd_printk(KERN_DEBUG "init: (1)\n");
778#endif 810#endif
779 snd_wss_mce_up(chip); 811 snd_wss_mce_up(chip);
780 spin_lock_irqsave(&chip->reg_lock, flags); 812 spin_lock_irqsave(&chip->reg_lock, flags);
@@ -789,18 +821,20 @@ static void snd_wss_init(struct snd_wss *chip)
789 snd_wss_mce_down(chip); 821 snd_wss_mce_down(chip);
790 822
791#ifdef SNDRV_DEBUG_MCE 823#ifdef SNDRV_DEBUG_MCE
792 snd_printk("init: (2)\n"); 824 snd_printk(KERN_DEBUG "init: (2)\n");
793#endif 825#endif
794 826
795 snd_wss_mce_up(chip); 827 snd_wss_mce_up(chip);
796 spin_lock_irqsave(&chip->reg_lock, flags); 828 spin_lock_irqsave(&chip->reg_lock, flags);
829 chip->image[CS4231_IFACE_CTRL] &= ~CS4231_AUTOCALIB;
830 snd_wss_out(chip, CS4231_IFACE_CTRL, chip->image[CS4231_IFACE_CTRL]);
797 snd_wss_out(chip, 831 snd_wss_out(chip,
798 CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1]); 832 CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1]);
799 spin_unlock_irqrestore(&chip->reg_lock, flags); 833 spin_unlock_irqrestore(&chip->reg_lock, flags);
800 snd_wss_mce_down(chip); 834 snd_wss_mce_down(chip);
801 835
802#ifdef SNDRV_DEBUG_MCE 836#ifdef SNDRV_DEBUG_MCE
803 snd_printk("init: (3) - afei = 0x%x\n", 837 snd_printk(KERN_DEBUG "init: (3) - afei = 0x%x\n",
804 chip->image[CS4231_ALT_FEATURE_1]); 838 chip->image[CS4231_ALT_FEATURE_1]);
805#endif 839#endif
806 840
@@ -817,7 +851,7 @@ static void snd_wss_init(struct snd_wss *chip)
817 snd_wss_mce_down(chip); 851 snd_wss_mce_down(chip);
818 852
819#ifdef SNDRV_DEBUG_MCE 853#ifdef SNDRV_DEBUG_MCE
820 snd_printk("init: (4)\n"); 854 snd_printk(KERN_DEBUG "init: (4)\n");
821#endif 855#endif
822 856
823 snd_wss_mce_up(chip); 857 snd_wss_mce_up(chip);
@@ -827,9 +861,10 @@ static void snd_wss_init(struct snd_wss *chip)
827 chip->image[CS4231_REC_FORMAT]); 861 chip->image[CS4231_REC_FORMAT]);
828 spin_unlock_irqrestore(&chip->reg_lock, flags); 862 spin_unlock_irqrestore(&chip->reg_lock, flags);
829 snd_wss_mce_down(chip); 863 snd_wss_mce_down(chip);
864 snd_wss_calibrate_mute(chip, 0);
830 865
831#ifdef SNDRV_DEBUG_MCE 866#ifdef SNDRV_DEBUG_MCE
832 snd_printk("init: (5)\n"); 867 snd_printk(KERN_DEBUG "init: (5)\n");
833#endif 868#endif
834} 869}
835 870
@@ -885,8 +920,6 @@ static void snd_wss_close(struct snd_wss *chip, unsigned int mode)
885 mutex_unlock(&chip->open_mutex); 920 mutex_unlock(&chip->open_mutex);
886 return; 921 return;
887 } 922 }
888 snd_wss_calibrate_mute(chip, 1);
889
890 /* disable IRQ */ 923 /* disable IRQ */
891 spin_lock_irqsave(&chip->reg_lock, flags); 924 spin_lock_irqsave(&chip->reg_lock, flags);
892 if (!(chip->hardware & WSS_HW_AD1848_MASK)) 925 if (!(chip->hardware & WSS_HW_AD1848_MASK))
@@ -919,8 +952,6 @@ static void snd_wss_close(struct snd_wss *chip, unsigned int mode)
919 wss_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */ 952 wss_outb(chip, CS4231P(STATUS), 0); /* clear IRQ */
920 spin_unlock_irqrestore(&chip->reg_lock, flags); 953 spin_unlock_irqrestore(&chip->reg_lock, flags);
921 954
922 snd_wss_calibrate_mute(chip, 0);
923
924 chip->mode = 0; 955 chip->mode = 0;
925 mutex_unlock(&chip->open_mutex); 956 mutex_unlock(&chip->open_mutex);
926} 957}
@@ -1113,7 +1144,7 @@ irqreturn_t snd_wss_interrupt(int irq, void *dev_id)
1113 if (chip->hardware & WSS_HW_AD1848_MASK) 1144 if (chip->hardware & WSS_HW_AD1848_MASK)
1114 wss_outb(chip, CS4231P(STATUS), 0); 1145 wss_outb(chip, CS4231P(STATUS), 0);
1115 else 1146 else
1116 snd_wss_outm(chip, CS4231_IRQ_STATUS, status, 0); 1147 snd_wss_out(chip, CS4231_IRQ_STATUS, status);
1117 spin_unlock(&chip->reg_lock); 1148 spin_unlock(&chip->reg_lock);
1118 return IRQ_HANDLED; 1149 return IRQ_HANDLED;
1119} 1150}
@@ -1278,7 +1309,8 @@ static int snd_wss_probe(struct snd_wss *chip)
1278 } else if (rev == 0x03) { 1309 } else if (rev == 0x03) {
1279 chip->hardware = WSS_HW_CS4236B; 1310 chip->hardware = WSS_HW_CS4236B;
1280 } else { 1311 } else {
1281 snd_printk("unknown CS chip with version 0x%x\n", rev); 1312 snd_printk(KERN_ERR
1313 "unknown CS chip with version 0x%x\n", rev);
1282 return -ENODEV; /* unknown CS4231 chip? */ 1314 return -ENODEV; /* unknown CS4231 chip? */
1283 } 1315 }
1284 } 1316 }
@@ -1314,6 +1346,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1314 chip->image[CS4231_ALT_FEATURE_2] = 1346 chip->image[CS4231_ALT_FEATURE_2] =
1315 chip->hardware == WSS_HW_INTERWAVE ? 0xc2 : 0x01; 1347 chip->hardware == WSS_HW_INTERWAVE ? 0xc2 : 0x01;
1316 } 1348 }
1349 /* enable fine grained frequency selection */
1350 if (chip->hardware == WSS_HW_AD1845)
1351 chip->image[AD1845_PWR_DOWN] = 8;
1352
1317 ptr = (unsigned char *) &chip->image; 1353 ptr = (unsigned char *) &chip->image;
1318 regnum = (chip->hardware & WSS_HW_AD1848_MASK) ? 16 : 32; 1354 regnum = (chip->hardware & WSS_HW_AD1848_MASK) ? 16 : 32;
1319 snd_wss_mce_down(chip); 1355 snd_wss_mce_down(chip);
@@ -1342,7 +1378,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1342 case 6: 1378 case 6:
1343 break; 1379 break;
1344 default: 1380 default:
1345 snd_printk("unknown CS4235 chip (enhanced version = 0x%x)\n", id); 1381 snd_printk(KERN_WARNING
1382 "unknown CS4235 chip "
1383 "(enhanced version = 0x%x)\n",
1384 id);
1346 } 1385 }
1347 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */ 1386 } else if ((id & 0x1f) == 0x0b) { /* CS4236/B */
1348 switch (id >> 5) { 1387 switch (id >> 5) {
@@ -1353,7 +1392,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1353 chip->hardware = WSS_HW_CS4236B; 1392 chip->hardware = WSS_HW_CS4236B;
1354 break; 1393 break;
1355 default: 1394 default:
1356 snd_printk("unknown CS4236 chip (enhanced version = 0x%x)\n", id); 1395 snd_printk(KERN_WARNING
1396 "unknown CS4236 chip "
1397 "(enhanced version = 0x%x)\n",
1398 id);
1357 } 1399 }
1358 } else if ((id & 0x1f) == 0x08) { /* CS4237B */ 1400 } else if ((id & 0x1f) == 0x08) { /* CS4237B */
1359 chip->hardware = WSS_HW_CS4237B; 1401 chip->hardware = WSS_HW_CS4237B;
@@ -1364,7 +1406,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1364 case 7: 1406 case 7:
1365 break; 1407 break;
1366 default: 1408 default:
1367 snd_printk("unknown CS4237B chip (enhanced version = 0x%x)\n", id); 1409 snd_printk(KERN_WARNING
1410 "unknown CS4237B chip "
1411 "(enhanced version = 0x%x)\n",
1412 id);
1368 } 1413 }
1369 } else if ((id & 0x1f) == 0x09) { /* CS4238B */ 1414 } else if ((id & 0x1f) == 0x09) { /* CS4238B */
1370 chip->hardware = WSS_HW_CS4238B; 1415 chip->hardware = WSS_HW_CS4238B;
@@ -1374,7 +1419,10 @@ static int snd_wss_probe(struct snd_wss *chip)
1374 case 7: 1419 case 7:
1375 break; 1420 break;
1376 default: 1421 default:
1377 snd_printk("unknown CS4238B chip (enhanced version = 0x%x)\n", id); 1422 snd_printk(KERN_WARNING
1423 "unknown CS4238B chip "
1424 "(enhanced version = 0x%x)\n",
1425 id);
1378 } 1426 }
1379 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */ 1427 } else if ((id & 0x1f) == 0x1e) { /* CS4239 */
1380 chip->hardware = WSS_HW_CS4239; 1428 chip->hardware = WSS_HW_CS4239;
@@ -1384,10 +1432,15 @@ static int snd_wss_probe(struct snd_wss *chip)
1384 case 6: 1432 case 6:
1385 break; 1433 break;
1386 default: 1434 default:
1387 snd_printk("unknown CS4239 chip (enhanced version = 0x%x)\n", id); 1435 snd_printk(KERN_WARNING
1436 "unknown CS4239 chip "
1437 "(enhanced version = 0x%x)\n",
1438 id);
1388 } 1439 }
1389 } else { 1440 } else {
1390 snd_printk("unknown CS4236/CS423xB chip (enhanced version = 0x%x)\n", id); 1441 snd_printk(KERN_WARNING
1442 "unknown CS4236/CS423xB chip "
1443 "(enhanced version = 0x%x)\n", id);
1391 } 1444 }
1392 } 1445 }
1393 } 1446 }
@@ -1618,7 +1671,8 @@ static void snd_wss_resume(struct snd_wss *chip)
1618 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f)); 1671 wss_outb(chip, CS4231P(REGSEL), chip->mce_bit | (timeout & 0x1f));
1619 spin_unlock_irqrestore(&chip->reg_lock, flags); 1672 spin_unlock_irqrestore(&chip->reg_lock, flags);
1620 if (timeout == 0x80) 1673 if (timeout == 0x80)
1621 snd_printk("down [0x%lx]: serious init problem - codec still busy\n", chip->port); 1674 snd_printk(KERN_ERR "down [0x%lx]: serious init problem "
1675 "- codec still busy\n", chip->port);
1622 if ((timeout & CS4231_MCE) == 0 || 1676 if ((timeout & CS4231_MCE) == 0 ||
1623 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) { 1677 !(chip->hardware & (WSS_HW_CS4231_MASK | WSS_HW_CS4232_MASK))) {
1624 return; 1678 return;
@@ -1628,7 +1682,7 @@ static void snd_wss_resume(struct snd_wss *chip)
1628} 1682}
1629#endif /* CONFIG_PM */ 1683#endif /* CONFIG_PM */
1630 1684
1631static int snd_wss_free(struct snd_wss *chip) 1685int snd_wss_free(struct snd_wss *chip)
1632{ 1686{
1633 release_and_free_resource(chip->res_port); 1687 release_and_free_resource(chip->res_port);
1634 release_and_free_resource(chip->res_cport); 1688 release_and_free_resource(chip->res_cport);
@@ -1651,6 +1705,7 @@ static int snd_wss_free(struct snd_wss *chip)
1651 kfree(chip); 1705 kfree(chip);
1652 return 0; 1706 return 0;
1653} 1707}
1708EXPORT_SYMBOL(snd_wss_free);
1654 1709
1655static int snd_wss_dev_free(struct snd_device *device) 1710static int snd_wss_dev_free(struct snd_device *device)
1656{ 1711{
@@ -1820,7 +1875,8 @@ int snd_wss_create(struct snd_card *card,
1820#if 0 1875#if 0
1821 if (chip->hardware & WSS_HW_CS4232_MASK) { 1876 if (chip->hardware & WSS_HW_CS4232_MASK) {
1822 if (chip->res_cport == NULL) 1877 if (chip->res_cport == NULL)
1823 snd_printk("CS4232 control port features are not accessible\n"); 1878 snd_printk(KERN_ERR "CS4232 control port features are "
1879 "not accessible\n");
1824 } 1880 }
1825#endif 1881#endif
1826 1882