aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 06:21:03 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-25 06:27:32 -0500
commit4e76a8833fac8dc1735aa5be7d1b3c92c65e209e (patch)
tree69978ef2eca15fcfc79e42e467be616262d1ff89 /sound/pci
parentb989d0444bd4999f9130d262b5ab7123d4077df8 (diff)
ALSA: hda - Replace with standard printk
Use dev_err() and co for messages from HD-audio controller and codec drivers. The codec drivers are mostly bound with codec objects, so some helper macros, codec_err(), codec_info(), etc, are provided. They merely wrap the corresponding dev_xxx(). There are a few places still calling snd_printk() and its variants as they are called without the codec or device context. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_auto_parser.c35
-rw-r--r--sound/pci/hda/hda_beep.c2
-rw-r--r--sound/pci/hda/hda_codec.c137
-rw-r--r--sound/pci/hda/hda_eld.c17
-rw-r--r--sound/pci/hda/hda_generic.c42
-rw-r--r--sound/pci/hda/hda_i915.c6
-rw-r--r--sound/pci/hda/hda_intel.c240
-rw-r--r--sound/pci/hda/hda_local.h7
-rw-r--r--sound/pci/hda/hda_sysfs.c6
-rw-r--r--sound/pci/hda/patch_ca0132.c208
-rw-r--r--sound/pci/hda/patch_cmedia.c2
-rw-r--r--sound/pci/hda/patch_conexant.c32
-rw-r--r--sound/pci/hda/patch_hdmi.c76
-rw-r--r--sound/pci/hda/patch_realtek.c50
-rw-r--r--sound/pci/hda/patch_si3054.c5
-rw-r--r--sound/pci/hda/patch_sigmatel.c12
-rw-r--r--sound/pci/hda/thinkpad_helper.c6
17 files changed, 434 insertions, 449 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 47ad31c6aa70..8de7cfa460b9 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -313,9 +313,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
313 } 313 }
314 314
315 if (hsmic) 315 if (hsmic)
316 snd_printdd("Told to look for a headset mic, but didn't find any.\n"); 316 codec_dbg(codec, "Told to look for a headset mic, but didn't find any.\n");
317 if (hpmic) 317 if (hpmic)
318 snd_printdd("Told to look for a headphone mic, but didn't find any.\n"); 318 codec_dbg(codec, "Told to look for a headphone mic, but didn't find any.\n");
319 } 319 }
320 320
321 /* FIX-UP: 321 /* FIX-UP:
@@ -384,33 +384,33 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
384 /* 384 /*
385 * debug prints of the parsed results 385 * debug prints of the parsed results
386 */ 386 */
387 snd_printd("autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n", 387 codec_info(codec, "autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n",
388 cfg->line_outs, cfg->line_out_pins[0], cfg->line_out_pins[1], 388 cfg->line_outs, cfg->line_out_pins[0], cfg->line_out_pins[1],
389 cfg->line_out_pins[2], cfg->line_out_pins[3], 389 cfg->line_out_pins[2], cfg->line_out_pins[3],
390 cfg->line_out_pins[4], 390 cfg->line_out_pins[4],
391 cfg->line_out_type == AUTO_PIN_HP_OUT ? "hp" : 391 cfg->line_out_type == AUTO_PIN_HP_OUT ? "hp" :
392 (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ? 392 (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ?
393 "speaker" : "line")); 393 "speaker" : "line"));
394 snd_printd(" speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n", 394 codec_info(codec, " speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
395 cfg->speaker_outs, cfg->speaker_pins[0], 395 cfg->speaker_outs, cfg->speaker_pins[0],
396 cfg->speaker_pins[1], cfg->speaker_pins[2], 396 cfg->speaker_pins[1], cfg->speaker_pins[2],
397 cfg->speaker_pins[3], cfg->speaker_pins[4]); 397 cfg->speaker_pins[3], cfg->speaker_pins[4]);
398 snd_printd(" hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n", 398 codec_info(codec, " hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
399 cfg->hp_outs, cfg->hp_pins[0], 399 cfg->hp_outs, cfg->hp_pins[0],
400 cfg->hp_pins[1], cfg->hp_pins[2], 400 cfg->hp_pins[1], cfg->hp_pins[2],
401 cfg->hp_pins[3], cfg->hp_pins[4]); 401 cfg->hp_pins[3], cfg->hp_pins[4]);
402 snd_printd(" mono: mono_out=0x%x\n", cfg->mono_out_pin); 402 codec_info(codec, " mono: mono_out=0x%x\n", cfg->mono_out_pin);
403 if (cfg->dig_outs) 403 if (cfg->dig_outs)
404 snd_printd(" dig-out=0x%x/0x%x\n", 404 codec_info(codec, " dig-out=0x%x/0x%x\n",
405 cfg->dig_out_pins[0], cfg->dig_out_pins[1]); 405 cfg->dig_out_pins[0], cfg->dig_out_pins[1]);
406 snd_printd(" inputs:\n"); 406 codec_info(codec, " inputs:\n");
407 for (i = 0; i < cfg->num_inputs; i++) { 407 for (i = 0; i < cfg->num_inputs; i++) {
408 snd_printd(" %s=0x%x\n", 408 codec_info(codec, " %s=0x%x\n",
409 hda_get_autocfg_input_label(codec, cfg, i), 409 hda_get_autocfg_input_label(codec, cfg, i),
410 cfg->inputs[i].pin); 410 cfg->inputs[i].pin);
411 } 411 }
412 if (cfg->dig_in_pin) 412 if (cfg->dig_in_pin)
413 snd_printd(" dig-in=0x%x\n", cfg->dig_in_pin); 413 codec_info(codec, " dig-in=0x%x\n", cfg->dig_in_pin);
414 414
415 return 0; 415 return 0;
416} 416}
@@ -774,38 +774,33 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
774 case HDA_FIXUP_PINS: 774 case HDA_FIXUP_PINS:
775 if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins) 775 if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins)
776 break; 776 break;
777 snd_printdd(KERN_INFO SFX 777 codec_dbg(codec, "%s: Apply pincfg for %s\n",
778 "%s: Apply pincfg for %s\n",
779 codec->chip_name, modelname); 778 codec->chip_name, modelname);
780 snd_hda_apply_pincfgs(codec, fix->v.pins); 779 snd_hda_apply_pincfgs(codec, fix->v.pins);
781 break; 780 break;
782 case HDA_FIXUP_VERBS: 781 case HDA_FIXUP_VERBS:
783 if (action != HDA_FIXUP_ACT_PROBE || !fix->v.verbs) 782 if (action != HDA_FIXUP_ACT_PROBE || !fix->v.verbs)
784 break; 783 break;
785 snd_printdd(KERN_INFO SFX 784 codec_dbg(codec, "%s: Apply fix-verbs for %s\n",
786 "%s: Apply fix-verbs for %s\n",
787 codec->chip_name, modelname); 785 codec->chip_name, modelname);
788 snd_hda_add_verbs(codec, fix->v.verbs); 786 snd_hda_add_verbs(codec, fix->v.verbs);
789 break; 787 break;
790 case HDA_FIXUP_FUNC: 788 case HDA_FIXUP_FUNC:
791 if (!fix->v.func) 789 if (!fix->v.func)
792 break; 790 break;
793 snd_printdd(KERN_INFO SFX 791 codec_dbg(codec, "%s: Apply fix-func for %s\n",
794 "%s: Apply fix-func for %s\n",
795 codec->chip_name, modelname); 792 codec->chip_name, modelname);
796 fix->v.func(codec, fix, action); 793 fix->v.func(codec, fix, action);
797 break; 794 break;
798 case HDA_FIXUP_PINCTLS: 795 case HDA_FIXUP_PINCTLS:
799 if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins) 796 if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins)
800 break; 797 break;
801 snd_printdd(KERN_INFO SFX 798 codec_dbg(codec, "%s: Apply pinctl for %s\n",
802 "%s: Apply pinctl for %s\n",
803 codec->chip_name, modelname); 799 codec->chip_name, modelname);
804 set_pin_targets(codec, fix->v.pins); 800 set_pin_targets(codec, fix->v.pins);
805 break; 801 break;
806 default: 802 default:
807 snd_printk(KERN_ERR SFX 803 codec_err(codec, "%s: Invalid fixup type %d\n",
808 "%s: Invalid fixup type %d\n",
809 codec->chip_name, fix->type); 804 codec->chip_name, fix->type);
810 break; 805 break;
811 } 806 }
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index d8c437a94559..d403981346d0 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -172,7 +172,7 @@ static int snd_hda_do_attach(struct hda_beep *beep)
172 err = input_register_device(input_dev); 172 err = input_register_device(input_dev);
173 if (err < 0) { 173 if (err < 0) {
174 input_free_device(input_dev); 174 input_free_device(input_dev);
175 printk(KERN_INFO "hda_beep: unable to register input device\n"); 175 codec_err(codec, "hda_beep: unable to register input device\n");
176 return err; 176 return err;
177 } 177 }
178 beep->dev = input_dev; 178 beep->dev = input_dev;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 2cba4dc6349a..6db2dbcbf4d3 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -201,7 +201,7 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int flags,
201 201
202 if ((codec->addr & ~0xf) || (nid & ~0x7f) || 202 if ((codec->addr & ~0xf) || (nid & ~0x7f) ||
203 (verb & ~0xfff) || (parm & ~0xffff)) { 203 (verb & ~0xfff) || (parm & ~0xffff)) {
204 printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x\n", 204 codec_err(codec, "hda-codec: out of range cmd %x:%x:%x:%x\n",
205 codec->addr, nid, verb, parm); 205 codec->addr, nid, verb, parm);
206 return ~0; 206 return ~0;
207 } 207 }
@@ -249,8 +249,8 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd,
249 snd_hda_power_down(codec); 249 snd_hda_power_down(codec);
250 if (!codec_in_pm(codec) && res && *res == -1 && bus->rirb_error) { 250 if (!codec_in_pm(codec) && res && *res == -1 && bus->rirb_error) {
251 if (bus->response_reset) { 251 if (bus->response_reset) {
252 snd_printd("hda_codec: resetting BUS due to " 252 codec_dbg(codec,
253 "fatal communication error\n"); 253 "resetting BUS due to fatal communication error\n");
254 trace_hda_bus_reset(bus); 254 trace_hda_bus_reset(bus);
255 bus->ops.bus_reset(bus); 255 bus->ops.bus_reset(bus);
256 } 256 }
@@ -475,8 +475,7 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
475 475
476 if (len > 0 && conn_list) { 476 if (len > 0 && conn_list) {
477 if (len > max_conns) { 477 if (len > max_conns) {
478 snd_printk(KERN_ERR "hda_codec: " 478 codec_err(codec, "Too many connections %d for NID 0x%x\n",
479 "Too many connections %d for NID 0x%x\n",
480 len, nid); 479 len, nid);
481 return -EINVAL; 480 return -EINVAL;
482 } 481 }
@@ -574,8 +573,8 @@ int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
574 range_val = !!(parm & (1 << (shift-1))); /* ranges */ 573 range_val = !!(parm & (1 << (shift-1))); /* ranges */
575 val = parm & mask; 574 val = parm & mask;
576 if (val == 0 && null_count++) { /* no second chance */ 575 if (val == 0 && null_count++) { /* no second chance */
577 snd_printdd("hda_codec: " 576 codec_dbg(codec,
578 "invalid CONNECT_LIST verb %x[%i]:%x\n", 577 "invalid CONNECT_LIST verb %x[%i]:%x\n",
579 nid, i, parm); 578 nid, i, parm);
580 return 0; 579 return 0;
581 } 580 }
@@ -583,7 +582,7 @@ int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
583 if (range_val) { 582 if (range_val) {
584 /* ranges between the previous and this one */ 583 /* ranges between the previous and this one */
585 if (!prev_nid || prev_nid >= val) { 584 if (!prev_nid || prev_nid >= val) {
586 snd_printk(KERN_WARNING "hda_codec: " 585 codec_warn(codec,
587 "invalid dep_range_val %x:%x\n", 586 "invalid dep_range_val %x:%x\n",
588 prev_nid, val); 587 prev_nid, val);
589 continue; 588 continue;
@@ -660,7 +659,7 @@ int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
660 if (!recursive) 659 if (!recursive)
661 return -1; 660 return -1;
662 if (recursive > 10) { 661 if (recursive > 10) {
663 snd_printd("hda_codec: too deep connection for 0x%x\n", nid); 662 codec_dbg(codec, "too deep connection for 0x%x\n", nid);
664 return -1; 663 return -1;
665 } 664 }
666 recursive++; 665 recursive++;
@@ -808,8 +807,7 @@ static int init_unsol_queue(struct hda_bus *bus)
808 807
809 unsol = kzalloc(sizeof(*unsol), GFP_KERNEL); 808 unsol = kzalloc(sizeof(*unsol), GFP_KERNEL);
810 if (!unsol) { 809 if (!unsol) {
811 snd_printk(KERN_ERR "hda_codec: " 810 dev_err(bus->card->dev, "can't allocate unsolicited queue\n");
812 "can't allocate unsolicited queue\n");
813 return -ENOMEM; 811 return -ENOMEM;
814 } 812 }
815 INIT_WORK(&unsol->work, process_unsol_events); 813 INIT_WORK(&unsol->work, process_unsol_events);
@@ -881,7 +879,7 @@ int snd_hda_bus_new(struct snd_card *card,
881 879
882 bus = kzalloc(sizeof(*bus), GFP_KERNEL); 880 bus = kzalloc(sizeof(*bus), GFP_KERNEL);
883 if (bus == NULL) { 881 if (bus == NULL) {
884 snd_printk(KERN_ERR "can't allocate struct hda_bus\n"); 882 dev_err(card->dev, "can't allocate struct hda_bus\n");
885 return -ENOMEM; 883 return -ENOMEM;
886 } 884 }
887 885
@@ -900,7 +898,7 @@ int snd_hda_bus_new(struct snd_card *card,
900 "hd-audio%d", card->number); 898 "hd-audio%d", card->number);
901 bus->workq = create_singlethread_workqueue(bus->workq_name); 899 bus->workq = create_singlethread_workqueue(bus->workq_name);
902 if (!bus->workq) { 900 if (!bus->workq) {
903 snd_printk(KERN_ERR "cannot create workqueue %s\n", 901 dev_err(card->dev, "cannot create workqueue %s\n",
904 bus->workq_name); 902 bus->workq_name);
905 kfree(bus); 903 kfree(bus);
906 return -ENOMEM; 904 return -ENOMEM;
@@ -944,7 +942,7 @@ find_codec_preset(struct hda_codec *codec)
944 mutex_lock(&preset_mutex); 942 mutex_lock(&preset_mutex);
945 list_for_each_entry(tbl, &hda_preset_tables, list) { 943 list_for_each_entry(tbl, &hda_preset_tables, list) {
946 if (!try_module_get(tbl->owner)) { 944 if (!try_module_get(tbl->owner)) {
947 snd_printk(KERN_ERR "hda_codec: cannot module_get\n"); 945 codec_err(codec, "cannot module_get\n");
948 continue; 946 continue;
949 } 947 }
950 for (preset = tbl->preset; preset->id; preset++) { 948 for (preset = tbl->preset; preset->id; preset++) {
@@ -1433,14 +1431,15 @@ int snd_hda_codec_new(struct hda_bus *bus,
1433 return -EINVAL; 1431 return -EINVAL;
1434 1432
1435 if (bus->caddr_tbl[codec_addr]) { 1433 if (bus->caddr_tbl[codec_addr]) {
1436 snd_printk(KERN_ERR "hda_codec: " 1434 dev_err(bus->card->dev,
1437 "address 0x%x is already occupied\n", codec_addr); 1435 "address 0x%x is already occupied\n",
1436 codec_addr);
1438 return -EBUSY; 1437 return -EBUSY;
1439 } 1438 }
1440 1439
1441 codec = kzalloc(sizeof(*codec), GFP_KERNEL); 1440 codec = kzalloc(sizeof(*codec), GFP_KERNEL);
1442 if (codec == NULL) { 1441 if (codec == NULL) {
1443 snd_printk(KERN_ERR "can't allocate struct hda_codec\n"); 1442 dev_err(bus->card->dev, "can't allocate struct hda_codec\n");
1444 return -ENOMEM; 1443 return -ENOMEM;
1445 } 1444 }
1446 1445
@@ -1513,7 +1512,7 @@ int snd_hda_codec_new(struct hda_bus *bus,
1513 1512
1514 setup_fg_nodes(codec); 1513 setup_fg_nodes(codec);
1515 if (!codec->afg && !codec->mfg) { 1514 if (!codec->afg && !codec->mfg) {
1516 snd_printdd("hda_codec: no AFG or MFG node found\n"); 1515 dev_err(bus->card->dev, "no AFG or MFG node found\n");
1517 err = -ENODEV; 1516 err = -ENODEV;
1518 goto error; 1517 goto error;
1519 } 1518 }
@@ -1521,7 +1520,7 @@ int snd_hda_codec_new(struct hda_bus *bus,
1521 fg = codec->afg ? codec->afg : codec->mfg; 1520 fg = codec->afg ? codec->afg : codec->mfg;
1522 err = read_widget_caps(codec, fg); 1521 err = read_widget_caps(codec, fg);
1523 if (err < 0) { 1522 if (err < 0) {
1524 snd_printk(KERN_ERR "hda_codec: cannot malloc\n"); 1523 dev_err(bus->card->dev, "cannot malloc\n");
1525 goto error; 1524 goto error;
1526 } 1525 }
1527 err = read_pin_defaults(codec); 1526 err = read_pin_defaults(codec);
@@ -1583,7 +1582,7 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec)
1583 fg = codec->afg ? codec->afg : codec->mfg; 1582 fg = codec->afg ? codec->afg : codec->mfg;
1584 err = read_widget_caps(codec, fg); 1583 err = read_widget_caps(codec, fg);
1585 if (err < 0) { 1584 if (err < 0) {
1586 snd_printk(KERN_ERR "hda_codec: cannot malloc\n"); 1585 codec_err(codec, "cannot malloc\n");
1587 return err; 1586 return err;
1588 } 1587 }
1589 1588
@@ -1660,7 +1659,7 @@ int snd_hda_codec_configure(struct hda_codec *codec)
1660#endif 1659#endif
1661 } 1660 }
1662 if (!patch) { 1661 if (!patch) {
1663 printk(KERN_ERR "hda-codec: No codec parser is available\n"); 1662 codec_err(codec, "No codec parser is available\n");
1664 return -ENODEV; 1663 return -ENODEV;
1665 } 1664 }
1666 } 1665 }
@@ -1744,9 +1743,9 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1744 if (!nid) 1743 if (!nid)
1745 return; 1744 return;
1746 1745
1747 snd_printdd("hda_codec_setup_stream: " 1746 codec_dbg(codec,
1748 "NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n", 1747 "hda_codec_setup_stream: NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n",
1749 nid, stream_tag, channel_id, format); 1748 nid, stream_tag, channel_id, format);
1750 p = get_hda_cvt_setup(codec, nid); 1749 p = get_hda_cvt_setup(codec, nid);
1751 if (!p) 1750 if (!p)
1752 return; 1751 return;
@@ -1793,7 +1792,7 @@ void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
1793 if (codec->no_sticky_stream) 1792 if (codec->no_sticky_stream)
1794 do_now = 1; 1793 do_now = 1;
1795 1794
1796 snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid); 1795 codec_dbg(codec, "hda_codec_cleanup_stream: NID=0x%x\n", nid);
1797 p = get_hda_cvt_setup(codec, nid); 1796 p = get_hda_cvt_setup(codec, nid);
1798 if (p) { 1797 if (p) {
1799 /* here we just clear the active flag when do_now isn't set; 1798 /* here we just clear the active flag when do_now isn't set;
@@ -2315,9 +2314,9 @@ int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
2315 uinfo->value.integer.min = 0; 2314 uinfo->value.integer.min = 0;
2316 uinfo->value.integer.max = get_amp_max_value(codec, nid, dir, ofs); 2315 uinfo->value.integer.max = get_amp_max_value(codec, nid, dir, ofs);
2317 if (!uinfo->value.integer.max) { 2316 if (!uinfo->value.integer.max) {
2318 printk(KERN_WARNING "hda_codec: " 2317 codec_warn(codec,
2319 "num_steps = 0 for NID=0x%x (ctl = %s)\n", nid, 2318 "num_steps = 0 for NID=0x%x (ctl = %s)\n",
2320 kcontrol->id.name); 2319 nid, kcontrol->id.name);
2321 return -EINVAL; 2320 return -EINVAL;
2322 } 2321 }
2323 return 0; 2322 return 0;
@@ -2591,8 +2590,8 @@ int snd_hda_add_nid(struct hda_codec *codec, struct snd_kcontrol *kctl,
2591 item->nid = nid; 2590 item->nid = nid;
2592 return 0; 2591 return 0;
2593 } 2592 }
2594 printk(KERN_ERR "hda-codec: no NID for mapping control %s:%d:%d\n", 2593 codec_err(codec, "no NID for mapping control %s:%d:%d\n",
2595 kctl->id.name, kctl->id.index, index); 2594 kctl->id.name, kctl->id.index, index);
2596 return -EINVAL; 2595 return -EINVAL;
2597} 2596}
2598EXPORT_SYMBOL_GPL(snd_hda_add_nid); 2597EXPORT_SYMBOL_GPL(snd_hda_add_nid);
@@ -2784,7 +2783,7 @@ static int get_kctl_0dB_offset(struct snd_kcontrol *kctl, int *step_to_check)
2784 return -1; 2783 return -1;
2785 if (*step_to_check && *step_to_check != step) { 2784 if (*step_to_check && *step_to_check != step) {
2786 snd_printk(KERN_ERR "hda_codec: Mismatching dB step for vmaster slave (%d!=%d)\n", 2785 snd_printk(KERN_ERR "hda_codec: Mismatching dB step for vmaster slave (%d!=%d)\n",
2787 *step_to_check, step); 2786- *step_to_check, step);
2788 return -1; 2787 return -1;
2789 } 2788 }
2790 *step_to_check = step; 2789 *step_to_check = step;
@@ -2854,7 +2853,7 @@ int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
2854 2853
2855 err = map_slaves(codec, slaves, suffix, check_slave_present, NULL); 2854 err = map_slaves(codec, slaves, suffix, check_slave_present, NULL);
2856 if (err != 1) { 2855 if (err != 1) {
2857 snd_printdd("No slave found for %s\n", name); 2856 codec_dbg(codec, "No slave found for %s\n", name);
2858 return 0; 2857 return 0;
2859 } 2858 }
2860 kctl = snd_ctl_make_virtual_master(name, tlv); 2859 kctl = snd_ctl_make_virtual_master(name, tlv);
@@ -3520,7 +3519,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
3520 3519
3521 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch", idx); 3520 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch", idx);
3522 if (idx < 0) { 3521 if (idx < 0) {
3523 printk(KERN_ERR "hda_codec: too many IEC958 outputs\n"); 3522 codec_err(codec, "too many IEC958 outputs\n");
3524 return -EBUSY; 3523 return -EBUSY;
3525 } 3524 }
3526 spdif = snd_array_new(&codec->spdif_out); 3525 spdif = snd_array_new(&codec->spdif_out);
@@ -3724,7 +3723,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
3724 3723
3725 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0); 3724 idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0);
3726 if (idx < 0) { 3725 if (idx < 0) {
3727 printk(KERN_ERR "hda_codec: too many IEC958 inputs\n"); 3726 codec_err(codec, "too many IEC958 inputs\n");
3728 return -EBUSY; 3727 return -EBUSY;
3729 } 3728 }
3730 for (dig_mix = dig_in_ctls; dig_mix->name; dig_mix++) { 3729 for (dig_mix = dig_in_ctls; dig_mix->name; dig_mix++) {
@@ -4151,12 +4150,13 @@ int snd_hda_build_controls(struct hda_bus *bus)
4151 list_for_each_entry(codec, &bus->codec_list, list) { 4150 list_for_each_entry(codec, &bus->codec_list, list) {
4152 int err = snd_hda_codec_build_controls(codec); 4151 int err = snd_hda_codec_build_controls(codec);
4153 if (err < 0) { 4152 if (err < 0) {
4154 printk(KERN_ERR "hda_codec: cannot build controls " 4153 codec_err(codec,
4155 "for #%d (error %d)\n", codec->addr, err); 4154 "cannot build controls for #%d (error %d)\n",
4155 codec->addr, err);
4156 err = snd_hda_codec_reset(codec); 4156 err = snd_hda_codec_reset(codec);
4157 if (err < 0) { 4157 if (err < 0) {
4158 printk(KERN_ERR 4158 codec_err(codec,
4159 "hda_codec: cannot revert codec\n"); 4159 "cannot revert codec\n");
4160 return err; 4160 return err;
4161 } 4161 }
4162 } 4162 }
@@ -4327,7 +4327,7 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
4327 break; 4327 break;
4328 default: 4328 default:
4329 snd_printdd("invalid format width %d\n", 4329 snd_printdd("invalid format width %d\n",
4330 snd_pcm_format_width(format)); 4330 snd_pcm_format_width(format));
4331 return 0; 4331 return 0;
4332 } 4332 }
4333 4333
@@ -4403,10 +4403,10 @@ int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid,
4403 rates |= rate_bits[i].alsa_bits; 4403 rates |= rate_bits[i].alsa_bits;
4404 } 4404 }
4405 if (rates == 0) { 4405 if (rates == 0) {
4406 snd_printk(KERN_ERR "hda_codec: rates == 0 " 4406 codec_err(codec,
4407 "(nid=0x%x, val=0x%x, ovrd=%i)\n", 4407 "rates == 0 (nid=0x%x, val=0x%x, ovrd=%i)\n",
4408 nid, val, 4408 nid, val,
4409 (wcaps & AC_WCAP_FORMAT_OVRD) ? 1 : 0); 4409 (wcaps & AC_WCAP_FORMAT_OVRD) ? 1 : 0);
4410 return -EIO; 4410 return -EIO;
4411 } 4411 }
4412 *ratesp = rates; 4412 *ratesp = rates;
@@ -4466,12 +4466,11 @@ int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid,
4466 bps = 8; 4466 bps = 8;
4467 } 4467 }
4468 if (formats == 0) { 4468 if (formats == 0) {
4469 snd_printk(KERN_ERR "hda_codec: formats == 0 " 4469 codec_err(codec,
4470 "(nid=0x%x, val=0x%x, ovrd=%i, " 4470 "formats == 0 (nid=0x%x, val=0x%x, ovrd=%i, streams=0x%x)\n",
4471 "streams=0x%x)\n", 4471 nid, val,
4472 nid, val, 4472 (wcaps & AC_WCAP_FORMAT_OVRD) ? 1 : 0,
4473 (wcaps & AC_WCAP_FORMAT_OVRD) ? 1 : 0, 4473 streams);
4474 streams);
4475 return -EIO; 4474 return -EIO;
4476 } 4475 }
4477 if (formatsp) 4476 if (formatsp)
@@ -4662,7 +4661,7 @@ static int get_empty_pcm_device(struct hda_bus *bus, unsigned int type)
4662 int i; 4661 int i;
4663 4662
4664 if (type >= HDA_PCM_NTYPES) { 4663 if (type >= HDA_PCM_NTYPES) {
4665 snd_printk(KERN_WARNING "Invalid PCM type %d\n", type); 4664 dev_err(bus->card->dev, "Invalid PCM type %d\n", type);
4666 return -EINVAL; 4665 return -EINVAL;
4667 } 4666 }
4668 4667
@@ -4683,10 +4682,11 @@ static int get_empty_pcm_device(struct hda_bus *bus, unsigned int type)
4683 } 4682 }
4684#endif 4683#endif
4685 4684
4686 snd_printk(KERN_WARNING "Too many %s devices\n", 4685 dev_warn(bus->card->dev, "Too many %s devices\n",
4687 snd_hda_pcm_type_name[type]); 4686 snd_hda_pcm_type_name[type]);
4688#ifndef CONFIG_SND_DYNAMIC_MINORS 4687#ifndef CONFIG_SND_DYNAMIC_MINORS
4689 snd_printk(KERN_WARNING "Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y\n"); 4688 dev_warn(bus->card->dev,
4689 "Consider building the kernel with CONFIG_SND_DYNAMIC_MINORS=y\n");
4690#endif 4690#endif
4691 return -EAGAIN; 4691 return -EAGAIN;
4692} 4692}
@@ -4724,12 +4724,13 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec)
4724 return 0; 4724 return 0;
4725 err = codec->patch_ops.build_pcms(codec); 4725 err = codec->patch_ops.build_pcms(codec);
4726 if (err < 0) { 4726 if (err < 0) {
4727 printk(KERN_ERR "hda_codec: cannot build PCMs" 4727 codec_err(codec,
4728 "for #%d (error %d)\n", codec->addr, err); 4728 "cannot build PCMs for #%d (error %d)\n",
4729 codec->addr, err);
4729 err = snd_hda_codec_reset(codec); 4730 err = snd_hda_codec_reset(codec);
4730 if (err < 0) { 4731 if (err < 0) {
4731 printk(KERN_ERR 4732 codec_err(codec,
4732 "hda_codec: cannot revert codec\n"); 4733 "cannot revert codec\n");
4733 return err; 4734 return err;
4734 } 4735 }
4735 } 4736 }
@@ -4748,9 +4749,9 @@ int snd_hda_codec_build_pcms(struct hda_codec *codec)
4748 cpcm->device = dev; 4749 cpcm->device = dev;
4749 err = snd_hda_attach_pcm(codec, cpcm); 4750 err = snd_hda_attach_pcm(codec, cpcm);
4750 if (err < 0) { 4751 if (err < 0) {
4751 printk(KERN_ERR "hda_codec: cannot attach " 4752 codec_err(codec,
4752 "PCM stream %d for codec #%d\n", 4753 "cannot attach PCM stream %d for codec #%d\n",
4753 dev, codec->addr); 4754 dev, codec->addr);
4754 continue; /* no fatal error */ 4755 continue; /* no fatal error */
4755 } 4756 }
4756 } 4757 }
@@ -4819,8 +4820,8 @@ int snd_hda_check_board_config(struct hda_codec *codec,
4819 for (i = 0; i < num_configs; i++) { 4820 for (i = 0; i < num_configs; i++) {
4820 if (models[i] && 4821 if (models[i] &&
4821 !strcmp(codec->modelname, models[i])) { 4822 !strcmp(codec->modelname, models[i])) {
4822 snd_printd(KERN_INFO "hda_codec: model '%s' is " 4823 codec_info(codec, "model '%s' is selected\n",
4823 "selected\n", models[i]); 4824 models[i]);
4824 return i; 4825 return i;
4825 } 4826 }
4826 } 4827 }
@@ -4842,10 +4843,9 @@ int snd_hda_check_board_config(struct hda_codec *codec,
4842 sprintf(tmp, "#%d", tbl->value); 4843 sprintf(tmp, "#%d", tbl->value);
4843 model = tmp; 4844 model = tmp;
4844 } 4845 }
4845 snd_printdd(KERN_INFO "hda_codec: model '%s' is selected " 4846 codec_info(codec, "model '%s' is selected for config %x:%x (%s)\n",
4846 "for config %x:%x (%s)\n", 4847 model, tbl->subvendor, tbl->subdevice,
4847 model, tbl->subvendor, tbl->subdevice, 4848 (tbl->name ? tbl->name : "Unknown device"));
4848 (tbl->name ? tbl->name : "Unknown device"));
4849#endif 4849#endif
4850 return tbl->value; 4850 return tbl->value;
4851 } 4851 }
@@ -4903,10 +4903,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
4903 sprintf(tmp, "#%d", tbl->value); 4903 sprintf(tmp, "#%d", tbl->value);
4904 model = tmp; 4904 model = tmp;
4905 } 4905 }
4906 snd_printdd(KERN_INFO "hda_codec: model '%s' is selected " 4906 codec_info(codec, "model '%s' is selected for config %x:%x (%s)\n",
4907 "for config %x:%x (%s)\n", 4907 model, tbl->subvendor, tbl->subdevice,
4908 model, tbl->subvendor, tbl->subdevice, 4908 (tbl->name ? tbl->name : "Unknown device"));
4909 (tbl->name ? tbl->name : "Unknown device"));
4910#endif 4909#endif
4911 return tbl->value; 4910 return tbl->value;
4912 } 4911 }
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 79ca80f6c77a..46690a7f48f6 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -153,7 +153,7 @@ static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid,
153 val = snd_hda_codec_read(codec, nid, 0, 153 val = snd_hda_codec_read(codec, nid, 0,
154 AC_VERB_GET_HDMI_ELDD, byte_index); 154 AC_VERB_GET_HDMI_ELDD, byte_index);
155#ifdef BE_PARANOID 155#ifdef BE_PARANOID
156 printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); 156 codec_info(codec, "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
157#endif 157#endif
158 return val; 158 return val;
159} 159}
@@ -332,11 +332,11 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
332 size = snd_hdmi_get_eld_size(codec, nid); 332 size = snd_hdmi_get_eld_size(codec, nid);
333 if (size == 0) { 333 if (size == 0) {
334 /* wfg: workaround for ASUS P5E-VM HDMI board */ 334 /* wfg: workaround for ASUS P5E-VM HDMI board */
335 snd_printd(KERN_INFO "HDMI: ELD buf size is 0, force 128\n"); 335 codec_info(codec, "HDMI: ELD buf size is 0, force 128\n");
336 size = 128; 336 size = 128;
337 } 337 }
338 if (size < ELD_FIXED_BYTES || size > ELD_MAX_SIZE) { 338 if (size < ELD_FIXED_BYTES || size > ELD_MAX_SIZE) {
339 snd_printd(KERN_INFO "HDMI: invalid ELD buf size %d\n", size); 339 codec_info(codec, "HDMI: invalid ELD buf size %d\n", size);
340 return -ERANGE; 340 return -ERANGE;
341 } 341 }
342 342
@@ -348,8 +348,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
348 * Just abort. The caller will repoll after a while. 348 * Just abort. The caller will repoll after a while.
349 */ 349 */
350 if (!(val & AC_ELDD_ELD_VALID)) { 350 if (!(val & AC_ELDD_ELD_VALID)) {
351 snd_printd(KERN_INFO 351 codec_info(codec, "HDMI: invalid ELD data byte %d\n", i);
352 "HDMI: invalid ELD data byte %d\n", i);
353 ret = -EINVAL; 352 ret = -EINVAL;
354 goto error; 353 goto error;
355 } 354 }
@@ -361,7 +360,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
361 * correctly writes ELD content before setting ELD_valid bit. 360 * correctly writes ELD content before setting ELD_valid bit.
362 */ 361 */
363 if (!val && !i) { 362 if (!val && !i) {
364 snd_printdd(KERN_INFO "HDMI: 0 ELD data\n"); 363 codec_dbg(codec, "HDMI: 0 ELD data\n");
365 ret = -EINVAL; 364 ret = -EINVAL;
366 goto error; 365 goto error;
367 } 366 }
@@ -681,7 +680,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
681 spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0); 680 spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0);
682 681
683 if (spkalloc <= 0) { 682 if (spkalloc <= 0) {
684 snd_printd(KERN_INFO "HDMI ATI/AMD: no speaker allocation for ELD\n"); 683 codec_info(codec, "HDMI ATI/AMD: no speaker allocation for ELD\n");
685 return -EINVAL; 684 return -EINVAL;
686 } 685 }
687 686
@@ -722,7 +721,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
722 sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); 721 sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
723 722
724 if (sink_desc_len > ELD_MAX_MNL) { 723 if (sink_desc_len > ELD_MAX_MNL) {
725 snd_printd(KERN_INFO "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n", 724 codec_info(codec, "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n",
726 sink_desc_len); 725 sink_desc_len);
727 sink_desc_len = ELD_MAX_MNL; 726 sink_desc_len = ELD_MAX_MNL;
728 } 727 }
@@ -764,7 +763,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
764 } 763 }
765 764
766 if (pos == ELD_FIXED_BYTES + sink_desc_len) { 765 if (pos == ELD_FIXED_BYTES + sink_desc_len) {
767 snd_printd(KERN_INFO "HDMI ATI/AMD: no audio descriptors for ELD\n"); 766 codec_info(codec, "HDMI ATI/AMD: no audio descriptors for ELD\n");
768 return -EINVAL; 767 return -EINVAL;
769 } 768 }
770 769
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index bcd9c712356f..9e0609a4b2ba 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -346,7 +346,8 @@ static bool is_ctl_associated(struct hda_codec *codec, hda_nid_t nid,
346 return is_ctl_used(codec, val, type); 346 return is_ctl_used(codec, val, type);
347} 347}
348 348
349static void print_nid_path(const char *pfx, struct nid_path *path) 349static void print_nid_path(struct hda_codec *codec,
350 const char *pfx, struct nid_path *path)
350{ 351{
351 char buf[40]; 352 char buf[40];
352 int i; 353 int i;
@@ -358,7 +359,7 @@ static void print_nid_path(const char *pfx, struct nid_path *path)
358 sprintf(tmp, ":%02x", path->path[i]); 359 sprintf(tmp, ":%02x", path->path[i]);
359 strlcat(buf, tmp, sizeof(buf)); 360 strlcat(buf, tmp, sizeof(buf));
360 } 361 }
361 snd_printdd("%s path: depth=%d %s\n", pfx, path->depth, buf); 362 codec_dbg(codec, "%s path: depth=%d %s\n", pfx, path->depth, buf);
362} 363}
363 364
364/* called recursively */ 365/* called recursively */
@@ -1260,7 +1261,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
1260 dac = dacs[i] = 0; 1261 dac = dacs[i] = 0;
1261 badness += bad->no_dac; 1262 badness += bad->no_dac;
1262 } else { 1263 } else {
1263 /* print_nid_path("output", path); */ 1264 /* print_nid_path(codec, "output", path); */
1264 path->active = true; 1265 path->active = true;
1265 path_idx[i] = snd_hda_get_path_idx(codec, path); 1266 path_idx[i] = snd_hda_get_path_idx(codec, path);
1266 badness += assign_out_path_ctls(codec, path); 1267 badness += assign_out_path_ctls(codec, path);
@@ -1387,7 +1388,7 @@ static int fill_multi_ios(struct hda_codec *codec,
1387 badness++; 1388 badness++;
1388 continue; 1389 continue;
1389 } 1390 }
1390 /* print_nid_path("multiio", path); */ 1391 /* print_nid_path(codec, "multiio", path); */
1391 spec->multi_io[spec->multi_ios].pin = nid; 1392 spec->multi_io[spec->multi_ios].pin = nid;
1392 spec->multi_io[spec->multi_ios].dac = dac; 1393 spec->multi_io[spec->multi_ios].dac = dac;
1393 spec->out_paths[cfg->line_outs + spec->multi_ios] = 1394 spec->out_paths[cfg->line_outs + spec->multi_ios] =
@@ -1444,7 +1445,7 @@ static bool map_singles(struct hda_codec *codec, int outs,
1444 if (path) { 1445 if (path) {
1445 dacs[i] = dac; 1446 dacs[i] = dac;
1446 found = true; 1447 found = true;
1447 /* print_nid_path("output", path); */ 1448 /* print_nid_path(codec, "output", path); */
1448 path->active = true; 1449 path->active = true;
1449 path_idx[i] = snd_hda_get_path_idx(codec, path); 1450 path_idx[i] = snd_hda_get_path_idx(codec, path);
1450 } 1451 }
@@ -1482,7 +1483,7 @@ static int check_aamix_out_path(struct hda_codec *codec, int path_idx)
1482 } 1483 }
1483 if (!path) 1484 if (!path)
1484 return 0; 1485 return 0;
1485 /* print_nid_path("output-aamix", path); */ 1486 /* print_nid_path(codec, "output-aamix", path); */
1486 path->active = false; /* unused as default */ 1487 path->active = false; /* unused as default */
1487 return snd_hda_get_path_idx(codec, path); 1488 return snd_hda_get_path_idx(codec, path);
1488} 1489}
@@ -1699,7 +1700,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
1699#define DEBUG_BADNESS 1700#define DEBUG_BADNESS
1700 1701
1701#ifdef DEBUG_BADNESS 1702#ifdef DEBUG_BADNESS
1702#define debug_badness snd_printdd 1703#define debug_badness(fmt, args...) codec_dbg(codec, fmt, ##args)
1703#else 1704#else
1704#define debug_badness(...) 1705#define debug_badness(...)
1705#endif 1706#endif
@@ -1712,7 +1713,7 @@ static inline void print_nid_path_idx(struct hda_codec *codec,
1712 1713
1713 path = snd_hda_get_path_from_idx(codec, idx); 1714 path = snd_hda_get_path_from_idx(codec, idx);
1714 if (path) 1715 if (path)
1715 print_nid_path(pfx, path); 1716 print_nid_path(codec, pfx, path);
1716} 1717}
1717 1718
1718static void debug_show_configs(struct hda_codec *codec, 1719static void debug_show_configs(struct hda_codec *codec,
@@ -1780,7 +1781,7 @@ static void fill_all_dac_nids(struct hda_codec *codec)
1780 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_AUD_OUT) 1781 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_AUD_OUT)
1781 continue; 1782 continue;
1782 if (spec->num_all_dacs >= ARRAY_SIZE(spec->all_dacs)) { 1783 if (spec->num_all_dacs >= ARRAY_SIZE(spec->all_dacs)) {
1783 snd_printk(KERN_ERR "hda: Too many DACs!\n"); 1784 codec_err(codec, "Too many DACs!\n");
1784 break; 1785 break;
1785 } 1786 }
1786 spec->all_dacs[spec->num_all_dacs++] = nid; 1787 spec->all_dacs[spec->num_all_dacs++] = nid;
@@ -2429,7 +2430,7 @@ static int create_hp_mic(struct hda_codec *codec)
2429 spec->hp_mic_pin = nid; 2430 spec->hp_mic_pin = nid;
2430 /* we can't handle auto-mic together with HP-mic */ 2431 /* we can't handle auto-mic together with HP-mic */
2431 spec->suppress_auto_mic = 1; 2432 spec->suppress_auto_mic = 1;
2432 snd_printdd("hda-codec: Enable shared I/O jack on NID 0x%x\n", nid); 2433 codec_dbg(codec, "Enable shared I/O jack on NID 0x%x\n", nid);
2433 return 0; 2434 return 0;
2434} 2435}
2435 2436
@@ -2883,7 +2884,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
2883 path = snd_hda_add_new_path(codec, pin, mix_nid, 0); 2884 path = snd_hda_add_new_path(codec, pin, mix_nid, 0);
2884 if (!path) 2885 if (!path)
2885 return -EINVAL; 2886 return -EINVAL;
2886 print_nid_path("loopback", path); 2887 print_nid_path(codec, "loopback", path);
2887 spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path); 2888 spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path);
2888 2889
2889 idx = path->idx[path->depth - 1]; 2890 idx = path->idx[path->depth - 1];
@@ -2911,7 +2912,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
2911 path = snd_hda_add_new_path(codec, spec->mixer_nid, 2912 path = snd_hda_add_new_path(codec, spec->mixer_nid,
2912 spec->mixer_merge_nid, 0); 2913 spec->mixer_merge_nid, 0);
2913 if (path) { 2914 if (path) {
2914 print_nid_path("loopback-merge", path); 2915 print_nid_path(codec, "loopback-merge", path);
2915 path->active = true; 2916 path->active = true;
2916 spec->loopback_merge_path = 2917 spec->loopback_merge_path =
2917 snd_hda_get_path_idx(codec, path); 2918 snd_hda_get_path_idx(codec, path);
@@ -2990,7 +2991,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
2990 } 2991 }
2991 } 2992 }
2992 2993
2993 snd_printdd("hda-codec: enabling ADC switching\n"); 2994 codec_dbg(codec, "enabling ADC switching\n");
2994 spec->dyn_adc_switch = 1; 2995 spec->dyn_adc_switch = 1;
2995 } else if (nums != spec->num_adc_nids) { 2996 } else if (nums != spec->num_adc_nids) {
2996 /* shrink the invalid adcs and input paths */ 2997 /* shrink the invalid adcs and input paths */
@@ -3014,7 +3015,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
3014 3015
3015 if (imux->num_items == 1 || 3016 if (imux->num_items == 1 ||
3016 (imux->num_items == 2 && spec->hp_mic)) { 3017 (imux->num_items == 2 && spec->hp_mic)) {
3017 snd_printdd("hda-codec: reducing to a single ADC\n"); 3018 codec_dbg(codec, "reducing to a single ADC\n");
3018 spec->num_adc_nids = 1; /* reduce to a single ADC */ 3019 spec->num_adc_nids = 1; /* reduce to a single ADC */
3019 } 3020 }
3020 3021
@@ -3045,7 +3046,7 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
3045 path = snd_hda_add_new_path(codec, pin, adc, anchor); 3046 path = snd_hda_add_new_path(codec, pin, adc, anchor);
3046 if (!path) 3047 if (!path)
3047 continue; 3048 continue;
3048 print_nid_path("input", path); 3049 print_nid_path(codec, "input", path);
3049 spec->input_paths[imux_idx][c] = 3050 spec->input_paths[imux_idx][c] =
3050 snd_hda_get_path_idx(codec, path); 3051 snd_hda_get_path_idx(codec, path);
3051 3052
@@ -3711,7 +3712,7 @@ static void parse_digital(struct hda_codec *codec)
3711 path = snd_hda_add_new_path(codec, dig_nid, pin, 0); 3712 path = snd_hda_add_new_path(codec, dig_nid, pin, 0);
3712 if (!path) 3713 if (!path)
3713 continue; 3714 continue;
3714 print_nid_path("digout", path); 3715 print_nid_path(codec, "digout", path);
3715 path->active = true; 3716 path->active = true;
3716 spec->digout_paths[i] = snd_hda_get_path_idx(codec, path); 3717 spec->digout_paths[i] = snd_hda_get_path_idx(codec, path);
3717 set_pin_target(codec, pin, PIN_OUT, false); 3718 set_pin_target(codec, pin, PIN_OUT, false);
@@ -3738,7 +3739,7 @@ static void parse_digital(struct hda_codec *codec)
3738 continue; 3739 continue;
3739 path = snd_hda_add_new_path(codec, pin, dig_nid, 0); 3740 path = snd_hda_add_new_path(codec, pin, dig_nid, 0);
3740 if (path) { 3741 if (path) {
3741 print_nid_path("digin", path); 3742 print_nid_path(codec, "digin", path);
3742 path->active = true; 3743 path->active = true;
3743 spec->dig_in_nid = dig_nid; 3744 spec->dig_in_nid = dig_nid;
3744 spec->digin_path = snd_hda_get_path_idx(codec, path); 3745 spec->digin_path = snd_hda_get_path_idx(codec, path);
@@ -4169,8 +4170,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4169 hda_nid_t nid = cfg->hp_pins[i]; 4170 hda_nid_t nid = cfg->hp_pins[i];
4170 if (!is_jack_detectable(codec, nid)) 4171 if (!is_jack_detectable(codec, nid))
4171 continue; 4172 continue;
4172 snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", 4173 codec_dbg(codec, "Enable HP auto-muting on NID 0x%x\n", nid);
4173 nid);
4174 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, 4174 snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT,
4175 call_hp_automute); 4175 call_hp_automute);
4176 spec->detect_hp = 1; 4176 spec->detect_hp = 1;
@@ -4182,7 +4182,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
4182 hda_nid_t nid = cfg->line_out_pins[i]; 4182 hda_nid_t nid = cfg->line_out_pins[i];
4183 if (!is_jack_detectable(codec, nid)) 4183 if (!is_jack_detectable(codec, nid))
4184 continue; 4184 continue;
4185 snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); 4185 codec_dbg(codec, "Enable Line-Out auto-muting on NID 0x%x\n", nid);
4186 snd_hda_jack_detect_enable_callback(codec, nid, 4186 snd_hda_jack_detect_enable_callback(codec, nid,
4187 HDA_GEN_FRONT_EVENT, 4187 HDA_GEN_FRONT_EVENT,
4188 call_line_automute); 4188 call_line_automute);
@@ -4302,7 +4302,7 @@ static int check_auto_mic_availability(struct hda_codec *codec)
4302 spec->auto_mic = 1; 4302 spec->auto_mic = 1;
4303 spec->num_adc_nids = 1; 4303 spec->num_adc_nids = 1;
4304 spec->cur_mux[0] = spec->am_entry[0].idx; 4304 spec->cur_mux[0] = spec->am_entry[0].idx;
4305 snd_printdd("hda-codec: Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n", 4305 codec_dbg(codec, "Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n",
4306 spec->am_entry[0].pin, 4306 spec->am_entry[0].pin,
4307 spec->am_entry[1].pin, 4307 spec->am_entry[1].pin,
4308 spec->am_entry[2].pin); 4308 spec->am_entry[2].pin);
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 76c13d5b3ca0..9d07e4edacdb 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -30,7 +30,7 @@ void hda_display_power(bool enable)
30 if (!get_power || !put_power) 30 if (!get_power || !put_power)
31 return; 31 return;
32 32
33 snd_printdd("HDA display power %s \n", 33 pr_debug("HDA display power %s \n",
34 enable ? "Enable" : "Disable"); 34 enable ? "Enable" : "Disable");
35 if (enable) 35 if (enable)
36 get_power(); 36 get_power();
@@ -44,7 +44,7 @@ int hda_i915_init(void)
44 44
45 get_power = symbol_request(i915_request_power_well); 45 get_power = symbol_request(i915_request_power_well);
46 if (!get_power) { 46 if (!get_power) {
47 snd_printk(KERN_WARNING "hda-i915: get_power symbol get fail\n"); 47 pr_warn("hda-i915: get_power symbol get fail\n");
48 return -ENODEV; 48 return -ENODEV;
49 } 49 }
50 50
@@ -55,7 +55,7 @@ int hda_i915_init(void)
55 return -ENODEV; 55 return -ENODEV;
56 } 56 }
57 57
58 snd_printd("HDA driver get symbol successfully from i915 module\n"); 58 pr_debug("HDA driver get symbol successfully from i915 module\n");
59 59
60 return err; 60 return err;
61} 61}
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 459f54da8d6b..6eb09418d08e 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -191,12 +191,6 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
191 "{ULI, M5461}}"); 191 "{ULI, M5461}}");
192MODULE_DESCRIPTION("Intel HDA driver"); 192MODULE_DESCRIPTION("Intel HDA driver");
193 193
194#ifdef CONFIG_SND_VERBOSE_PRINTK
195#define SFX /* nop */
196#else
197#define SFX "hda-intel "
198#endif
199
200#if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO) 194#if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO)
201#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) 195#if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI)
202#define SUPPORT_VGA_SWITCHEROO 196#define SUPPORT_VGA_SWITCHEROO
@@ -766,7 +760,7 @@ static int azx_alloc_cmd_io(struct azx *chip)
766 snd_dma_pci_data(chip->pci), 760 snd_dma_pci_data(chip->pci),
767 PAGE_SIZE, &chip->rb); 761 PAGE_SIZE, &chip->rb);
768 if (err < 0) { 762 if (err < 0) {
769 snd_printk(KERN_ERR SFX "%s: cannot allocate CORB/RIRB\n", pci_name(chip->pci)); 763 dev_err(chip->card->dev, "cannot allocate CORB/RIRB\n");
770 return err; 764 return err;
771 } 765 }
772 mark_pages_wc(chip, &chip->rb, true); 766 mark_pages_wc(chip, &chip->rb, true);
@@ -897,10 +891,9 @@ static void azx_update_rirb(struct azx *chip)
897 res = le32_to_cpu(chip->rirb.buf[rp]); 891 res = le32_to_cpu(chip->rirb.buf[rp]);
898 addr = res_ex & 0xf; 892 addr = res_ex & 0xf;
899 if ((addr >= AZX_MAX_CODECS) || !(chip->codec_mask & (1 << addr))) { 893 if ((addr >= AZX_MAX_CODECS) || !(chip->codec_mask & (1 << addr))) {
900 snd_printk(KERN_ERR SFX "%s: spurious response %#x:%#x, rp = %d, wp = %d", 894 dev_err(chip->card->dev, "spurious response %#x:%#x, rp = %d, wp = %d",
901 pci_name(chip->pci), 895 res, res_ex,
902 res, res_ex, 896 chip->rirb.rp, wp);
903 chip->rirb.rp, wp);
904 snd_BUG(); 897 snd_BUG();
905 } 898 }
906 else if (res_ex & ICH6_RIRB_EX_UNSOL_EV) 899 else if (res_ex & ICH6_RIRB_EX_UNSOL_EV)
@@ -910,10 +903,9 @@ static void azx_update_rirb(struct azx *chip)
910 smp_wmb(); 903 smp_wmb();
911 chip->rirb.cmds[addr]--; 904 chip->rirb.cmds[addr]--;
912 } else if (printk_ratelimit()) { 905 } else if (printk_ratelimit()) {
913 snd_printk(KERN_ERR SFX "%s: spurious response %#x:%#x, last cmd=%#08x\n", 906 dev_err(chip->card->dev, "spurious response %#x:%#x, last cmd=%#08x\n",
914 pci_name(chip->pci), 907 res, res_ex,
915 res, res_ex, 908 chip->last_cmd[addr]);
916 chip->last_cmd[addr]);
917 } 909 }
918 } 910 }
919} 911}
@@ -958,9 +950,9 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
958 return -1; 950 return -1;
959 951
960 if (!chip->polling_mode && chip->poll_count < 2) { 952 if (!chip->polling_mode && chip->poll_count < 2) {
961 snd_printdd(SFX "%s: azx_get_response timeout, " 953 dev_dbg(chip->card->dev,
962 "polling the codec once: last cmd=0x%08x\n", 954 "azx_get_response timeout, polling the codec once: last cmd=0x%08x\n",
963 pci_name(chip->pci), chip->last_cmd[addr]); 955 chip->last_cmd[addr]);
964 do_poll = 1; 956 do_poll = 1;
965 chip->poll_count++; 957 chip->poll_count++;
966 goto again; 958 goto again;
@@ -968,17 +960,17 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
968 960
969 961
970 if (!chip->polling_mode) { 962 if (!chip->polling_mode) {
971 snd_printk(KERN_WARNING SFX "%s: azx_get_response timeout, " 963 dev_warn(chip->card->dev,
972 "switching to polling mode: last cmd=0x%08x\n", 964 "azx_get_response timeout, switching to polling mode: last cmd=0x%08x\n",
973 pci_name(chip->pci), chip->last_cmd[addr]); 965 chip->last_cmd[addr]);
974 chip->polling_mode = 1; 966 chip->polling_mode = 1;
975 goto again; 967 goto again;
976 } 968 }
977 969
978 if (chip->msi) { 970 if (chip->msi) {
979 snd_printk(KERN_WARNING SFX "%s: No response from codec, " 971 dev_warn(chip->card->dev,
980 "disabling MSI: last cmd=0x%08x\n", 972 "No response from codec, disabling MSI: last cmd=0x%08x\n",
981 pci_name(chip->pci), chip->last_cmd[addr]); 973 chip->last_cmd[addr]);
982 free_irq(chip->irq, chip); 974 free_irq(chip->irq, chip);
983 chip->irq = -1; 975 chip->irq = -1;
984 pci_disable_msi(chip->pci); 976 pci_disable_msi(chip->pci);
@@ -1007,9 +999,9 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
1007 return -1; /* give a chance to retry */ 999 return -1; /* give a chance to retry */
1008 } 1000 }
1009 1001
1010 snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " 1002 dev_err(chip->card->dev,
1011 "switching to single_cmd mode: last cmd=0x%08x\n", 1003 "azx_get_response timeout, switching to single_cmd mode: last cmd=0x%08x\n",
1012 chip->last_cmd[addr]); 1004 chip->last_cmd[addr]);
1013 chip->single_cmd = 1; 1005 chip->single_cmd = 1;
1014 bus->response_reset = 0; 1006 bus->response_reset = 0;
1015 /* release CORB/RIRB */ 1007 /* release CORB/RIRB */
@@ -1044,8 +1036,8 @@ static int azx_single_wait_for_response(struct azx *chip, unsigned int addr)
1044 udelay(1); 1036 udelay(1);
1045 } 1037 }
1046 if (printk_ratelimit()) 1038 if (printk_ratelimit())
1047 snd_printd(SFX "%s: get_response timeout: IRS=0x%x\n", 1039 dev_dbg(chip->card->dev, "get_response timeout: IRS=0x%x\n",
1048 pci_name(chip->pci), azx_readw(chip, IRS)); 1040 azx_readw(chip, IRS));
1049 chip->rirb.res[addr] = -1; 1041 chip->rirb.res[addr] = -1;
1050 return -EIO; 1042 return -EIO;
1051} 1043}
@@ -1072,8 +1064,9 @@ static int azx_single_send_cmd(struct hda_bus *bus, u32 val)
1072 udelay(1); 1064 udelay(1);
1073 } 1065 }
1074 if (printk_ratelimit()) 1066 if (printk_ratelimit())
1075 snd_printd(SFX "%s: send_cmd timeout: IRS=0x%x, val=0x%x\n", 1067 dev_dbg(chip->card->dev,
1076 pci_name(chip->pci), azx_readw(chip, IRS), val); 1068 "send_cmd timeout: IRS=0x%x, val=0x%x\n",
1069 azx_readw(chip, IRS), val);
1077 return -EIO; 1070 return -EIO;
1078} 1071}
1079 1072
@@ -1185,7 +1178,7 @@ static int azx_reset(struct azx *chip, int full_reset)
1185 __skip: 1178 __skip:
1186 /* check to see if controller is ready */ 1179 /* check to see if controller is ready */
1187 if (!azx_readb(chip, GCTL)) { 1180 if (!azx_readb(chip, GCTL)) {
1188 snd_printd(SFX "%s: azx_reset: controller not ready!\n", pci_name(chip->pci)); 1181 dev_dbg(chip->card->dev, "azx_reset: controller not ready!\n");
1189 return -EBUSY; 1182 return -EBUSY;
1190 } 1183 }
1191 1184
@@ -1197,7 +1190,8 @@ static int azx_reset(struct azx *chip, int full_reset)
1197 /* detect codecs */ 1190 /* detect codecs */
1198 if (!chip->codec_mask) { 1191 if (!chip->codec_mask) {
1199 chip->codec_mask = azx_readw(chip, STATESTS); 1192 chip->codec_mask = azx_readw(chip, STATESTS);
1200 snd_printdd(SFX "%s: codec_mask = 0x%x\n", pci_name(chip->pci), chip->codec_mask); 1193 dev_dbg(chip->card->dev, "codec_mask = 0x%x\n",
1194 chip->codec_mask);
1201 } 1195 }
1202 1196
1203 return 0; 1197 return 0;
@@ -1341,7 +1335,7 @@ static void azx_init_pci(struct azx *chip)
1341 * The PCI register TCSEL is defined in the Intel manuals. 1335 * The PCI register TCSEL is defined in the Intel manuals.
1342 */ 1336 */
1343 if (!(chip->driver_caps & AZX_DCAPS_NO_TCSEL)) { 1337 if (!(chip->driver_caps & AZX_DCAPS_NO_TCSEL)) {
1344 snd_printdd(SFX "%s: Clearing TCSEL\n", pci_name(chip->pci)); 1338 dev_dbg(chip->card->dev, "Clearing TCSEL\n");
1345 update_pci_byte(chip->pci, ICH6_PCIREG_TCSEL, 0x07, 0); 1339 update_pci_byte(chip->pci, ICH6_PCIREG_TCSEL, 0x07, 0);
1346 } 1340 }
1347 1341
@@ -1349,7 +1343,8 @@ static void azx_init_pci(struct azx *chip)
1349 * we need to enable snoop. 1343 * we need to enable snoop.
1350 */ 1344 */
1351 if (chip->driver_caps & AZX_DCAPS_ATI_SNOOP) { 1345 if (chip->driver_caps & AZX_DCAPS_ATI_SNOOP) {
1352 snd_printdd(SFX "%s: Setting ATI snoop: %d\n", pci_name(chip->pci), azx_snoop(chip)); 1346 dev_dbg(chip->card->dev, "Setting ATI snoop: %d\n",
1347 azx_snoop(chip));
1353 update_pci_byte(chip->pci, 1348 update_pci_byte(chip->pci,
1354 ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, 0x07, 1349 ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR, 0x07,
1355 azx_snoop(chip) ? ATI_SB450_HDAUDIO_ENABLE_SNOOP : 0); 1350 azx_snoop(chip) ? ATI_SB450_HDAUDIO_ENABLE_SNOOP : 0);
@@ -1357,7 +1352,8 @@ static void azx_init_pci(struct azx *chip)
1357 1352
1358 /* For NVIDIA HDA, enable snoop */ 1353 /* For NVIDIA HDA, enable snoop */
1359 if (chip->driver_caps & AZX_DCAPS_NVIDIA_SNOOP) { 1354 if (chip->driver_caps & AZX_DCAPS_NVIDIA_SNOOP) {
1360 snd_printdd(SFX "%s: Setting Nvidia snoop: %d\n", pci_name(chip->pci), azx_snoop(chip)); 1355 dev_dbg(chip->card->dev, "Setting Nvidia snoop: %d\n",
1356 azx_snoop(chip));
1361 update_pci_byte(chip->pci, 1357 update_pci_byte(chip->pci,
1362 NVIDIA_HDA_TRANSREG_ADDR, 1358 NVIDIA_HDA_TRANSREG_ADDR,
1363 0x0f, NVIDIA_HDA_ENABLE_COHBITS); 1359 0x0f, NVIDIA_HDA_ENABLE_COHBITS);
@@ -1382,9 +1378,9 @@ static void azx_init_pci(struct azx *chip)
1382 pci_read_config_word(chip->pci, 1378 pci_read_config_word(chip->pci,
1383 INTEL_SCH_HDA_DEVC, &snoop); 1379 INTEL_SCH_HDA_DEVC, &snoop);
1384 } 1380 }
1385 snd_printdd(SFX "%s: SCH snoop: %s\n", 1381 dev_dbg(chip->card->dev, "SCH snoop: %s\n",
1386 pci_name(chip->pci), (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) 1382 (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) ?
1387 ? "Disabled" : "Enabled"); 1383 "Disabled" : "Enabled");
1388 } 1384 }
1389} 1385}
1390 1386
@@ -1544,8 +1540,8 @@ static int azx_setup_periods(struct azx *chip,
1544 pos_align; 1540 pos_align;
1545 pos_adj = frames_to_bytes(runtime, pos_adj); 1541 pos_adj = frames_to_bytes(runtime, pos_adj);
1546 if (pos_adj >= period_bytes) { 1542 if (pos_adj >= period_bytes) {
1547 snd_printk(KERN_WARNING SFX "%s: Too big adjustment %d\n", 1543 dev_warn(chip->card->dev,"Too big adjustment %d\n",
1548 pci_name(chip->pci), bdl_pos_adj[chip->dev_index]); 1544 bdl_pos_adj[chip->dev_index]);
1549 pos_adj = 0; 1545 pos_adj = 0;
1550 } else { 1546 } else {
1551 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream), 1547 ofs = setup_bdle(chip, snd_pcm_get_dma_buf(substream),
@@ -1572,8 +1568,8 @@ static int azx_setup_periods(struct azx *chip,
1572 return 0; 1568 return 0;
1573 1569
1574 error: 1570 error:
1575 snd_printk(KERN_ERR SFX "%s: Too many BDL entries: buffer=%d, period=%d\n", 1571 dev_err(chip->card->dev, "Too many BDL entries: buffer=%d, period=%d\n",
1576 pci_name(chip->pci), azx_dev->bufsize, period_bytes); 1572 azx_dev->bufsize, period_bytes);
1577 return -EINVAL; 1573 return -EINVAL;
1578} 1574}
1579 1575
@@ -1670,7 +1666,7 @@ static int probe_codec(struct azx *chip, int addr)
1670 mutex_unlock(&chip->bus->cmd_mutex); 1666 mutex_unlock(&chip->bus->cmd_mutex);
1671 if (res == -1) 1667 if (res == -1)
1672 return -EIO; 1668 return -EIO;
1673 snd_printdd(SFX "%s: codec #%d probed OK\n", pci_name(chip->pci), addr); 1669 dev_dbg(chip->card->dev, "codec #%d probed OK\n", addr);
1674 return 0; 1670 return 0;
1675} 1671}
1676 1672
@@ -1708,8 +1704,8 @@ static int get_jackpoll_interval(struct azx *chip)
1708 else 1704 else
1709 j = msecs_to_jiffies(i); 1705 j = msecs_to_jiffies(i);
1710 if (j == 0) 1706 if (j == 0)
1711 snd_printk(KERN_WARNING SFX 1707 dev_warn(chip->card->dev,
1712 "jackpoll_ms value out of range: %d\n", i); 1708 "jackpoll_ms value out of range: %d\n", i);
1713 return j; 1709 return j;
1714} 1710}
1715 1711
@@ -1752,7 +1748,7 @@ static int azx_codec_create(struct azx *chip, const char *model)
1752 return err; 1748 return err;
1753 1749
1754 if (chip->driver_caps & AZX_DCAPS_RIRB_DELAY) { 1750 if (chip->driver_caps & AZX_DCAPS_RIRB_DELAY) {
1755 snd_printd(SFX "%s: Enable delay in RIRB handling\n", pci_name(chip->pci)); 1751 dev_dbg(chip->card->dev, "Enable delay in RIRB handling\n");
1756 chip->bus->needs_damn_long_delay = 1; 1752 chip->bus->needs_damn_long_delay = 1;
1757 } 1753 }
1758 1754
@@ -1768,9 +1764,8 @@ static int azx_codec_create(struct azx *chip, const char *model)
1768 /* Some BIOSen give you wrong codec addresses 1764 /* Some BIOSen give you wrong codec addresses
1769 * that don't exist 1765 * that don't exist
1770 */ 1766 */
1771 snd_printk(KERN_WARNING SFX 1767 dev_warn(chip->card->dev,
1772 "%s: Codec #%d probe error; " 1768 "Codec #%d probe error; disabling it...\n", c);
1773 "disabling it...\n", pci_name(chip->pci), c);
1774 chip->codec_mask &= ~(1 << c); 1769 chip->codec_mask &= ~(1 << c);
1775 /* More badly, accessing to a non-existing 1770 /* More badly, accessing to a non-existing
1776 * codec often screws up the controller chip, 1771 * codec often screws up the controller chip,
@@ -1790,8 +1785,7 @@ static int azx_codec_create(struct azx *chip, const char *model)
1790 * access works around the stall. Grrr... 1785 * access works around the stall. Grrr...
1791 */ 1786 */
1792 if (chip->driver_caps & AZX_DCAPS_SYNC_WRITE) { 1787 if (chip->driver_caps & AZX_DCAPS_SYNC_WRITE) {
1793 snd_printd(SFX "%s: Enable sync_write for stable communication\n", 1788 dev_dbg(chip->card->dev, "Enable sync_write for stable communication\n");
1794 pci_name(chip->pci));
1795 chip->bus->sync_write = 1; 1789 chip->bus->sync_write = 1;
1796 chip->bus->allow_bus_reset = 1; 1790 chip->bus->allow_bus_reset = 1;
1797 } 1791 }
@@ -1809,7 +1803,7 @@ static int azx_codec_create(struct azx *chip, const char *model)
1809 } 1803 }
1810 } 1804 }
1811 if (!codecs) { 1805 if (!codecs) {
1812 snd_printk(KERN_ERR SFX "%s: no codecs initialized\n", pci_name(chip->pci)); 1806 dev_err(chip->card->dev, "no codecs initialized\n");
1813 return -ENXIO; 1807 return -ENXIO;
1814 } 1808 }
1815 return 0; 1809 return 0;
@@ -2166,9 +2160,9 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
2166 hinfo->maxbps, 2160 hinfo->maxbps,
2167 ctls); 2161 ctls);
2168 if (!format_val) { 2162 if (!format_val) {
2169 snd_printk(KERN_ERR SFX 2163 dev_err(chip->card->dev,
2170 "%s: invalid format_val, rate=%d, ch=%d, format=%d\n", 2164 "invalid format_val, rate=%d, ch=%d, format=%d\n",
2171 pci_name(chip->pci), runtime->rate, runtime->channels, runtime->format); 2165 runtime->rate, runtime->channels, runtime->format);
2172 err = -EINVAL; 2166 err = -EINVAL;
2173 goto unlock; 2167 goto unlock;
2174 } 2168 }
@@ -2176,8 +2170,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
2176 bufsize = snd_pcm_lib_buffer_bytes(substream); 2170 bufsize = snd_pcm_lib_buffer_bytes(substream);
2177 period_bytes = snd_pcm_lib_period_bytes(substream); 2171 period_bytes = snd_pcm_lib_period_bytes(substream);
2178 2172
2179 snd_printdd(SFX "%s: azx_pcm_prepare: bufsize=0x%x, format=0x%x\n", 2173 dev_dbg(chip->card->dev, "azx_pcm_prepare: bufsize=0x%x, format=0x%x\n",
2180 pci_name(chip->pci), bufsize, format_val); 2174 bufsize, format_val);
2181 2175
2182 if (bufsize != azx_dev->bufsize || 2176 if (bufsize != azx_dev->bufsize ||
2183 period_bytes != azx_dev->period_bytes || 2177 period_bytes != azx_dev->period_bytes ||
@@ -2430,9 +2424,8 @@ static unsigned int azx_get_position(struct azx *chip,
2430 pos = le32_to_cpu(*azx_dev->posbuf); 2424 pos = le32_to_cpu(*azx_dev->posbuf);
2431 if (with_check && chip->position_fix[stream] == POS_FIX_AUTO) { 2425 if (with_check && chip->position_fix[stream] == POS_FIX_AUTO) {
2432 if (!pos || pos == (u32)-1) { 2426 if (!pos || pos == (u32)-1) {
2433 printk(KERN_WARNING 2427 dev_info(chip->card->dev,
2434 "hda-intel: Invalid position buffer, " 2428 "Invalid position buffer, using LPIB read method instead.\n");
2435 "using LPIB read method instead.\n");
2436 chip->position_fix[stream] = POS_FIX_LPIB; 2429 chip->position_fix[stream] = POS_FIX_LPIB;
2437 pos = azx_sd_readl(azx_dev, SD_LPIB); 2430 pos = azx_sd_readl(azx_dev, SD_LPIB);
2438 } else 2431 } else
@@ -2460,10 +2453,9 @@ static unsigned int azx_get_position(struct azx *chip,
2460 delay += azx_dev->bufsize; 2453 delay += azx_dev->bufsize;
2461 } 2454 }
2462 if (delay >= azx_dev->period_bytes) { 2455 if (delay >= azx_dev->period_bytes) {
2463 snd_printk(KERN_WARNING SFX 2456 dev_info(chip->card->dev,
2464 "%s: Unstable LPIB (%d >= %d); " 2457 "Unstable LPIB (%d >= %d); disabling LPIB delay counting\n",
2465 "disabling LPIB delay counting\n", 2458 delay, azx_dev->period_bytes);
2466 pci_name(chip->pci), delay, azx_dev->period_bytes);
2467 delay = 0; 2459 delay = 0;
2468 chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY; 2460 chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY;
2469 } 2461 }
@@ -2530,10 +2522,9 @@ static void azx_irq_pending_work(struct work_struct *work)
2530 int i, pending, ok; 2522 int i, pending, ok;
2531 2523
2532 if (!chip->irq_pending_warned) { 2524 if (!chip->irq_pending_warned) {
2533 printk(KERN_WARNING 2525 dev_info(chip->card->dev,
2534 "hda-intel: IRQ timing workaround is activated " 2526 "IRQ timing workaround is activated for card #%d. Suggest a bigger bdl_pos_adj.\n",
2535 "for card #%d. Suggest a bigger bdl_pos_adj.\n", 2527 chip->card->number);
2536 chip->card->number);
2537 chip->irq_pending_warned = 1; 2528 chip->irq_pending_warned = 1;
2538 } 2529 }
2539 2530
@@ -2627,8 +2618,8 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
2627 2618
2628 list_for_each_entry(apcm, &chip->pcm_list, list) { 2619 list_for_each_entry(apcm, &chip->pcm_list, list) {
2629 if (apcm->pcm->device == pcm_dev) { 2620 if (apcm->pcm->device == pcm_dev) {
2630 snd_printk(KERN_ERR SFX "%s: PCM %d already exists\n", 2621 dev_err(chip->card->dev, "PCM %d already exists\n",
2631 pci_name(chip->pci), pcm_dev); 2622 pcm_dev);
2632 return -EBUSY; 2623 return -EBUSY;
2633 } 2624 }
2634 } 2625 }
@@ -2708,8 +2699,9 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
2708 if (request_irq(chip->pci->irq, azx_interrupt, 2699 if (request_irq(chip->pci->irq, azx_interrupt,
2709 chip->msi ? 0 : IRQF_SHARED, 2700 chip->msi ? 0 : IRQF_SHARED,
2710 KBUILD_MODNAME, chip)) { 2701 KBUILD_MODNAME, chip)) {
2711 printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " 2702 dev_err(chip->card->dev,
2712 "disabling device\n", chip->pci->irq); 2703 "unable to grab IRQ %d, disabling device\n",
2704 chip->pci->irq);
2713 if (do_disconnect) 2705 if (do_disconnect)
2714 snd_card_disconnect(chip->card); 2706 snd_card_disconnect(chip->card);
2715 return -1; 2707 return -1;
@@ -2966,8 +2958,8 @@ static int azx_resume(struct device *dev)
2966 pci_set_power_state(pci, PCI_D0); 2958 pci_set_power_state(pci, PCI_D0);
2967 pci_restore_state(pci); 2959 pci_restore_state(pci);
2968 if (pci_enable_device(pci) < 0) { 2960 if (pci_enable_device(pci) < 0) {
2969 printk(KERN_ERR "hda-intel: pci_enable_device failed, " 2961 dev_err(chip->card->dev,
2970 "disabling device\n"); 2962 "pci_enable_device failed, disabling device\n");
2971 snd_card_disconnect(card); 2963 snd_card_disconnect(card);
2972 return -EIO; 2964 return -EIO;
2973 } 2965 }
@@ -3124,20 +3116,16 @@ static void azx_vs_set_state(struct pci_dev *pci,
3124 if (!chip->bus) { 3116 if (!chip->bus) {
3125 chip->disabled = disabled; 3117 chip->disabled = disabled;
3126 if (!disabled) { 3118 if (!disabled) {
3127 snd_printk(KERN_INFO SFX 3119 dev_info(chip->card->dev,
3128 "%s: Start delayed initialization\n", 3120 "Start delayed initialization\n");
3129 pci_name(chip->pci));
3130 if (azx_probe_continue(chip) < 0) { 3121 if (azx_probe_continue(chip) < 0) {
3131 snd_printk(KERN_ERR SFX 3122 dev_err(chip->card->dev, "initialization error\n");
3132 "%s: initialization error\n",
3133 pci_name(chip->pci));
3134 chip->init_failed = true; 3123 chip->init_failed = true;
3135 } 3124 }
3136 } 3125 }
3137 } else { 3126 } else {
3138 snd_printk(KERN_INFO SFX 3127 dev_info(chip->card->dev, "%s via VGA-switcheroo\n",
3139 "%s: %s via VGA-switcheroo\n", pci_name(chip->pci), 3128 disabled ? "Disabling" : "Enabling");
3140 disabled ? "Disabling" : "Enabling");
3141 if (disabled) { 3129 if (disabled) {
3142 pm_runtime_put_sync_suspend(&pci->dev); 3130 pm_runtime_put_sync_suspend(&pci->dev);
3143 azx_suspend(&pci->dev); 3131 azx_suspend(&pci->dev);
@@ -3147,8 +3135,8 @@ static void azx_vs_set_state(struct pci_dev *pci,
3147 pci->current_state = PCI_D3cold; 3135 pci->current_state = PCI_D3cold;
3148 chip->disabled = true; 3136 chip->disabled = true;
3149 if (snd_hda_lock_devices(chip->bus)) 3137 if (snd_hda_lock_devices(chip->bus))
3150 snd_printk(KERN_WARNING SFX "%s: Cannot lock devices!\n", 3138 dev_warn(chip->card->dev,
3151 pci_name(chip->pci)); 3139 "Cannot lock devices!\n");
3152 } else { 3140 } else {
3153 snd_hda_unlock_devices(chip->bus); 3141 snd_hda_unlock_devices(chip->bus);
3154 pm_runtime_get_noresume(&pci->dev); 3142 pm_runtime_get_noresume(&pci->dev);
@@ -3178,9 +3166,8 @@ static void init_vga_switcheroo(struct azx *chip)
3178{ 3166{
3179 struct pci_dev *p = get_bound_vga(chip->pci); 3167 struct pci_dev *p = get_bound_vga(chip->pci);
3180 if (p) { 3168 if (p) {
3181 snd_printk(KERN_INFO SFX 3169 dev_info(chip->card->dev,
3182 "%s: Handle VGA-switcheroo audio client\n", 3170 "Handle VGA-switcheroo audio client\n");
3183 pci_name(chip->pci));
3184 chip->use_vga_switcheroo = 1; 3171 chip->use_vga_switcheroo = 1;
3185 pci_dev_put(p); 3172 pci_dev_put(p);
3186 } 3173 }
@@ -3371,20 +3358,19 @@ static int check_position_fix(struct azx *chip, int fix)
3371 3358
3372 q = snd_pci_quirk_lookup(chip->pci, position_fix_list); 3359 q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
3373 if (q) { 3360 if (q) {
3374 printk(KERN_INFO 3361 dev_info(chip->card->dev,
3375 "hda_intel: position_fix set to %d " 3362 "position_fix set to %d for device %04x:%04x\n",
3376 "for device %04x:%04x\n", 3363 q->value, q->subvendor, q->subdevice);
3377 q->value, q->subvendor, q->subdevice);
3378 return q->value; 3364 return q->value;
3379 } 3365 }
3380 3366
3381 /* Check VIA/ATI HD Audio Controller exist */ 3367 /* Check VIA/ATI HD Audio Controller exist */
3382 if (chip->driver_caps & AZX_DCAPS_POSFIX_VIA) { 3368 if (chip->driver_caps & AZX_DCAPS_POSFIX_VIA) {
3383 snd_printd(SFX "%s: Using VIACOMBO position fix\n", pci_name(chip->pci)); 3369 dev_dbg(chip->card->dev, "Using VIACOMBO position fix\n");
3384 return POS_FIX_VIACOMBO; 3370 return POS_FIX_VIACOMBO;
3385 } 3371 }
3386 if (chip->driver_caps & AZX_DCAPS_POSFIX_LPIB) { 3372 if (chip->driver_caps & AZX_DCAPS_POSFIX_LPIB) {
3387 snd_printd(SFX "%s: Using LPIB position fix\n", pci_name(chip->pci)); 3373 dev_dbg(chip->card->dev, "Using LPIB position fix\n");
3388 return POS_FIX_LPIB; 3374 return POS_FIX_LPIB;
3389 } 3375 }
3390 return POS_FIX_AUTO; 3376 return POS_FIX_AUTO;
@@ -3422,10 +3408,9 @@ static void check_probe_mask(struct azx *chip, int dev)
3422 if (chip->codec_probe_mask == -1) { 3408 if (chip->codec_probe_mask == -1) {
3423 q = snd_pci_quirk_lookup(chip->pci, probe_mask_list); 3409 q = snd_pci_quirk_lookup(chip->pci, probe_mask_list);
3424 if (q) { 3410 if (q) {
3425 printk(KERN_INFO 3411 dev_info(chip->card->dev,
3426 "hda_intel: probe_mask set to 0x%x " 3412 "probe_mask set to 0x%x for device %04x:%04x\n",
3427 "for device %04x:%04x\n", 3413 q->value, q->subvendor, q->subdevice);
3428 q->value, q->subvendor, q->subdevice);
3429 chip->codec_probe_mask = q->value; 3414 chip->codec_probe_mask = q->value;
3430 } 3415 }
3431 } 3416 }
@@ -3434,8 +3419,8 @@ static void check_probe_mask(struct azx *chip, int dev)
3434 if (chip->codec_probe_mask != -1 && 3419 if (chip->codec_probe_mask != -1 &&
3435 (chip->codec_probe_mask & AZX_FORCE_CODEC_MASK)) { 3420 (chip->codec_probe_mask & AZX_FORCE_CODEC_MASK)) {
3436 chip->codec_mask = chip->codec_probe_mask & 0xff; 3421 chip->codec_mask = chip->codec_probe_mask & 0xff;
3437 printk(KERN_INFO "hda_intel: codec_mask forced to 0x%x\n", 3422 dev_info(chip->card->dev, "codec_mask forced to 0x%x\n",
3438 chip->codec_mask); 3423 chip->codec_mask);
3439 } 3424 }
3440} 3425}
3441 3426
@@ -3467,16 +3452,16 @@ static void check_msi(struct azx *chip)
3467 chip->msi = 1; /* enable MSI as default */ 3452 chip->msi = 1; /* enable MSI as default */
3468 q = snd_pci_quirk_lookup(chip->pci, msi_black_list); 3453 q = snd_pci_quirk_lookup(chip->pci, msi_black_list);
3469 if (q) { 3454 if (q) {
3470 printk(KERN_INFO 3455 dev_info(chip->card->dev,
3471 "hda_intel: msi for device %04x:%04x set to %d\n", 3456 "msi for device %04x:%04x set to %d\n",
3472 q->subvendor, q->subdevice, q->value); 3457 q->subvendor, q->subdevice, q->value);
3473 chip->msi = q->value; 3458 chip->msi = q->value;
3474 return; 3459 return;
3475 } 3460 }
3476 3461
3477 /* NVidia chipsets seem to cause troubles with MSI */ 3462 /* NVidia chipsets seem to cause troubles with MSI */
3478 if (chip->driver_caps & AZX_DCAPS_NO_MSI) { 3463 if (chip->driver_caps & AZX_DCAPS_NO_MSI) {
3479 printk(KERN_INFO "hda_intel: Disabling MSI\n"); 3464 dev_info(chip->card->dev, "Disabling MSI\n");
3480 chip->msi = 0; 3465 chip->msi = 0;
3481 } 3466 }
3482} 3467}
@@ -3508,8 +3493,8 @@ static void azx_check_snoop_available(struct azx *chip)
3508 } 3493 }
3509 3494
3510 if (snoop != chip->snoop) { 3495 if (snoop != chip->snoop) {
3511 snd_printk(KERN_INFO SFX "%s: Force to %s mode\n", 3496 dev_info(chip->card->dev, "Force to %s mode\n",
3512 pci_name(chip->pci), snoop ? "snoop" : "non-snoop"); 3497 snoop ? "snoop" : "non-snoop");
3513 chip->snoop = snoop; 3498 chip->snoop = snoop;
3514 } 3499 }
3515} 3500}
@@ -3540,7 +3525,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
3540 3525
3541 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 3526 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
3542 if (!chip) { 3527 if (!chip) {
3543 snd_printk(KERN_ERR SFX "%s: Cannot allocate chip\n", pci_name(pci)); 3528 dev_err(card->dev, "Cannot allocate chip\n");
3544 pci_disable_device(pci); 3529 pci_disable_device(pci);
3545 return -ENOMEM; 3530 return -ENOMEM;
3546 } 3531 }
@@ -3588,8 +3573,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
3588 3573
3589 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 3574 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
3590 if (err < 0) { 3575 if (err < 0) {
3591 snd_printk(KERN_ERR SFX "%s: Error creating device [card]!\n", 3576 dev_err(card->dev, "Error creating device [card]!\n");
3592 pci_name(chip->pci));
3593 azx_free(chip); 3577 azx_free(chip);
3594 return err; 3578 return err;
3595 } 3579 }
@@ -3628,7 +3612,7 @@ static int azx_first_init(struct azx *chip)
3628 chip->addr = pci_resource_start(pci, 0); 3612 chip->addr = pci_resource_start(pci, 0);
3629 chip->remap_addr = pci_ioremap_bar(pci, 0); 3613 chip->remap_addr = pci_ioremap_bar(pci, 0);
3630 if (chip->remap_addr == NULL) { 3614 if (chip->remap_addr == NULL) {
3631 snd_printk(KERN_ERR SFX "%s: ioremap error\n", pci_name(chip->pci)); 3615 dev_err(card->dev, "ioremap error\n");
3632 return -ENXIO; 3616 return -ENXIO;
3633 } 3617 }
3634 3618
@@ -3643,7 +3627,7 @@ static int azx_first_init(struct azx *chip)
3643 synchronize_irq(chip->irq); 3627 synchronize_irq(chip->irq);
3644 3628
3645 gcap = azx_readw(chip, GCAP); 3629 gcap = azx_readw(chip, GCAP);
3646 snd_printdd(SFX "%s: chipset global capabilities = 0x%x\n", pci_name(chip->pci), gcap); 3630 dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
3647 3631
3648 /* disable SB600 64bit support for safety */ 3632 /* disable SB600 64bit support for safety */
3649 if (chip->pci->vendor == PCI_VENDOR_ID_ATI) { 3633 if (chip->pci->vendor == PCI_VENDOR_ID_ATI) {
@@ -3660,7 +3644,7 @@ static int azx_first_init(struct azx *chip)
3660 3644
3661 /* disable 64bit DMA address on some devices */ 3645 /* disable 64bit DMA address on some devices */
3662 if (chip->driver_caps & AZX_DCAPS_NO_64BIT) { 3646 if (chip->driver_caps & AZX_DCAPS_NO_64BIT) {
3663 snd_printd(SFX "%s: Disabling 64bit DMA\n", pci_name(chip->pci)); 3647 dev_dbg(card->dev, "Disabling 64bit DMA\n");
3664 gcap &= ~ICH6_GCAP_64OK; 3648 gcap &= ~ICH6_GCAP_64OK;
3665 } 3649 }
3666 3650
@@ -3715,7 +3699,7 @@ static int azx_first_init(struct azx *chip)
3715 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev), 3699 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev),
3716 GFP_KERNEL); 3700 GFP_KERNEL);
3717 if (!chip->azx_dev) { 3701 if (!chip->azx_dev) {
3718 snd_printk(KERN_ERR SFX "%s: cannot malloc azx_dev\n", pci_name(chip->pci)); 3702 dev_err(card->dev, "cannot malloc azx_dev\n");
3719 return -ENOMEM; 3703 return -ENOMEM;
3720 } 3704 }
3721 3705
@@ -3726,7 +3710,7 @@ static int azx_first_init(struct azx *chip)
3726 snd_dma_pci_data(chip->pci), 3710 snd_dma_pci_data(chip->pci),
3727 BDL_SIZE, &chip->azx_dev[i].bdl); 3711 BDL_SIZE, &chip->azx_dev[i].bdl);
3728 if (err < 0) { 3712 if (err < 0) {
3729 snd_printk(KERN_ERR SFX "%s: cannot allocate BDL\n", pci_name(chip->pci)); 3713 dev_err(card->dev, "cannot allocate BDL\n");
3730 return -ENOMEM; 3714 return -ENOMEM;
3731 } 3715 }
3732 mark_pages_wc(chip, &chip->azx_dev[i].bdl, true); 3716 mark_pages_wc(chip, &chip->azx_dev[i].bdl, true);
@@ -3736,7 +3720,7 @@ static int azx_first_init(struct azx *chip)
3736 snd_dma_pci_data(chip->pci), 3720 snd_dma_pci_data(chip->pci),
3737 chip->num_streams * 8, &chip->posbuf); 3721 chip->num_streams * 8, &chip->posbuf);
3738 if (err < 0) { 3722 if (err < 0) {
3739 snd_printk(KERN_ERR SFX "%s: cannot allocate posbuf\n", pci_name(chip->pci)); 3723 dev_err(card->dev, "cannot allocate posbuf\n");
3740 return -ENOMEM; 3724 return -ENOMEM;
3741 } 3725 }
3742 mark_pages_wc(chip, &chip->posbuf, true); 3726 mark_pages_wc(chip, &chip->posbuf, true);
@@ -3754,7 +3738,7 @@ static int azx_first_init(struct azx *chip)
3754 3738
3755 /* codec detection */ 3739 /* codec detection */
3756 if (!chip->codec_mask) { 3740 if (!chip->codec_mask) {
3757 snd_printk(KERN_ERR SFX "%s: no codecs found!\n", pci_name(chip->pci)); 3741 dev_err(card->dev, "no codecs found!\n");
3758 return -ENODEV; 3742 return -ENODEV;
3759 } 3743 }
3760 3744
@@ -3790,8 +3774,7 @@ static void azx_firmware_cb(const struct firmware *fw, void *context)
3790 struct pci_dev *pci = chip->pci; 3774 struct pci_dev *pci = chip->pci;
3791 3775
3792 if (!fw) { 3776 if (!fw) {
3793 snd_printk(KERN_ERR SFX "%s: Cannot load firmware, aborting\n", 3777 dev_err(card->dev, "Cannot load firmware, aborting\n");
3794 pci_name(chip->pci));
3795 goto error; 3778 goto error;
3796 } 3779 }
3797 3780
@@ -3828,7 +3811,7 @@ static int azx_probe(struct pci_dev *pci,
3828 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, 3811 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
3829 0, &card); 3812 0, &card);
3830 if (err < 0) { 3813 if (err < 0) {
3831 snd_printk(KERN_ERR "hda-intel: Error creating card!\n"); 3814 dev_err(&pci->dev, "Error creating card!\n");
3832 return err; 3815 return err;
3833 } 3816 }
3834 3817
@@ -3841,15 +3824,13 @@ static int azx_probe(struct pci_dev *pci,
3841 3824
3842 err = register_vga_switcheroo(chip); 3825 err = register_vga_switcheroo(chip);
3843 if (err < 0) { 3826 if (err < 0) {
3844 snd_printk(KERN_ERR SFX 3827 dev_err(card->dev, "Error registering VGA-switcheroo client\n");
3845 "%s: Error registering VGA-switcheroo client\n", pci_name(pci));
3846 goto out_free; 3828 goto out_free;
3847 } 3829 }
3848 3830
3849 if (check_hdmi_disabled(pci)) { 3831 if (check_hdmi_disabled(pci)) {
3850 snd_printk(KERN_INFO SFX "%s: VGA controller is disabled\n", 3832 dev_info(card->dev, "VGA controller is disabled\n");
3851 pci_name(pci)); 3833 dev_info(card->dev, "Delaying initialization\n");
3852 snd_printk(KERN_INFO SFX "%s: Delaying initialization\n", pci_name(pci));
3853 chip->disabled = true; 3834 chip->disabled = true;
3854 } 3835 }
3855 3836
@@ -3857,8 +3838,8 @@ static int azx_probe(struct pci_dev *pci,
3857 3838
3858#ifdef CONFIG_SND_HDA_PATCH_LOADER 3839#ifdef CONFIG_SND_HDA_PATCH_LOADER
3859 if (patch[dev] && *patch[dev]) { 3840 if (patch[dev] && *patch[dev]) {
3860 snd_printk(KERN_ERR SFX "%s: Applying patch firmware '%s'\n", 3841 dev_info(card->dev, "Applying patch firmware '%s'\n",
3861 pci_name(pci), patch[dev]); 3842 patch[dev]);
3862 err = request_firmware_nowait(THIS_MODULE, true, patch[dev], 3843 err = request_firmware_nowait(THIS_MODULE, true, patch[dev],
3863 &pci->dev, GFP_KERNEL, card, 3844 &pci->dev, GFP_KERNEL, card,
3864 azx_firmware_cb); 3845 azx_firmware_cb);
@@ -3870,7 +3851,7 @@ static int azx_probe(struct pci_dev *pci,
3870 3851
3871#ifndef CONFIG_SND_HDA_I915 3852#ifndef CONFIG_SND_HDA_I915
3872 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 3853 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
3873 snd_printk(KERN_ERR SFX "Haswell must build in CONFIG_SND_HDA_I915\n"); 3854 dev_err(card->dev, "Haswell must build in CONFIG_SND_HDA_I915\n");
3874#endif 3855#endif
3875 3856
3876 if (schedule_probe) 3857 if (schedule_probe)
@@ -3897,7 +3878,8 @@ static int azx_probe_continue(struct azx *chip)
3897#ifdef CONFIG_SND_HDA_I915 3878#ifdef CONFIG_SND_HDA_I915
3898 err = hda_i915_init(); 3879 err = hda_i915_init();
3899 if (err < 0) { 3880 if (err < 0) {
3900 snd_printk(KERN_ERR SFX "Error request power-well from i915\n"); 3881 dev_err(chip->card->dev,
3882 "Error request power-well from i915\n");
3901 goto out_free; 3883 goto out_free;
3902 } 3884 }
3903#endif 3885#endif
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index a489243f243b..e51d15529215 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -758,4 +758,11 @@ void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
758#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80 758#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
759void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); 759void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
760 760
761/*
762 */
763#define codec_err(codec, fmt, args...) dev_err(&(codec)->dev, fmt, ##args)
764#define codec_warn(codec, fmt, args...) dev_warn(&(codec)->dev, fmt, ##args)
765#define codec_info(codec, fmt, args...) dev_info(&(codec)->dev, fmt, ##args)
766#define codec_dbg(codec, fmt, args...) dev_dbg(&(codec)->dev, fmt, ##args)
767
761#endif /* __SOUND_HDA_LOCAL_H */ 768#endif /* __SOUND_HDA_LOCAL_H */
diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
index da0f51460533..e2079090ca6f 100644
--- a/sound/pci/hda/hda_sysfs.c
+++ b/sound/pci/hda/hda_sysfs.c
@@ -119,7 +119,7 @@ static int clear_codec(struct hda_codec *codec)
119 119
120 err = snd_hda_codec_reset(codec); 120 err = snd_hda_codec_reset(codec);
121 if (err < 0) { 121 if (err < 0) {
122 snd_printk(KERN_ERR "The codec is being used, can't free.\n"); 122 codec_err(codec, "The codec is being used, can't free.\n");
123 return err; 123 return err;
124 } 124 }
125 snd_hda_sysfs_clear(codec); 125 snd_hda_sysfs_clear(codec);
@@ -131,10 +131,10 @@ static int reconfig_codec(struct hda_codec *codec)
131 int err; 131 int err;
132 132
133 snd_hda_power_up(codec); 133 snd_hda_power_up(codec);
134 snd_printk(KERN_INFO "hda-codec: reconfiguring\n"); 134 codec_info(codec, "hda-codec: reconfiguring\n");
135 err = snd_hda_codec_reset(codec); 135 err = snd_hda_codec_reset(codec);
136 if (err < 0) { 136 if (err < 0) {
137 snd_printk(KERN_ERR 137 codec_err(codec,
138 "The codec is being used, can't reconfigure.\n"); 138 "The codec is being used, can't reconfigure.\n");
139 goto error; 139 goto error;
140 } 140 }
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index c7ea40f28ecc..092f2bd030bd 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -867,7 +867,7 @@ static int chipio_write_data_multiple(struct hda_codec *codec,
867 int status = 0; 867 int status = 0;
868 868
869 if (data == NULL) { 869 if (data == NULL) {
870 snd_printdd(KERN_ERR "chipio_write_data null ptr\n"); 870 codec_dbg(codec, "chipio_write_data null ptr\n");
871 return -EINVAL; 871 return -EINVAL;
872 } 872 }
873 873
@@ -1406,12 +1406,12 @@ static int dspio_scp(struct hda_codec *codec,
1406 return -EINVAL; 1406 return -EINVAL;
1407 1407
1408 if (dir == SCP_GET && reply == NULL) { 1408 if (dir == SCP_GET && reply == NULL) {
1409 snd_printdd(KERN_ERR "dspio_scp get but has no buffer\n"); 1409 codec_dbg(codec, "dspio_scp get but has no buffer\n");
1410 return -EINVAL; 1410 return -EINVAL;
1411 } 1411 }
1412 1412
1413 if (reply != NULL && (reply_len == NULL || (*reply_len == 0))) { 1413 if (reply != NULL && (reply_len == NULL || (*reply_len == 0))) {
1414 snd_printdd(KERN_ERR "dspio_scp bad resp buf len parms\n"); 1414 codec_dbg(codec, "dspio_scp bad resp buf len parms\n");
1415 return -EINVAL; 1415 return -EINVAL;
1416 } 1416 }
1417 1417
@@ -1429,7 +1429,7 @@ static int dspio_scp(struct hda_codec *codec,
1429 sizeof(scp_reply), &ret_bytes); 1429 sizeof(scp_reply), &ret_bytes);
1430 1430
1431 if (status < 0) { 1431 if (status < 0) {
1432 snd_printdd(KERN_ERR "dspio_scp: send scp msg failed\n"); 1432 codec_dbg(codec, "dspio_scp: send scp msg failed\n");
1433 return status; 1433 return status;
1434 } 1434 }
1435 1435
@@ -1448,17 +1448,17 @@ static int dspio_scp(struct hda_codec *codec,
1448 / sizeof(unsigned int); 1448 / sizeof(unsigned int);
1449 1449
1450 if (*reply_len < ret_size*sizeof(unsigned int)) { 1450 if (*reply_len < ret_size*sizeof(unsigned int)) {
1451 snd_printdd(KERN_ERR "reply too long for buf\n"); 1451 codec_dbg(codec, "reply too long for buf\n");
1452 return -EINVAL; 1452 return -EINVAL;
1453 } else if (ret_size != reply_data_size) { 1453 } else if (ret_size != reply_data_size) {
1454 snd_printdd(KERN_ERR "RetLen and HdrLen .NE.\n"); 1454 codec_dbg(codec, "RetLen and HdrLen .NE.\n");
1455 return -EINVAL; 1455 return -EINVAL;
1456 } else { 1456 } else {
1457 *reply_len = ret_size*sizeof(unsigned int); 1457 *reply_len = ret_size*sizeof(unsigned int);
1458 memcpy(reply, scp_reply.data, *reply_len); 1458 memcpy(reply, scp_reply.data, *reply_len);
1459 } 1459 }
1460 } else { 1460 } else {
1461 snd_printdd(KERN_ERR "reply ill-formed or errflag set\n"); 1461 codec_dbg(codec, "reply ill-formed or errflag set\n");
1462 return -EIO; 1462 return -EIO;
1463 } 1463 }
1464 1464
@@ -1488,22 +1488,22 @@ static int dspio_alloc_dma_chan(struct hda_codec *codec, unsigned int *dma_chan)
1488 int status = 0; 1488 int status = 0;
1489 unsigned int size = sizeof(dma_chan); 1489 unsigned int size = sizeof(dma_chan);
1490 1490
1491 snd_printdd(KERN_INFO " dspio_alloc_dma_chan() -- begin\n"); 1491 codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n");
1492 status = dspio_scp(codec, MASTERCONTROL, MASTERCONTROL_ALLOC_DMA_CHAN, 1492 status = dspio_scp(codec, MASTERCONTROL, MASTERCONTROL_ALLOC_DMA_CHAN,
1493 SCP_GET, NULL, 0, dma_chan, &size); 1493 SCP_GET, NULL, 0, dma_chan, &size);
1494 1494
1495 if (status < 0) { 1495 if (status < 0) {
1496 snd_printdd(KERN_INFO "dspio_alloc_dma_chan: SCP Failed\n"); 1496 codec_dbg(codec, "dspio_alloc_dma_chan: SCP Failed\n");
1497 return status; 1497 return status;
1498 } 1498 }
1499 1499
1500 if ((*dma_chan + 1) == 0) { 1500 if ((*dma_chan + 1) == 0) {
1501 snd_printdd(KERN_INFO "no free dma channels to allocate\n"); 1501 codec_dbg(codec, "no free dma channels to allocate\n");
1502 return -EBUSY; 1502 return -EBUSY;
1503 } 1503 }
1504 1504
1505 snd_printdd("dspio_alloc_dma_chan: chan=%d\n", *dma_chan); 1505 codec_dbg(codec, "dspio_alloc_dma_chan: chan=%d\n", *dma_chan);
1506 snd_printdd(KERN_INFO " dspio_alloc_dma_chan() -- complete\n"); 1506 codec_dbg(codec, " dspio_alloc_dma_chan() -- complete\n");
1507 1507
1508 return status; 1508 return status;
1509} 1509}
@@ -1516,18 +1516,18 @@ static int dspio_free_dma_chan(struct hda_codec *codec, unsigned int dma_chan)
1516 int status = 0; 1516 int status = 0;
1517 unsigned int dummy = 0; 1517 unsigned int dummy = 0;
1518 1518
1519 snd_printdd(KERN_INFO " dspio_free_dma_chan() -- begin\n"); 1519 codec_dbg(codec, " dspio_free_dma_chan() -- begin\n");
1520 snd_printdd("dspio_free_dma_chan: chan=%d\n", dma_chan); 1520 codec_dbg(codec, "dspio_free_dma_chan: chan=%d\n", dma_chan);
1521 1521
1522 status = dspio_scp(codec, MASTERCONTROL, MASTERCONTROL_ALLOC_DMA_CHAN, 1522 status = dspio_scp(codec, MASTERCONTROL, MASTERCONTROL_ALLOC_DMA_CHAN,
1523 SCP_SET, &dma_chan, sizeof(dma_chan), NULL, &dummy); 1523 SCP_SET, &dma_chan, sizeof(dma_chan), NULL, &dummy);
1524 1524
1525 if (status < 0) { 1525 if (status < 0) {
1526 snd_printdd(KERN_INFO "dspio_free_dma_chan: SCP Failed\n"); 1526 codec_dbg(codec, "dspio_free_dma_chan: SCP Failed\n");
1527 return status; 1527 return status;
1528 } 1528 }
1529 1529
1530 snd_printdd(KERN_INFO " dspio_free_dma_chan() -- complete\n"); 1530 codec_dbg(codec, " dspio_free_dma_chan() -- complete\n");
1531 1531
1532 return status; 1532 return status;
1533} 1533}
@@ -1575,14 +1575,14 @@ static int dsp_reset(struct hda_codec *codec)
1575 unsigned int res; 1575 unsigned int res;
1576 int retry = 20; 1576 int retry = 20;
1577 1577
1578 snd_printdd("dsp_reset\n"); 1578 codec_dbg(codec, "dsp_reset\n");
1579 do { 1579 do {
1580 res = dspio_send(codec, VENDOR_DSPIO_DSP_INIT, 0); 1580 res = dspio_send(codec, VENDOR_DSPIO_DSP_INIT, 0);
1581 retry--; 1581 retry--;
1582 } while (res == -EIO && retry); 1582 } while (res == -EIO && retry);
1583 1583
1584 if (!retry) { 1584 if (!retry) {
1585 snd_printdd("dsp_reset timeout\n"); 1585 codec_dbg(codec, "dsp_reset timeout\n");
1586 return -EIO; 1586 return -EIO;
1587 } 1587 }
1588 1588
@@ -1635,39 +1635,39 @@ static int dsp_dma_setup_common(struct hda_codec *codec,
1635 unsigned int active; 1635 unsigned int active;
1636 bool code, yram; 1636 bool code, yram;
1637 1637
1638 snd_printdd(KERN_INFO "-- dsp_dma_setup_common() -- Begin ---------\n"); 1638 codec_dbg(codec, "-- dsp_dma_setup_common() -- Begin ---------\n");
1639 1639
1640 if (dma_chan >= DSPDMAC_DMA_CFG_CHANNEL_COUNT) { 1640 if (dma_chan >= DSPDMAC_DMA_CFG_CHANNEL_COUNT) {
1641 snd_printdd(KERN_ERR "dma chan num invalid\n"); 1641 codec_dbg(codec, "dma chan num invalid\n");
1642 return -EINVAL; 1642 return -EINVAL;
1643 } 1643 }
1644 1644
1645 if (dsp_is_dma_active(codec, dma_chan)) { 1645 if (dsp_is_dma_active(codec, dma_chan)) {
1646 snd_printdd(KERN_ERR "dma already active\n"); 1646 codec_dbg(codec, "dma already active\n");
1647 return -EBUSY; 1647 return -EBUSY;
1648 } 1648 }
1649 1649
1650 dsp_addx = dsp_chip_to_dsp_addx(chip_addx, &code, &yram); 1650 dsp_addx = dsp_chip_to_dsp_addx(chip_addx, &code, &yram);
1651 1651
1652 if (dsp_addx == INVALID_CHIP_ADDRESS) { 1652 if (dsp_addx == INVALID_CHIP_ADDRESS) {
1653 snd_printdd(KERN_ERR "invalid chip addr\n"); 1653 codec_dbg(codec, "invalid chip addr\n");
1654 return -ENXIO; 1654 return -ENXIO;
1655 } 1655 }
1656 1656
1657 chnl_prop = DSPDMAC_CHNLPROP_AC_MASK; 1657 chnl_prop = DSPDMAC_CHNLPROP_AC_MASK;
1658 active = 0; 1658 active = 0;
1659 1659
1660 snd_printdd(KERN_INFO " dsp_dma_setup_common() start reg pgm\n"); 1660 codec_dbg(codec, " dsp_dma_setup_common() start reg pgm\n");
1661 1661
1662 if (ovly) { 1662 if (ovly) {
1663 status = chipio_read(codec, DSPDMAC_CHNLPROP_INST_OFFSET, 1663 status = chipio_read(codec, DSPDMAC_CHNLPROP_INST_OFFSET,
1664 &chnl_prop); 1664 &chnl_prop);
1665 1665
1666 if (status < 0) { 1666 if (status < 0) {
1667 snd_printdd(KERN_ERR "read CHNLPROP Reg fail\n"); 1667 codec_dbg(codec, "read CHNLPROP Reg fail\n");
1668 return status; 1668 return status;
1669 } 1669 }
1670 snd_printdd(KERN_INFO "dsp_dma_setup_common() Read CHNLPROP\n"); 1670 codec_dbg(codec, "dsp_dma_setup_common() Read CHNLPROP\n");
1671 } 1671 }
1672 1672
1673 if (!code) 1673 if (!code)
@@ -1679,20 +1679,20 @@ static int dsp_dma_setup_common(struct hda_codec *codec,
1679 1679
1680 status = chipio_write(codec, DSPDMAC_CHNLPROP_INST_OFFSET, chnl_prop); 1680 status = chipio_write(codec, DSPDMAC_CHNLPROP_INST_OFFSET, chnl_prop);
1681 if (status < 0) { 1681 if (status < 0) {
1682 snd_printdd(KERN_ERR "write CHNLPROP Reg fail\n"); 1682 codec_dbg(codec, "write CHNLPROP Reg fail\n");
1683 return status; 1683 return status;
1684 } 1684 }
1685 snd_printdd(KERN_INFO " dsp_dma_setup_common() Write CHNLPROP\n"); 1685 codec_dbg(codec, " dsp_dma_setup_common() Write CHNLPROP\n");
1686 1686
1687 if (ovly) { 1687 if (ovly) {
1688 status = chipio_read(codec, DSPDMAC_ACTIVE_INST_OFFSET, 1688 status = chipio_read(codec, DSPDMAC_ACTIVE_INST_OFFSET,
1689 &active); 1689 &active);
1690 1690
1691 if (status < 0) { 1691 if (status < 0) {
1692 snd_printdd(KERN_ERR "read ACTIVE Reg fail\n"); 1692 codec_dbg(codec, "read ACTIVE Reg fail\n");
1693 return status; 1693 return status;
1694 } 1694 }
1695 snd_printdd(KERN_INFO "dsp_dma_setup_common() Read ACTIVE\n"); 1695 codec_dbg(codec, "dsp_dma_setup_common() Read ACTIVE\n");
1696 } 1696 }
1697 1697
1698 active &= (~(1 << (DSPDMAC_ACTIVE_AAR_LOBIT + dma_chan))) & 1698 active &= (~(1 << (DSPDMAC_ACTIVE_AAR_LOBIT + dma_chan))) &
@@ -1700,35 +1700,35 @@ static int dsp_dma_setup_common(struct hda_codec *codec,
1700 1700
1701 status = chipio_write(codec, DSPDMAC_ACTIVE_INST_OFFSET, active); 1701 status = chipio_write(codec, DSPDMAC_ACTIVE_INST_OFFSET, active);
1702 if (status < 0) { 1702 if (status < 0) {
1703 snd_printdd(KERN_ERR "write ACTIVE Reg fail\n"); 1703 codec_dbg(codec, "write ACTIVE Reg fail\n");
1704 return status; 1704 return status;
1705 } 1705 }
1706 1706
1707 snd_printdd(KERN_INFO " dsp_dma_setup_common() Write ACTIVE\n"); 1707 codec_dbg(codec, " dsp_dma_setup_common() Write ACTIVE\n");
1708 1708
1709 status = chipio_write(codec, DSPDMAC_AUDCHSEL_INST_OFFSET(dma_chan), 1709 status = chipio_write(codec, DSPDMAC_AUDCHSEL_INST_OFFSET(dma_chan),
1710 port_map_mask); 1710 port_map_mask);
1711 if (status < 0) { 1711 if (status < 0) {
1712 snd_printdd(KERN_ERR "write AUDCHSEL Reg fail\n"); 1712 codec_dbg(codec, "write AUDCHSEL Reg fail\n");
1713 return status; 1713 return status;
1714 } 1714 }
1715 snd_printdd(KERN_INFO " dsp_dma_setup_common() Write AUDCHSEL\n"); 1715 codec_dbg(codec, " dsp_dma_setup_common() Write AUDCHSEL\n");
1716 1716
1717 status = chipio_write(codec, DSPDMAC_IRQCNT_INST_OFFSET(dma_chan), 1717 status = chipio_write(codec, DSPDMAC_IRQCNT_INST_OFFSET(dma_chan),
1718 DSPDMAC_IRQCNT_BICNT_MASK | DSPDMAC_IRQCNT_CICNT_MASK); 1718 DSPDMAC_IRQCNT_BICNT_MASK | DSPDMAC_IRQCNT_CICNT_MASK);
1719 if (status < 0) { 1719 if (status < 0) {
1720 snd_printdd(KERN_ERR "write IRQCNT Reg fail\n"); 1720 codec_dbg(codec, "write IRQCNT Reg fail\n");
1721 return status; 1721 return status;
1722 } 1722 }
1723 snd_printdd(KERN_INFO " dsp_dma_setup_common() Write IRQCNT\n"); 1723 codec_dbg(codec, " dsp_dma_setup_common() Write IRQCNT\n");
1724 1724
1725 snd_printdd( 1725 codec_dbg(codec,
1726 "ChipA=0x%x,DspA=0x%x,dmaCh=%u, " 1726 "ChipA=0x%x,DspA=0x%x,dmaCh=%u, "
1727 "CHSEL=0x%x,CHPROP=0x%x,Active=0x%x\n", 1727 "CHSEL=0x%x,CHPROP=0x%x,Active=0x%x\n",
1728 chip_addx, dsp_addx, dma_chan, 1728 chip_addx, dsp_addx, dma_chan,
1729 port_map_mask, chnl_prop, active); 1729 port_map_mask, chnl_prop, active);
1730 1730
1731 snd_printdd(KERN_INFO "-- dsp_dma_setup_common() -- Complete ------\n"); 1731 codec_dbg(codec, "-- dsp_dma_setup_common() -- Complete ------\n");
1732 1732
1733 return 0; 1733 return 0;
1734} 1734}
@@ -1754,20 +1754,20 @@ static int dsp_dma_setup(struct hda_codec *codec,
1754 const unsigned int max_dma_count = 1 << (DSPDMAC_XFRCNT_BCNT_HIBIT - 1754 const unsigned int max_dma_count = 1 << (DSPDMAC_XFRCNT_BCNT_HIBIT -
1755 DSPDMAC_XFRCNT_BCNT_LOBIT + 1); 1755 DSPDMAC_XFRCNT_BCNT_LOBIT + 1);
1756 1756
1757 snd_printdd(KERN_INFO "-- dsp_dma_setup() -- Begin ---------\n"); 1757 codec_dbg(codec, "-- dsp_dma_setup() -- Begin ---------\n");
1758 1758
1759 if (count > max_dma_count) { 1759 if (count > max_dma_count) {
1760 snd_printdd(KERN_ERR "count too big\n"); 1760 codec_dbg(codec, "count too big\n");
1761 return -EINVAL; 1761 return -EINVAL;
1762 } 1762 }
1763 1763
1764 dsp_addx = dsp_chip_to_dsp_addx(chip_addx, &code, &yram); 1764 dsp_addx = dsp_chip_to_dsp_addx(chip_addx, &code, &yram);
1765 if (dsp_addx == INVALID_CHIP_ADDRESS) { 1765 if (dsp_addx == INVALID_CHIP_ADDRESS) {
1766 snd_printdd(KERN_ERR "invalid chip addr\n"); 1766 codec_dbg(codec, "invalid chip addr\n");
1767 return -ENXIO; 1767 return -ENXIO;
1768 } 1768 }
1769 1769
1770 snd_printdd(KERN_INFO " dsp_dma_setup() start reg pgm\n"); 1770 codec_dbg(codec, " dsp_dma_setup() start reg pgm\n");
1771 1771
1772 addr_field = dsp_addx << DSPDMAC_DMACFG_DBADR_LOBIT; 1772 addr_field = dsp_addx << DSPDMAC_DMACFG_DBADR_LOBIT;
1773 incr_field = 0; 1773 incr_field = 0;
@@ -1784,10 +1784,10 @@ static int dsp_dma_setup(struct hda_codec *codec,
1784 status = chipio_write(codec, DSPDMAC_DMACFG_INST_OFFSET(dma_chan), 1784 status = chipio_write(codec, DSPDMAC_DMACFG_INST_OFFSET(dma_chan),
1785 dma_cfg); 1785 dma_cfg);
1786 if (status < 0) { 1786 if (status < 0) {
1787 snd_printdd(KERN_ERR "write DMACFG Reg fail\n"); 1787 codec_dbg(codec, "write DMACFG Reg fail\n");
1788 return status; 1788 return status;
1789 } 1789 }
1790 snd_printdd(KERN_INFO " dsp_dma_setup() Write DMACFG\n"); 1790 codec_dbg(codec, " dsp_dma_setup() Write DMACFG\n");
1791 1791
1792 adr_ofs = (count - 1) << (DSPDMAC_DSPADROFS_BOFS_LOBIT + 1792 adr_ofs = (count - 1) << (DSPDMAC_DSPADROFS_BOFS_LOBIT +
1793 (code ? 0 : 1)); 1793 (code ? 0 : 1));
@@ -1795,10 +1795,10 @@ static int dsp_dma_setup(struct hda_codec *codec,
1795 status = chipio_write(codec, DSPDMAC_DSPADROFS_INST_OFFSET(dma_chan), 1795 status = chipio_write(codec, DSPDMAC_DSPADROFS_INST_OFFSET(dma_chan),
1796 adr_ofs); 1796 adr_ofs);
1797 if (status < 0) { 1797 if (status < 0) {
1798 snd_printdd(KERN_ERR "write DSPADROFS Reg fail\n"); 1798 codec_dbg(codec, "write DSPADROFS Reg fail\n");
1799 return status; 1799 return status;
1800 } 1800 }
1801 snd_printdd(KERN_INFO " dsp_dma_setup() Write DSPADROFS\n"); 1801 codec_dbg(codec, " dsp_dma_setup() Write DSPADROFS\n");
1802 1802
1803 base_cnt = (count - 1) << DSPDMAC_XFRCNT_BCNT_LOBIT; 1803 base_cnt = (count - 1) << DSPDMAC_XFRCNT_BCNT_LOBIT;
1804 1804
@@ -1809,17 +1809,17 @@ static int dsp_dma_setup(struct hda_codec *codec,
1809 status = chipio_write(codec, 1809 status = chipio_write(codec,
1810 DSPDMAC_XFRCNT_INST_OFFSET(dma_chan), xfr_cnt); 1810 DSPDMAC_XFRCNT_INST_OFFSET(dma_chan), xfr_cnt);
1811 if (status < 0) { 1811 if (status < 0) {
1812 snd_printdd(KERN_ERR "write XFRCNT Reg fail\n"); 1812 codec_dbg(codec, "write XFRCNT Reg fail\n");
1813 return status; 1813 return status;
1814 } 1814 }
1815 snd_printdd(KERN_INFO " dsp_dma_setup() Write XFRCNT\n"); 1815 codec_dbg(codec, " dsp_dma_setup() Write XFRCNT\n");
1816 1816
1817 snd_printdd( 1817 codec_dbg(codec,
1818 "ChipA=0x%x, cnt=0x%x, DMACFG=0x%x, " 1818 "ChipA=0x%x, cnt=0x%x, DMACFG=0x%x, "
1819 "ADROFS=0x%x, XFRCNT=0x%x\n", 1819 "ADROFS=0x%x, XFRCNT=0x%x\n",
1820 chip_addx, count, dma_cfg, adr_ofs, xfr_cnt); 1820 chip_addx, count, dma_cfg, adr_ofs, xfr_cnt);
1821 1821
1822 snd_printdd(KERN_INFO "-- dsp_dma_setup() -- Complete ---------\n"); 1822 codec_dbg(codec, "-- dsp_dma_setup() -- Complete ---------\n");
1823 1823
1824 return 0; 1824 return 0;
1825} 1825}
@@ -1833,17 +1833,17 @@ static int dsp_dma_start(struct hda_codec *codec,
1833 unsigned int reg = 0; 1833 unsigned int reg = 0;
1834 int status = 0; 1834 int status = 0;
1835 1835
1836 snd_printdd(KERN_INFO "-- dsp_dma_start() -- Begin ---------\n"); 1836 codec_dbg(codec, "-- dsp_dma_start() -- Begin ---------\n");
1837 1837
1838 if (ovly) { 1838 if (ovly) {
1839 status = chipio_read(codec, 1839 status = chipio_read(codec,
1840 DSPDMAC_CHNLSTART_INST_OFFSET, &reg); 1840 DSPDMAC_CHNLSTART_INST_OFFSET, &reg);
1841 1841
1842 if (status < 0) { 1842 if (status < 0) {
1843 snd_printdd(KERN_ERR "read CHNLSTART reg fail\n"); 1843 codec_dbg(codec, "read CHNLSTART reg fail\n");
1844 return status; 1844 return status;
1845 } 1845 }
1846 snd_printdd(KERN_INFO "-- dsp_dma_start() Read CHNLSTART\n"); 1846 codec_dbg(codec, "-- dsp_dma_start() Read CHNLSTART\n");
1847 1847
1848 reg &= ~(DSPDMAC_CHNLSTART_EN_MASK | 1848 reg &= ~(DSPDMAC_CHNLSTART_EN_MASK |
1849 DSPDMAC_CHNLSTART_DIS_MASK); 1849 DSPDMAC_CHNLSTART_DIS_MASK);
@@ -1852,10 +1852,10 @@ static int dsp_dma_start(struct hda_codec *codec,
1852 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET, 1852 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET,
1853 reg | (1 << (dma_chan + DSPDMAC_CHNLSTART_EN_LOBIT))); 1853 reg | (1 << (dma_chan + DSPDMAC_CHNLSTART_EN_LOBIT)));
1854 if (status < 0) { 1854 if (status < 0) {
1855 snd_printdd(KERN_ERR "write CHNLSTART reg fail\n"); 1855 codec_dbg(codec, "write CHNLSTART reg fail\n");
1856 return status; 1856 return status;
1857 } 1857 }
1858 snd_printdd(KERN_INFO "-- dsp_dma_start() -- Complete ---------\n"); 1858 codec_dbg(codec, "-- dsp_dma_start() -- Complete ---------\n");
1859 1859
1860 return status; 1860 return status;
1861} 1861}
@@ -1869,17 +1869,17 @@ static int dsp_dma_stop(struct hda_codec *codec,
1869 unsigned int reg = 0; 1869 unsigned int reg = 0;
1870 int status = 0; 1870 int status = 0;
1871 1871
1872 snd_printdd(KERN_INFO "-- dsp_dma_stop() -- Begin ---------\n"); 1872 codec_dbg(codec, "-- dsp_dma_stop() -- Begin ---------\n");
1873 1873
1874 if (ovly) { 1874 if (ovly) {
1875 status = chipio_read(codec, 1875 status = chipio_read(codec,
1876 DSPDMAC_CHNLSTART_INST_OFFSET, &reg); 1876 DSPDMAC_CHNLSTART_INST_OFFSET, &reg);
1877 1877
1878 if (status < 0) { 1878 if (status < 0) {
1879 snd_printdd(KERN_ERR "read CHNLSTART reg fail\n"); 1879 codec_dbg(codec, "read CHNLSTART reg fail\n");
1880 return status; 1880 return status;
1881 } 1881 }
1882 snd_printdd(KERN_INFO "-- dsp_dma_stop() Read CHNLSTART\n"); 1882 codec_dbg(codec, "-- dsp_dma_stop() Read CHNLSTART\n");
1883 reg &= ~(DSPDMAC_CHNLSTART_EN_MASK | 1883 reg &= ~(DSPDMAC_CHNLSTART_EN_MASK |
1884 DSPDMAC_CHNLSTART_DIS_MASK); 1884 DSPDMAC_CHNLSTART_DIS_MASK);
1885 } 1885 }
@@ -1887,10 +1887,10 @@ static int dsp_dma_stop(struct hda_codec *codec,
1887 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET, 1887 status = chipio_write(codec, DSPDMAC_CHNLSTART_INST_OFFSET,
1888 reg | (1 << (dma_chan + DSPDMAC_CHNLSTART_DIS_LOBIT))); 1888 reg | (1 << (dma_chan + DSPDMAC_CHNLSTART_DIS_LOBIT)));
1889 if (status < 0) { 1889 if (status < 0) {
1890 snd_printdd(KERN_ERR "write CHNLSTART reg fail\n"); 1890 codec_dbg(codec, "write CHNLSTART reg fail\n");
1891 return status; 1891 return status;
1892 } 1892 }
1893 snd_printdd(KERN_INFO "-- dsp_dma_stop() -- Complete ---------\n"); 1893 codec_dbg(codec, "-- dsp_dma_stop() -- Complete ---------\n");
1894 1894
1895 return status; 1895 return status;
1896} 1896}
@@ -1973,17 +1973,17 @@ static int dsp_allocate_ports(struct hda_codec *codec,
1973{ 1973{
1974 int status; 1974 int status;
1975 1975
1976 snd_printdd(KERN_INFO " dsp_allocate_ports() -- begin\n"); 1976 codec_dbg(codec, " dsp_allocate_ports() -- begin\n");
1977 1977
1978 if ((rate_multi != 1) && (rate_multi != 2) && (rate_multi != 4)) { 1978 if ((rate_multi != 1) && (rate_multi != 2) && (rate_multi != 4)) {
1979 snd_printdd(KERN_ERR "bad rate multiple\n"); 1979 codec_dbg(codec, "bad rate multiple\n");
1980 return -EINVAL; 1980 return -EINVAL;
1981 } 1981 }
1982 1982
1983 status = dsp_allocate_router_ports(codec, num_chans, 1983 status = dsp_allocate_router_ports(codec, num_chans,
1984 rate_multi, 0, port_map); 1984 rate_multi, 0, port_map);
1985 1985
1986 snd_printdd(KERN_INFO " dsp_allocate_ports() -- complete\n"); 1986 codec_dbg(codec, " dsp_allocate_ports() -- complete\n");
1987 1987
1988 return status; 1988 return status;
1989} 1989}
@@ -2000,7 +2000,7 @@ static int dsp_allocate_ports_format(struct hda_codec *codec,
2000 unsigned int rate_multi = sample_rate_mul / sample_rate_div; 2000 unsigned int rate_multi = sample_rate_mul / sample_rate_div;
2001 2001
2002 if ((rate_multi != 1) && (rate_multi != 2) && (rate_multi != 4)) { 2002 if ((rate_multi != 1) && (rate_multi != 2) && (rate_multi != 4)) {
2003 snd_printdd(KERN_ERR "bad rate multiple\n"); 2003 codec_dbg(codec, "bad rate multiple\n");
2004 return -EINVAL; 2004 return -EINVAL;
2005 } 2005 }
2006 2006
@@ -2018,14 +2018,14 @@ static int dsp_free_ports(struct hda_codec *codec)
2018{ 2018{
2019 int status; 2019 int status;
2020 2020
2021 snd_printdd(KERN_INFO " dsp_free_ports() -- begin\n"); 2021 codec_dbg(codec, " dsp_free_ports() -- begin\n");
2022 2022
2023 status = dsp_free_router_ports(codec); 2023 status = dsp_free_router_ports(codec);
2024 if (status < 0) { 2024 if (status < 0) {
2025 snd_printdd(KERN_ERR "free router ports fail\n"); 2025 codec_dbg(codec, "free router ports fail\n");
2026 return status; 2026 return status;
2027 } 2027 }
2028 snd_printdd(KERN_INFO " dsp_free_ports() -- complete\n"); 2028 codec_dbg(codec, " dsp_free_ports() -- complete\n");
2029 2029
2030 return status; 2030 return status;
2031} 2031}
@@ -2091,8 +2091,6 @@ static int dma_set_state(struct dma_engine *dma, enum dma_state state)
2091{ 2091{
2092 bool cmd; 2092 bool cmd;
2093 2093
2094 snd_printdd("dma_set_state state=%d\n", state);
2095
2096 switch (state) { 2094 switch (state) {
2097 case DMA_STATE_STOP: 2095 case DMA_STATE_STOP:
2098 cmd = false; 2096 cmd = false;
@@ -2195,7 +2193,7 @@ static int dspxfr_hci_write(struct hda_codec *codec,
2195 unsigned int count; 2193 unsigned int count;
2196 2194
2197 if (fls == NULL || fls->chip_addr != g_chip_addr_magic_value) { 2195 if (fls == NULL || fls->chip_addr != g_chip_addr_magic_value) {
2198 snd_printdd(KERN_ERR "hci_write invalid params\n"); 2196 codec_dbg(codec, "hci_write invalid params\n");
2199 return -EINVAL; 2197 return -EINVAL;
2200 } 2198 }
2201 2199
@@ -2204,7 +2202,7 @@ static int dspxfr_hci_write(struct hda_codec *codec,
2204 while (count >= 2) { 2202 while (count >= 2) {
2205 status = chipio_write(codec, data[0], data[1]); 2203 status = chipio_write(codec, data[0], data[1]);
2206 if (status < 0) { 2204 if (status < 0) {
2207 snd_printdd(KERN_ERR "hci_write chipio failed\n"); 2205 codec_dbg(codec, "hci_write chipio failed\n");
2208 return status; 2206 return status;
2209 } 2207 }
2210 count -= 2; 2208 count -= 2;
@@ -2264,12 +2262,12 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2264 } 2262 }
2265 2263
2266 if (hci_write && (!fls || is_last(fls))) { 2264 if (hci_write && (!fls || is_last(fls))) {
2267 snd_printdd("hci_write\n"); 2265 codec_dbg(codec, "hci_write\n");
2268 return dspxfr_hci_write(codec, hci_write); 2266 return dspxfr_hci_write(codec, hci_write);
2269 } 2267 }
2270 2268
2271 if (fls == NULL || dma_engine == NULL || port_map_mask == 0) { 2269 if (fls == NULL || dma_engine == NULL || port_map_mask == 0) {
2272 snd_printdd("Invalid Params\n"); 2270 codec_dbg(codec, "Invalid Params\n");
2273 return -EINVAL; 2271 return -EINVAL;
2274 } 2272 }
2275 2273
@@ -2285,7 +2283,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2285 if (!UC_RANGE(chip_addx, words_to_write) && 2283 if (!UC_RANGE(chip_addx, words_to_write) &&
2286 !X_RANGE_ALL(chip_addx, words_to_write) && 2284 !X_RANGE_ALL(chip_addx, words_to_write) &&
2287 !Y_RANGE_ALL(chip_addx, words_to_write)) { 2285 !Y_RANGE_ALL(chip_addx, words_to_write)) {
2288 snd_printdd("Invalid chip_addx Params\n"); 2286 codec_dbg(codec, "Invalid chip_addx Params\n");
2289 return -EINVAL; 2287 return -EINVAL;
2290 } 2288 }
2291 2289
@@ -2295,7 +2293,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2295 buffer_addx = dma_get_buffer_addr(dma_engine); 2293 buffer_addx = dma_get_buffer_addr(dma_engine);
2296 2294
2297 if (buffer_addx == NULL) { 2295 if (buffer_addx == NULL) {
2298 snd_printdd(KERN_ERR "dma_engine buffer NULL\n"); 2296 codec_dbg(codec, "dma_engine buffer NULL\n");
2299 return -EINVAL; 2297 return -EINVAL;
2300 } 2298 }
2301 2299
@@ -2308,7 +2306,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2308 (num_chans * sample_rate_mul / sample_rate_div)); 2306 (num_chans * sample_rate_mul / sample_rate_div));
2309 2307
2310 if (hda_frame_size_words == 0) { 2308 if (hda_frame_size_words == 0) {
2311 snd_printdd(KERN_ERR "frmsz zero\n"); 2309 codec_dbg(codec, "frmsz zero\n");
2312 return -EINVAL; 2310 return -EINVAL;
2313 } 2311 }
2314 2312
@@ -2316,14 +2314,14 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2316 (unsigned int)(UC_RANGE(chip_addx, 1) ? 2314 (unsigned int)(UC_RANGE(chip_addx, 1) ?
2317 65536 : 32768)); 2315 65536 : 32768));
2318 buffer_size_words -= buffer_size_words % hda_frame_size_words; 2316 buffer_size_words -= buffer_size_words % hda_frame_size_words;
2319 snd_printdd( 2317 codec_dbg(codec,
2320 "chpadr=0x%08x frmsz=%u nchan=%u " 2318 "chpadr=0x%08x frmsz=%u nchan=%u "
2321 "rate_mul=%u div=%u bufsz=%u\n", 2319 "rate_mul=%u div=%u bufsz=%u\n",
2322 chip_addx, hda_frame_size_words, num_chans, 2320 chip_addx, hda_frame_size_words, num_chans,
2323 sample_rate_mul, sample_rate_div, buffer_size_words); 2321 sample_rate_mul, sample_rate_div, buffer_size_words);
2324 2322
2325 if (buffer_size_words < hda_frame_size_words) { 2323 if (buffer_size_words < hda_frame_size_words) {
2326 snd_printdd(KERN_ERR "dspxfr_one_seg:failed\n"); 2324 codec_dbg(codec, "dspxfr_one_seg:failed\n");
2327 return -EINVAL; 2325 return -EINVAL;
2328 } 2326 }
2329 2327
@@ -2337,7 +2335,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2337 2335
2338 while (words_to_write != 0) { 2336 while (words_to_write != 0) {
2339 run_size_words = min(buffer_size_words, words_to_write); 2337 run_size_words = min(buffer_size_words, words_to_write);
2340 snd_printdd("dspxfr (seg loop)cnt=%u rs=%u remainder=%u\n", 2338 codec_dbg(codec, "dspxfr (seg loop)cnt=%u rs=%u remainder=%u\n",
2341 words_to_write, run_size_words, remainder_words); 2339 words_to_write, run_size_words, remainder_words);
2342 dma_xfer(dma_engine, data, run_size_words*sizeof(u32)); 2340 dma_xfer(dma_engine, data, run_size_words*sizeof(u32));
2343 if (!comm_dma_setup_done) { 2341 if (!comm_dma_setup_done) {
@@ -2359,7 +2357,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2359 if (status < 0) 2357 if (status < 0)
2360 return status; 2358 return status;
2361 if (!dsp_is_dma_active(codec, dma_chan)) { 2359 if (!dsp_is_dma_active(codec, dma_chan)) {
2362 snd_printdd(KERN_ERR "dspxfr:DMA did not start\n"); 2360 codec_dbg(codec, "dspxfr:DMA did not start\n");
2363 return -EIO; 2361 return -EIO;
2364 } 2362 }
2365 status = dma_set_state(dma_engine, DMA_STATE_RUN); 2363 status = dma_set_state(dma_engine, DMA_STATE_RUN);
@@ -2391,7 +2389,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2391 if (dma_active) 2389 if (dma_active)
2392 break; 2390 break;
2393 2391
2394 snd_printdd(KERN_INFO "+++++ DMA complete\n"); 2392 codec_dbg(codec, "+++++ DMA complete\n");
2395 dma_set_state(dma_engine, DMA_STATE_STOP); 2393 dma_set_state(dma_engine, DMA_STATE_STOP);
2396 status = dma_reset(dma_engine); 2394 status = dma_reset(dma_engine);
2397 2395
@@ -2465,7 +2463,7 @@ static int dspxfr_image(struct hda_codec *codec,
2465 hda_format, &response); 2463 hda_format, &response);
2466 2464
2467 if (status < 0) { 2465 if (status < 0) {
2468 snd_printdd(KERN_ERR "set converter format fail\n"); 2466 codec_dbg(codec, "set converter format fail\n");
2469 goto exit; 2467 goto exit;
2470 } 2468 }
2471 2469
@@ -2480,7 +2478,7 @@ static int dspxfr_image(struct hda_codec *codec,
2480 if (ovly) { 2478 if (ovly) {
2481 status = dspio_alloc_dma_chan(codec, &dma_chan); 2479 status = dspio_alloc_dma_chan(codec, &dma_chan);
2482 if (status < 0) { 2480 if (status < 0) {
2483 snd_printdd(KERN_ERR "alloc dmachan fail\n"); 2481 codec_dbg(codec, "alloc dmachan fail\n");
2484 dma_chan = INVALID_DMA_CHANNEL; 2482 dma_chan = INVALID_DMA_CHANNEL;
2485 goto exit; 2483 goto exit;
2486 } 2484 }
@@ -2490,7 +2488,7 @@ static int dspxfr_image(struct hda_codec *codec,
2490 status = dsp_allocate_ports_format(codec, hda_format, 2488 status = dsp_allocate_ports_format(codec, hda_format,
2491 &port_map_mask); 2489 &port_map_mask);
2492 if (status < 0) { 2490 if (status < 0) {
2493 snd_printdd(KERN_ERR "alloc ports fail\n"); 2491 codec_dbg(codec, "alloc ports fail\n");
2494 goto exit; 2492 goto exit;
2495 } 2493 }
2496 2494
@@ -2498,13 +2496,13 @@ static int dspxfr_image(struct hda_codec *codec,
2498 status = codec_set_converter_stream_channel(codec, 2496 status = codec_set_converter_stream_channel(codec,
2499 WIDGET_CHIP_CTRL, stream_id, 0, &response); 2497 WIDGET_CHIP_CTRL, stream_id, 0, &response);
2500 if (status < 0) { 2498 if (status < 0) {
2501 snd_printdd(KERN_ERR "set stream chan fail\n"); 2499 codec_dbg(codec, "set stream chan fail\n");
2502 goto exit; 2500 goto exit;
2503 } 2501 }
2504 2502
2505 while ((fls_data != NULL) && !is_last(fls_data)) { 2503 while ((fls_data != NULL) && !is_last(fls_data)) {
2506 if (!is_valid(fls_data)) { 2504 if (!is_valid(fls_data)) {
2507 snd_printdd(KERN_ERR "FLS check fail\n"); 2505 codec_dbg(codec, "FLS check fail\n");
2508 status = -EINVAL; 2506 status = -EINVAL;
2509 goto exit; 2507 goto exit;
2510 } 2508 }
@@ -2547,7 +2545,7 @@ exit:
2547 */ 2545 */
2548static void dspload_post_setup(struct hda_codec *codec) 2546static void dspload_post_setup(struct hda_codec *codec)
2549{ 2547{
2550 snd_printdd(KERN_INFO "---- dspload_post_setup ------\n"); 2548 codec_dbg(codec, "---- dspload_post_setup ------\n");
2551 2549
2552 /*set DSP speaker to 2.0 configuration*/ 2550 /*set DSP speaker to 2.0 configuration*/
2553 chipio_write(codec, XRAM_XRAM_INST_OFFSET(0x18), 0x08080080); 2551 chipio_write(codec, XRAM_XRAM_INST_OFFSET(0x18), 0x08080080);
@@ -2585,7 +2583,7 @@ static int dspload_image(struct hda_codec *codec,
2585 unsigned int sample_rate; 2583 unsigned int sample_rate;
2586 unsigned short channels; 2584 unsigned short channels;
2587 2585
2588 snd_printdd(KERN_INFO "---- dspload_image begin ------\n"); 2586 codec_dbg(codec, "---- dspload_image begin ------\n");
2589 if (router_chans == 0) { 2587 if (router_chans == 0) {
2590 if (!ovly) 2588 if (!ovly)
2591 router_chans = DMA_TRANSFER_FRAME_SIZE_NWORDS; 2589 router_chans = DMA_TRANSFER_FRAME_SIZE_NWORDS;
@@ -2602,27 +2600,27 @@ static int dspload_image(struct hda_codec *codec,
2602 } 2600 }
2603 2601
2604 do { 2602 do {
2605 snd_printdd(KERN_INFO "Ready to program DMA\n"); 2603 codec_dbg(codec, "Ready to program DMA\n");
2606 if (!ovly) 2604 if (!ovly)
2607 status = dsp_reset(codec); 2605 status = dsp_reset(codec);
2608 2606
2609 if (status < 0) 2607 if (status < 0)
2610 break; 2608 break;
2611 2609
2612 snd_printdd(KERN_INFO "dsp_reset() complete\n"); 2610 codec_dbg(codec, "dsp_reset() complete\n");
2613 status = dspxfr_image(codec, fls, reloc, sample_rate, channels, 2611 status = dspxfr_image(codec, fls, reloc, sample_rate, channels,
2614 ovly); 2612 ovly);
2615 2613
2616 if (status < 0) 2614 if (status < 0)
2617 break; 2615 break;
2618 2616
2619 snd_printdd(KERN_INFO "dspxfr_image() complete\n"); 2617 codec_dbg(codec, "dspxfr_image() complete\n");
2620 if (autostart && !ovly) { 2618 if (autostart && !ovly) {
2621 dspload_post_setup(codec); 2619 dspload_post_setup(codec);
2622 status = dsp_set_run_state(codec); 2620 status = dsp_set_run_state(codec);
2623 } 2621 }
2624 2622
2625 snd_printdd(KERN_INFO "LOAD FINISHED\n"); 2623 codec_dbg(codec, "LOAD FINISHED\n");
2626 } while (0); 2624 } while (0);
2627 2625
2628 return status; 2626 return status;
@@ -3131,7 +3129,7 @@ static int ca0132_select_out(struct hda_codec *codec)
3131 unsigned int tmp; 3129 unsigned int tmp;
3132 int err; 3130 int err;
3133 3131
3134 snd_printdd(KERN_INFO "ca0132_select_out\n"); 3132 codec_dbg(codec, "ca0132_select_out\n");
3135 3133
3136 snd_hda_power_up(codec); 3134 snd_hda_power_up(codec);
3137 3135
@@ -3149,7 +3147,7 @@ static int ca0132_select_out(struct hda_codec *codec)
3149 spec->cur_out_type = SPEAKER_OUT; 3147 spec->cur_out_type = SPEAKER_OUT;
3150 3148
3151 if (spec->cur_out_type == SPEAKER_OUT) { 3149 if (spec->cur_out_type == SPEAKER_OUT) {
3152 snd_printdd(KERN_INFO "ca0132_select_out speaker\n"); 3150 codec_dbg(codec, "ca0132_select_out speaker\n");
3153 /*speaker out config*/ 3151 /*speaker out config*/
3154 tmp = FLOAT_ONE; 3152 tmp = FLOAT_ONE;
3155 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp); 3153 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp);
@@ -3182,7 +3180,7 @@ static int ca0132_select_out(struct hda_codec *codec)
3182 snd_hda_set_pin_ctl(codec, spec->out_pins[0], 3180 snd_hda_set_pin_ctl(codec, spec->out_pins[0],
3183 pin_ctl | PIN_OUT); 3181 pin_ctl | PIN_OUT);
3184 } else { 3182 } else {
3185 snd_printdd(KERN_INFO "ca0132_select_out hp\n"); 3183 codec_dbg(codec, "ca0132_select_out hp\n");
3186 /*headphone out config*/ 3184 /*headphone out config*/
3187 tmp = FLOAT_ZERO; 3185 tmp = FLOAT_ZERO;
3188 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp); 3186 err = dspio_set_uint_param(codec, 0x80, 0x04, tmp);
@@ -3287,7 +3285,7 @@ static int ca0132_select_mic(struct hda_codec *codec)
3287 int jack_present; 3285 int jack_present;
3288 int auto_jack; 3286 int auto_jack;
3289 3287
3290 snd_printdd(KERN_INFO "ca0132_select_mic\n"); 3288 codec_dbg(codec, "ca0132_select_mic\n");
3291 3289
3292 snd_hda_power_up(codec); 3290 snd_hda_power_up(codec);
3293 3291
@@ -3409,7 +3407,7 @@ static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val)
3409 val = 0; 3407 val = 0;
3410 } 3408 }
3411 3409
3412 snd_printdd(KERN_INFO "ca0132_effect_set: nid=0x%x, val=%ld\n", 3410 codec_dbg(codec, "ca0132_effect_set: nid=0x%x, val=%ld\n",
3413 nid, val); 3411 nid, val);
3414 3412
3415 on = (val == 0) ? FLOAT_ZERO : FLOAT_ONE; 3413 on = (val == 0) ? FLOAT_ZERO : FLOAT_ONE;
@@ -3431,7 +3429,7 @@ static int ca0132_pe_switch_set(struct hda_codec *codec)
3431 hda_nid_t nid; 3429 hda_nid_t nid;
3432 int i, ret = 0; 3430 int i, ret = 0;
3433 3431
3434 snd_printdd(KERN_INFO "ca0132_pe_switch_set: val=%ld\n", 3432 codec_dbg(codec, "ca0132_pe_switch_set: val=%ld\n",
3435 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]); 3433 spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID]);
3436 3434
3437 i = OUT_EFFECT_START_NID - EFFECT_START_NID; 3435 i = OUT_EFFECT_START_NID - EFFECT_START_NID;
@@ -3477,7 +3475,7 @@ static int ca0132_cvoice_switch_set(struct hda_codec *codec)
3477 int i, ret = 0; 3475 int i, ret = 0;
3478 unsigned int oldval; 3476 unsigned int oldval;
3479 3477
3480 snd_printdd(KERN_INFO "ca0132_cvoice_switch_set: val=%ld\n", 3478 codec_dbg(codec, "ca0132_cvoice_switch_set: val=%ld\n",
3481 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]); 3479 spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]);
3482 3480
3483 i = IN_EFFECT_START_NID - EFFECT_START_NID; 3481 i = IN_EFFECT_START_NID - EFFECT_START_NID;
@@ -3607,7 +3605,7 @@ static int ca0132_voicefx_put(struct snd_kcontrol *kcontrol,
3607 if (sel >= items) 3605 if (sel >= items)
3608 return 0; 3606 return 0;
3609 3607
3610 snd_printdd(KERN_INFO "ca0132_voicefx_put: sel=%d, preset=%s\n", 3608 codec_dbg(codec, "ca0132_voicefx_put: sel=%d, preset=%s\n",
3611 sel, ca0132_voicefx_presets[sel].name); 3609 sel, ca0132_voicefx_presets[sel].name);
3612 3610
3613 /* 3611 /*
@@ -3678,7 +3676,7 @@ static int ca0132_switch_put(struct snd_kcontrol *kcontrol,
3678 long *valp = ucontrol->value.integer.value; 3676 long *valp = ucontrol->value.integer.value;
3679 int changed = 1; 3677 int changed = 1;
3680 3678
3681 snd_printdd(KERN_INFO "ca0132_switch_put: nid=0x%x, val=%ld\n", 3679 codec_dbg(codec, "ca0132_switch_put: nid=0x%x, val=%ld\n",
3682 nid, *valp); 3680 nid, *valp);
3683 3681
3684 snd_hda_power_up(codec); 3682 snd_hda_power_up(codec);
@@ -4141,7 +4139,7 @@ static void ca0132_set_dmic(struct hda_codec *codec, int enable)
4141 u8 val; 4139 u8 val;
4142 unsigned int oldval; 4140 unsigned int oldval;
4143 4141
4144 snd_printdd(KERN_INFO "ca0132_set_dmic: enable=%d\n", enable); 4142 codec_dbg(codec, "ca0132_set_dmic: enable=%d\n", enable);
4145 4143
4146 oldval = stop_mic1(codec); 4144 oldval = stop_mic1(codec);
4147 ca0132_set_vipsource(codec, 0); 4145 ca0132_set_vipsource(codec, 0);
@@ -4249,7 +4247,7 @@ static void ca0132_refresh_widget_caps(struct hda_codec *codec)
4249 int i; 4247 int i;
4250 hda_nid_t nid; 4248 hda_nid_t nid;
4251 4249
4252 snd_printdd(KERN_INFO "ca0132_refresh_widget_caps.\n"); 4250 codec_dbg(codec, "ca0132_refresh_widget_caps.\n");
4253 nid = codec->start_nid; 4251 nid = codec->start_nid;
4254 for (i = 0; i < codec->num_nodes; i++, nid++) 4252 for (i = 0; i < codec->num_nodes; i++, nid++)
4255 codec->wcaps[i] = snd_hda_param_read(codec, nid, 4253 codec->wcaps[i] = snd_hda_param_read(codec, nid,
@@ -4393,7 +4391,7 @@ static void ca0132_process_dsp_response(struct hda_codec *codec)
4393{ 4391{
4394 struct ca0132_spec *spec = codec->spec; 4392 struct ca0132_spec *spec = codec->spec;
4395 4393
4396 snd_printdd(KERN_INFO "ca0132_process_dsp_response\n"); 4394 codec_dbg(codec, "ca0132_process_dsp_response\n");
4397 if (spec->wait_scp) { 4395 if (spec->wait_scp) {
4398 if (dspio_get_response_data(codec) >= 0) 4396 if (dspio_get_response_data(codec) >= 0)
4399 spec->wait_scp = 0; 4397 spec->wait_scp = 0;
@@ -4412,7 +4410,7 @@ static void ca0132_unsol_event(struct hda_codec *codec, unsigned int res)
4412 res = snd_hda_jack_get_action(codec, 4410 res = snd_hda_jack_get_action(codec,
4413 (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f); 4411 (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x3f);
4414 4412
4415 snd_printdd(KERN_INFO "snd_hda_jack_get_action: 0x%x\n", res); 4413 codec_dbg(codec, "snd_hda_jack_get_action: 0x%x\n", res);
4416 4414
4417 switch (res) { 4415 switch (res) {
4418 case UNSOL_TAG_HP: 4416 case UNSOL_TAG_HP:
@@ -4657,7 +4655,7 @@ static int patch_ca0132(struct hda_codec *codec)
4657 struct ca0132_spec *spec; 4655 struct ca0132_spec *spec;
4658 int err; 4656 int err;
4659 4657
4660 snd_printdd("patch_ca0132\n"); 4658 codec_dbg(codec, "patch_ca0132\n");
4661 4659
4662 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 4660 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
4663 if (!spec) 4661 if (!spec)
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index d782292b1ba9..061ea5965dd5 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -623,7 +623,7 @@ static int patch_cmi9880(struct hda_codec *codec)
623 cmi9880_models, 623 cmi9880_models,
624 cmi9880_cfg_tbl); 624 cmi9880_cfg_tbl);
625 if (spec->board_config < 0) { 625 if (spec->board_config < 0) {
626 snd_printdd(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", 626 codec_dbg(codec, "%s: BIOS auto-probing.\n",
627 codec->chip_name); 627 codec->chip_name);
628 spec->board_config = CMI_AUTO; /* try everything */ 628 spec->board_config = CMI_AUTO; /* try everything */
629 } 629 }
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 13a416060eb8..09d6d0db2b06 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1900,7 +1900,8 @@ static void cxt5066_update_speaker(struct hda_codec *codec)
1900 struct conexant_spec *spec = codec->spec; 1900 struct conexant_spec *spec = codec->spec;
1901 unsigned int pinctl; 1901 unsigned int pinctl;
1902 1902
1903 snd_printdd("CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n", 1903 codec_dbg(codec,
1904 "CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n",
1904 spec->hp_present, spec->cur_eapd); 1905 spec->hp_present, spec->cur_eapd);
1905 1906
1906 /* Port A (HP) */ 1907 /* Port A (HP) */
@@ -1969,10 +1970,10 @@ static void cxt5066_vostro_automic(struct hda_codec *codec)
1969 1970
1970 present = snd_hda_jack_detect(codec, 0x1a); 1971 present = snd_hda_jack_detect(codec, 0x1a);
1971 if (present) { 1972 if (present) {
1972 snd_printdd("CXT5066: external microphone detected\n"); 1973 codec_dbg(codec, "CXT5066: external microphone detected\n");
1973 snd_hda_sequence_write(codec, ext_mic_present); 1974 snd_hda_sequence_write(codec, ext_mic_present);
1974 } else { 1975 } else {
1975 snd_printdd("CXT5066: external microphone absent\n"); 1976 codec_dbg(codec, "CXT5066: external microphone absent\n");
1976 snd_hda_sequence_write(codec, ext_mic_absent); 1977 snd_hda_sequence_write(codec, ext_mic_absent);
1977 } 1978 }
1978} 1979}
@@ -1997,10 +1998,10 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
1997 1998
1998 present = snd_hda_jack_detect(codec, 0x1b); 1999 present = snd_hda_jack_detect(codec, 0x1b);
1999 if (present) { 2000 if (present) {
2000 snd_printdd("CXT5066: external microphone detected\n"); 2001 codec_dbg(codec, "CXT5066: external microphone detected\n");
2001 snd_hda_sequence_write(codec, ext_mic_present); 2002 snd_hda_sequence_write(codec, ext_mic_present);
2002 } else { 2003 } else {
2003 snd_printdd("CXT5066: external microphone absent\n"); 2004 codec_dbg(codec, "CXT5066: external microphone absent\n");
2004 snd_hda_sequence_write(codec, ext_mic_absent); 2005 snd_hda_sequence_write(codec, ext_mic_absent);
2005 } 2006 }
2006} 2007}
@@ -2012,7 +2013,7 @@ static void cxt5066_asus_automic(struct hda_codec *codec)
2012 unsigned int present; 2013 unsigned int present;
2013 2014
2014 present = snd_hda_jack_detect(codec, 0x1b); 2015 present = snd_hda_jack_detect(codec, 0x1b);
2015 snd_printdd("CXT5066: external microphone present=%d\n", present); 2016 codec_dbg(codec, "CXT5066: external microphone present=%d\n", present);
2016 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, 2017 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
2017 present ? 1 : 0); 2018 present ? 1 : 0);
2018} 2019}
@@ -2024,7 +2025,7 @@ static void cxt5066_hp_laptop_automic(struct hda_codec *codec)
2024 unsigned int present; 2025 unsigned int present;
2025 2026
2026 present = snd_hda_jack_detect(codec, 0x1b); 2027 present = snd_hda_jack_detect(codec, 0x1b);
2027 snd_printdd("CXT5066: external microphone present=%d\n", present); 2028 codec_dbg(codec, "CXT5066: external microphone present=%d\n", present);
2028 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, 2029 snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
2029 present ? 1 : 3); 2030 present ? 1 : 3);
2030} 2031}
@@ -2063,13 +2064,13 @@ static void cxt5066_thinkpad_automic(struct hda_codec *codec)
2063 ext_present = snd_hda_jack_detect(codec, 0x1b); 2064 ext_present = snd_hda_jack_detect(codec, 0x1b);
2064 dock_present = snd_hda_jack_detect(codec, 0x1a); 2065 dock_present = snd_hda_jack_detect(codec, 0x1a);
2065 if (ext_present) { 2066 if (ext_present) {
2066 snd_printdd("CXT5066: external microphone detected\n"); 2067 codec_dbg(codec, "CXT5066: external microphone detected\n");
2067 snd_hda_sequence_write(codec, ext_mic_present); 2068 snd_hda_sequence_write(codec, ext_mic_present);
2068 } else if (dock_present) { 2069 } else if (dock_present) {
2069 snd_printdd("CXT5066: dock microphone detected\n"); 2070 codec_dbg(codec, "CXT5066: dock microphone detected\n");
2070 snd_hda_sequence_write(codec, dock_mic_present); 2071 snd_hda_sequence_write(codec, dock_mic_present);
2071 } else { 2072 } else {
2072 snd_printdd("CXT5066: external microphone absent\n"); 2073 codec_dbg(codec, "CXT5066: external microphone absent\n");
2073 snd_hda_sequence_write(codec, ext_mic_absent); 2074 snd_hda_sequence_write(codec, ext_mic_absent);
2074 } 2075 }
2075} 2076}
@@ -2088,7 +2089,7 @@ static void cxt5066_hp_automute(struct hda_codec *codec)
2088 2089
2089 spec->hp_present = portA ? HP_PRESENT_PORT_A : 0; 2090 spec->hp_present = portA ? HP_PRESENT_PORT_A : 0;
2090 spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0; 2091 spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0;
2091 snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n", 2092 codec_dbg(codec, "CXT5066: hp automute portA=%x portD=%x present=%d\n",
2092 portA, portD, spec->hp_present); 2093 portA, portD, spec->hp_present);
2093 cxt5066_update_speaker(codec); 2094 cxt5066_update_speaker(codec);
2094} 2095}
@@ -2113,7 +2114,7 @@ static void cxt5066_automic(struct hda_codec *codec)
2113/* unsolicited event for jack sensing */ 2114/* unsolicited event for jack sensing */
2114static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res) 2115static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res)
2115{ 2116{
2116 snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); 2117 codec_dbg(codec, "CXT5066: unsol event %x (%x)\n", res, res >> 26);
2117 switch (res >> 26) { 2118 switch (res >> 26) {
2118 case CONEXANT_HP_EVENT: 2119 case CONEXANT_HP_EVENT:
2119 cxt5066_hp_automute(codec); 2120 cxt5066_hp_automute(codec);
@@ -2509,7 +2510,7 @@ static const struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
2509/* initialize jack-sensing, too */ 2510/* initialize jack-sensing, too */
2510static int cxt5066_init(struct hda_codec *codec) 2511static int cxt5066_init(struct hda_codec *codec)
2511{ 2512{
2512 snd_printdd("CXT5066: init\n"); 2513 codec_dbg(codec, "CXT5066: init\n");
2513 conexant_init(codec); 2514 conexant_init(codec);
2514 if (codec->patch_ops.unsol_event) { 2515 if (codec->patch_ops.unsol_event) {
2515 cxt5066_hp_automute(codec); 2516 cxt5066_hp_automute(codec);
@@ -3401,8 +3402,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
3401 struct conexant_spec *spec; 3402 struct conexant_spec *spec;
3402 int err; 3403 int err;
3403 3404
3404 printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", 3405 codec_info(codec, "%s: BIOS auto-probing.\n", codec->chip_name);
3405 codec->chip_name);
3406 3406
3407 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 3407 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
3408 if (!spec) 3408 if (!spec)
@@ -3474,7 +3474,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
3474 * Better to make reset, then. 3474 * Better to make reset, then.
3475 */ 3475 */
3476 if (!codec->bus->sync_write) { 3476 if (!codec->bus->sync_write) {
3477 snd_printd("hda_codec: " 3477 codec_info(codec,
3478 "Enable sync_write for stable communication\n"); 3478 "Enable sync_write for stable communication\n");
3479 codec->bus->sync_write = 1; 3479 codec->bus->sync_write = 1;
3480 codec->bus->allow_bus_reset = 1; 3480 codec->bus->allow_bus_reset = 1;
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 5ef95034d041..994713cb07bc 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -353,40 +353,43 @@ static struct cea_channel_speaker_allocation channel_allocations[] = {
353#define get_pcm_rec(spec, idx) \ 353#define get_pcm_rec(spec, idx) \
354 ((struct hda_pcm *)snd_array_elem(&spec->pcm_rec, idx)) 354 ((struct hda_pcm *)snd_array_elem(&spec->pcm_rec, idx))
355 355
356static int pin_nid_to_pin_index(struct hdmi_spec *spec, hda_nid_t pin_nid) 356static int pin_nid_to_pin_index(struct hda_codec *codec, hda_nid_t pin_nid)
357{ 357{
358 struct hdmi_spec *spec = codec->spec;
358 int pin_idx; 359 int pin_idx;
359 360
360 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) 361 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++)
361 if (get_pin(spec, pin_idx)->pin_nid == pin_nid) 362 if (get_pin(spec, pin_idx)->pin_nid == pin_nid)
362 return pin_idx; 363 return pin_idx;
363 364
364 snd_printk(KERN_WARNING "HDMI: pin nid %d not registered\n", pin_nid); 365 codec_warn(codec, "HDMI: pin nid %d not registered\n", pin_nid);
365 return -EINVAL; 366 return -EINVAL;
366} 367}
367 368
368static int hinfo_to_pin_index(struct hdmi_spec *spec, 369static int hinfo_to_pin_index(struct hda_codec *codec,
369 struct hda_pcm_stream *hinfo) 370 struct hda_pcm_stream *hinfo)
370{ 371{
372 struct hdmi_spec *spec = codec->spec;
371 int pin_idx; 373 int pin_idx;
372 374
373 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) 375 for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++)
374 if (get_pcm_rec(spec, pin_idx)->stream == hinfo) 376 if (get_pcm_rec(spec, pin_idx)->stream == hinfo)
375 return pin_idx; 377 return pin_idx;
376 378
377 snd_printk(KERN_WARNING "HDMI: hinfo %p not registered\n", hinfo); 379 codec_warn(codec, "HDMI: hinfo %p not registered\n", hinfo);
378 return -EINVAL; 380 return -EINVAL;
379} 381}
380 382
381static int cvt_nid_to_cvt_index(struct hdmi_spec *spec, hda_nid_t cvt_nid) 383static int cvt_nid_to_cvt_index(struct hda_codec *codec, hda_nid_t cvt_nid)
382{ 384{
385 struct hdmi_spec *spec = codec->spec;
383 int cvt_idx; 386 int cvt_idx;
384 387
385 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) 388 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++)
386 if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid) 389 if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid)
387 return cvt_idx; 390 return cvt_idx;
388 391
389 snd_printk(KERN_WARNING "HDMI: cvt nid %d not registered\n", cvt_nid); 392 codec_warn(codec, "HDMI: cvt nid %d not registered\n", cvt_nid);
390 return -EINVAL; 393 return -EINVAL;
391} 394}
392 395
@@ -706,7 +709,7 @@ static void hdmi_debug_channel_mapping(struct hda_codec *codec,
706 709
707 for (i = 0; i < 8; i++) { 710 for (i = 0; i < 8; i++) {
708 channel = spec->ops.pin_get_slot_channel(codec, pin_nid, i); 711 channel = spec->ops.pin_get_slot_channel(codec, pin_nid, i);
709 printk(KERN_DEBUG "HDMI: ASP channel %d => slot %d\n", 712 codec_dbg(codec, "HDMI: ASP channel %d => slot %d\n",
710 channel, i); 713 channel, i);
711 } 714 }
712#endif 715#endif
@@ -755,8 +758,7 @@ static void hdmi_std_setup_channel_mapping(struct hda_codec *codec,
755 int channel = (slotsetup & 0xf0) >> 4; 758 int channel = (slotsetup & 0xf0) >> 4;
756 err = spec->ops.pin_set_slot_channel(codec, pin_nid, hdmi_slot, channel); 759 err = spec->ops.pin_set_slot_channel(codec, pin_nid, hdmi_slot, channel);
757 if (err) { 760 if (err) {
758 snd_printdd(KERN_NOTICE 761 codec_dbg(codec, "HDMI: channel mapping failed\n");
759 "HDMI: channel mapping failed\n");
760 break; 762 break;
761 } 763 }
762 } 764 }
@@ -967,12 +969,12 @@ static void hdmi_debug_dip_size(struct hda_codec *codec, hda_nid_t pin_nid)
967 int size; 969 int size;
968 970
969 size = snd_hdmi_get_eld_size(codec, pin_nid); 971 size = snd_hdmi_get_eld_size(codec, pin_nid);
970 printk(KERN_DEBUG "HDMI: ELD buf size is %d\n", size); 972 codec_dbg(codec, "HDMI: ELD buf size is %d\n", size);
971 973
972 for (i = 0; i < 8; i++) { 974 for (i = 0; i < 8; i++) {
973 size = snd_hda_codec_read(codec, pin_nid, 0, 975 size = snd_hda_codec_read(codec, pin_nid, 0,
974 AC_VERB_GET_HDMI_DIP_SIZE, i); 976 AC_VERB_GET_HDMI_DIP_SIZE, i);
975 printk(KERN_DEBUG "HDMI: DIP GP[%d] buf size is %d\n", i, size); 977 codec_dbg(codec, "HDMI: DIP GP[%d] buf size is %d\n", i, size);
976 } 978 }
977#endif 979#endif
978} 980}
@@ -994,12 +996,12 @@ static void hdmi_clear_dip_buffers(struct hda_codec *codec, hda_nid_t pin_nid)
994 hdmi_write_dip_byte(codec, pin_nid, 0x0); 996 hdmi_write_dip_byte(codec, pin_nid, 0x0);
995 hdmi_get_dip_index(codec, pin_nid, &pi, &bi); 997 hdmi_get_dip_index(codec, pin_nid, &pi, &bi);
996 if (pi != i) 998 if (pi != i)
997 snd_printd(KERN_INFO "dip index %d: %d != %d\n", 999 codec_dbg(codec, "dip index %d: %d != %d\n",
998 bi, pi, i); 1000 bi, pi, i);
999 if (bi == 0) /* byte index wrapped around */ 1001 if (bi == 0) /* byte index wrapped around */
1000 break; 1002 break;
1001 } 1003 }
1002 snd_printd(KERN_INFO 1004 codec_dbg(codec,
1003 "HDMI: DIP GP[%d] buf reported size=%d, written=%d\n", 1005 "HDMI: DIP GP[%d] buf reported size=%d, written=%d\n",
1004 i, size, j); 1006 i, size, j);
1005 } 1007 }
@@ -1080,7 +1082,7 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec,
1080 dp_ai->CC02_CT47 = active_channels - 1; 1082 dp_ai->CC02_CT47 = active_channels - 1;
1081 dp_ai->CA = ca; 1083 dp_ai->CA = ca;
1082 } else { 1084 } else {
1083 snd_printd("HDMI: unknown connection type at pin %d\n", 1085 codec_dbg(codec, "HDMI: unknown connection type at pin %d\n",
1084 pin_nid); 1086 pin_nid);
1085 return; 1087 return;
1086 } 1088 }
@@ -1092,8 +1094,8 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec,
1092 */ 1094 */
1093 if (!hdmi_infoframe_uptodate(codec, pin_nid, ai.bytes, 1095 if (!hdmi_infoframe_uptodate(codec, pin_nid, ai.bytes,
1094 sizeof(ai))) { 1096 sizeof(ai))) {
1095 snd_printdd("hdmi_pin_setup_infoframe: " 1097 codec_dbg(codec,
1096 "pin=%d channels=%d ca=0x%02x\n", 1098 "hdmi_pin_setup_infoframe: pin=%d channels=%d ca=0x%02x\n",
1097 pin_nid, 1099 pin_nid,
1098 active_channels, ca); 1100 active_channels, ca);
1099 hdmi_stop_infoframe_trans(codec, pin_nid); 1101 hdmi_stop_infoframe_trans(codec, pin_nid);
@@ -1161,7 +1163,7 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll);
1161static void jack_callback(struct hda_codec *codec, struct hda_jack_tbl *jack) 1163static void jack_callback(struct hda_codec *codec, struct hda_jack_tbl *jack)
1162{ 1164{
1163 struct hdmi_spec *spec = codec->spec; 1165 struct hdmi_spec *spec = codec->spec;
1164 int pin_idx = pin_nid_to_pin_index(spec, jack->nid); 1166 int pin_idx = pin_nid_to_pin_index(codec, jack->nid);
1165 if (pin_idx < 0) 1167 if (pin_idx < 0)
1166 return; 1168 return;
1167 1169
@@ -1180,7 +1182,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
1180 return; 1182 return;
1181 jack->jack_dirty = 1; 1183 jack->jack_dirty = 1;
1182 1184
1183 _snd_printd(SND_PR_VERBOSE, 1185 codec_dbg(codec,
1184 "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n", 1186 "HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n",
1185 codec->addr, jack->nid, dev_entry, !!(res & AC_UNSOL_RES_IA), 1187 codec->addr, jack->nid, dev_entry, !!(res & AC_UNSOL_RES_IA),
1186 !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV)); 1188 !!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
@@ -1195,7 +1197,7 @@ static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
1195 int cp_state = !!(res & AC_UNSOL_RES_CP_STATE); 1197 int cp_state = !!(res & AC_UNSOL_RES_CP_STATE);
1196 int cp_ready = !!(res & AC_UNSOL_RES_CP_READY); 1198 int cp_ready = !!(res & AC_UNSOL_RES_CP_READY);
1197 1199
1198 printk(KERN_INFO 1200 codec_info(codec,
1199 "HDMI CP event: CODEC=%d TAG=%d SUBTAG=0x%x CP_STATE=%d CP_READY=%d\n", 1201 "HDMI CP event: CODEC=%d TAG=%d SUBTAG=0x%x CP_STATE=%d CP_READY=%d\n",
1200 codec->addr, 1202 codec->addr,
1201 tag, 1203 tag,
@@ -1217,7 +1219,7 @@ static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res)
1217 int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; 1219 int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT;
1218 1220
1219 if (!snd_hda_jack_tbl_get_from_tag(codec, tag)) { 1221 if (!snd_hda_jack_tbl_get_from_tag(codec, tag)) {
1220 snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag); 1222 codec_dbg(codec, "Unexpected HDMI event tag 0x%x\n", tag);
1221 return; 1223 return;
1222 } 1224 }
1223 1225
@@ -1244,7 +1246,7 @@ static void haswell_verify_D0(struct hda_codec *codec,
1244 msleep(40); 1246 msleep(40);
1245 pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0); 1247 pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
1246 pwr = (pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT; 1248 pwr = (pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT;
1247 snd_printd("Haswell HDMI audio: Power for pin 0x%x is now D%d\n", nid, pwr); 1249 codec_dbg(codec, "Haswell HDMI audio: Power for pin 0x%x is now D%d\n", nid, pwr);
1248 } 1250 }
1249} 1251}
1250 1252
@@ -1274,8 +1276,8 @@ static int hdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid,
1274 else 1276 else
1275 new_pinctl |= AC_PINCTL_EPT_NATIVE; 1277 new_pinctl |= AC_PINCTL_EPT_NATIVE;
1276 1278
1277 snd_printdd("hdmi_pin_hbr_setup: " 1279 codec_dbg(codec,
1278 "NID=0x%x, %spinctl=0x%x\n", 1280 "hdmi_pin_hbr_setup: NID=0x%x, %spinctl=0x%x\n",
1279 pin_nid, 1281 pin_nid,
1280 pinctl == new_pinctl ? "" : "new-", 1282 pinctl == new_pinctl ? "" : "new-",
1281 new_pinctl); 1283 new_pinctl);
@@ -1302,7 +1304,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid,
1302 err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format)); 1304 err = spec->ops.pin_hbr_setup(codec, pin_nid, is_hbr_format(format));
1303 1305
1304 if (err) { 1306 if (err) {
1305 snd_printdd("hdmi_setup_stream: HBR is not supported\n"); 1307 codec_dbg(codec, "hdmi_setup_stream: HBR is not supported\n");
1306 return err; 1308 return err;
1307 } 1309 }
1308 1310
@@ -1389,7 +1391,8 @@ static void intel_not_share_assigned_cvt(struct hda_codec *codec,
1389 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { 1391 for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) {
1390 per_cvt = get_cvt(spec, cvt_idx); 1392 per_cvt = get_cvt(spec, cvt_idx);
1391 if (!per_cvt->assigned) { 1393 if (!per_cvt->assigned) {
1392 snd_printdd("choose cvt %d for pin nid %d\n", 1394 codec_dbg(codec,
1395 "choose cvt %d for pin nid %d\n",
1393 cvt_idx, nid); 1396 cvt_idx, nid);
1394 snd_hda_codec_write_cache(codec, nid, 0, 1397 snd_hda_codec_write_cache(codec, nid, 0,
1395 AC_VERB_SET_CONNECT_SEL, 1398 AC_VERB_SET_CONNECT_SEL,
@@ -1416,7 +1419,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
1416 int err; 1419 int err;
1417 1420
1418 /* Validate hinfo */ 1421 /* Validate hinfo */
1419 pin_idx = hinfo_to_pin_index(spec, hinfo); 1422 pin_idx = hinfo_to_pin_index(codec, hinfo);
1420 if (snd_BUG_ON(pin_idx < 0)) 1423 if (snd_BUG_ON(pin_idx < 0))
1421 return -EINVAL; 1424 return -EINVAL;
1422 per_pin = get_pin(spec, pin_idx); 1425 per_pin = get_pin(spec, pin_idx);
@@ -1482,9 +1485,8 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
1482 hda_nid_t pin_nid = per_pin->pin_nid; 1485 hda_nid_t pin_nid = per_pin->pin_nid;
1483 1486
1484 if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) { 1487 if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) {
1485 snd_printk(KERN_WARNING 1488 codec_warn(codec,
1486 "HDMI: pin %d wcaps %#x " 1489 "HDMI: pin %d wcaps %#x does not support connection list\n",
1487 "does not support connection list\n",
1488 pin_nid, get_wcaps(codec, pin_nid)); 1490 pin_nid, get_wcaps(codec, pin_nid));
1489 return -EINVAL; 1491 return -EINVAL;
1490 } 1492 }
@@ -1527,7 +1529,7 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
1527 else 1529 else
1528 eld->eld_valid = false; 1530 eld->eld_valid = false;
1529 1531
1530 _snd_printd(SND_PR_VERBOSE, 1532 codec_dbg(codec,
1531 "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", 1533 "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
1532 codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid); 1534 codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid);
1533 1535
@@ -1690,7 +1692,7 @@ static int hdmi_parse_codec(struct hda_codec *codec)
1690 1692
1691 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); 1693 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
1692 if (!nid || nodes < 0) { 1694 if (!nid || nodes < 0) {
1693 snd_printk(KERN_WARNING "HDMI: failed to get afg sub nodes\n"); 1695 codec_warn(codec, "HDMI: failed to get afg sub nodes\n");
1694 return -EINVAL; 1696 return -EINVAL;
1695 } 1697 }
1696 1698
@@ -1744,7 +1746,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
1744{ 1746{
1745 hda_nid_t cvt_nid = hinfo->nid; 1747 hda_nid_t cvt_nid = hinfo->nid;
1746 struct hdmi_spec *spec = codec->spec; 1748 struct hdmi_spec *spec = codec->spec;
1747 int pin_idx = hinfo_to_pin_index(spec, hinfo); 1749 int pin_idx = hinfo_to_pin_index(codec, hinfo);
1748 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); 1750 struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
1749 hda_nid_t pin_nid = per_pin->pin_nid; 1751 hda_nid_t pin_nid = per_pin->pin_nid;
1750 bool non_pcm; 1752 bool non_pcm;
@@ -1788,7 +1790,7 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
1788 int pinctl; 1790 int pinctl;
1789 1791
1790 if (hinfo->nid) { 1792 if (hinfo->nid) {
1791 cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid); 1793 cvt_idx = cvt_nid_to_cvt_index(codec, hinfo->nid);
1792 if (snd_BUG_ON(cvt_idx < 0)) 1794 if (snd_BUG_ON(cvt_idx < 0))
1793 return -EINVAL; 1795 return -EINVAL;
1794 per_cvt = get_cvt(spec, cvt_idx); 1796 per_cvt = get_cvt(spec, cvt_idx);
@@ -1797,7 +1799,7 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
1797 per_cvt->assigned = 0; 1799 per_cvt->assigned = 0;
1798 hinfo->nid = 0; 1800 hinfo->nid = 0;
1799 1801
1800 pin_idx = hinfo_to_pin_index(spec, hinfo); 1802 pin_idx = hinfo_to_pin_index(codec, hinfo);
1801 if (snd_BUG_ON(pin_idx < 0)) 1803 if (snd_BUG_ON(pin_idx < 0))
1802 return -EINVAL; 1804 return -EINVAL;
1803 per_pin = get_pin(spec, pin_idx); 1805 per_pin = get_pin(spec, pin_idx);
@@ -2211,7 +2213,7 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
2211 return; 2213 return;
2212 2214
2213 /* override pins connection list */ 2215 /* override pins connection list */
2214 snd_printdd("hdmi: haswell: override pin connection 0x%x\n", nid); 2216 codec_dbg(codec, "hdmi: haswell: override pin connection 0x%x\n", nid);
2215 snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); 2217 snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids);
2216} 2218}
2217 2219
@@ -3132,8 +3134,8 @@ static int atihdmi_pin_hbr_setup(struct hda_codec *codec, hda_nid_t pin_nid,
3132 else 3134 else
3133 hbr_ctl_new = hbr_ctl & ~ATI_HBR_ENABLE; 3135 hbr_ctl_new = hbr_ctl & ~ATI_HBR_ENABLE;
3134 3136
3135 snd_printdd("atihdmi_pin_hbr_setup: " 3137 codec_dbg(codec,
3136 "NID=0x%x, %shbr-ctl=0x%x\n", 3138 "atihdmi_pin_hbr_setup: NID=0x%x, %shbr-ctl=0x%x\n",
3137 pin_nid, 3139 pin_nid,
3138 hbr_ctl == hbr_ctl_new ? "" : "new-", 3140 hbr_ctl == hbr_ctl_new ? "" : "new-",
3139 hbr_ctl_new); 3141 hbr_ctl_new);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ee1ba2293b23..c2322209d6c3 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -407,8 +407,8 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
407 ass = snd_hda_codec_get_pincfg(codec, nid); 407 ass = snd_hda_codec_get_pincfg(codec, nid);
408 408
409 if (!(ass & 1)) { 409 if (!(ass & 1)) {
410 printk(KERN_INFO "hda_codec: %s: SKU not ready 0x%08x\n", 410 codec_info(codec, "%s: SKU not ready 0x%08x\n",
411 codec->chip_name, ass); 411 codec->chip_name, ass);
412 return -1; 412 return -1;
413 } 413 }
414 414
@@ -432,17 +432,17 @@ do_sku:
432 spec->cdefine.swap = (ass & 0x2) >> 1; 432 spec->cdefine.swap = (ass & 0x2) >> 1;
433 spec->cdefine.override = ass & 0x1; 433 spec->cdefine.override = ass & 0x1;
434 434
435 snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n", 435 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
436 nid, spec->cdefine.sku_cfg); 436 nid, spec->cdefine.sku_cfg);
437 snd_printd("SKU: port_connectivity=0x%x\n", 437 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
438 spec->cdefine.port_connectivity); 438 spec->cdefine.port_connectivity);
439 snd_printd("SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); 439 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
440 snd_printd("SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); 440 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
441 snd_printd("SKU: customization=0x%08x\n", spec->cdefine.customization); 441 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
442 snd_printd("SKU: external_amp=0x%x\n", spec->cdefine.external_amp); 442 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
443 snd_printd("SKU: platform_type=0x%x\n", spec->cdefine.platform_type); 443 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
444 snd_printd("SKU: swap=0x%x\n", spec->cdefine.swap); 444 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
445 snd_printd("SKU: override=0x%x\n", spec->cdefine.override); 445 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
446 446
447 return 0; 447 return 0;
448} 448}
@@ -502,8 +502,8 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
502 if (codec->vendor_id == 0x10ec0260) 502 if (codec->vendor_id == 0x10ec0260)
503 nid = 0x17; 503 nid = 0x17;
504 ass = snd_hda_codec_get_pincfg(codec, nid); 504 ass = snd_hda_codec_get_pincfg(codec, nid);
505 snd_printd("realtek: No valid SSID, " 505 codec_dbg(codec,
506 "checking pincfg 0x%08x for NID 0x%x\n", 506 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
507 ass, nid); 507 ass, nid);
508 if (!(ass & 1)) 508 if (!(ass & 1))
509 return 0; 509 return 0;
@@ -519,7 +519,7 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
519 if (((ass >> 16) & 0xf) != tmp) 519 if (((ass >> 16) & 0xf) != tmp)
520 return 0; 520 return 0;
521do_sku: 521do_sku:
522 snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", 522 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
523 ass & 0xffff, codec->vendor_id); 523 ass & 0xffff, codec->vendor_id);
524 /* 524 /*
525 * 0 : override 525 * 0 : override
@@ -577,8 +577,8 @@ static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
577{ 577{
578 if (!alc_subsystem_id(codec, ports)) { 578 if (!alc_subsystem_id(codec, ports)) {
579 struct alc_spec *spec = codec->spec; 579 struct alc_spec *spec = codec->spec;
580 snd_printd("realtek: " 580 codec_dbg(codec,
581 "Enable default setup for auto mode as fallback\n"); 581 "realtek: Enable default setup for auto mode as fallback\n");
582 spec->init_amp = ALC_INIT_DEFAULT; 582 spec->init_amp = ALC_INIT_DEFAULT;
583 } 583 }
584} 584}
@@ -3170,7 +3170,8 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
3170 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; 3170 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3171 spec->gen.vmaster_mute_enum = 1; 3171 spec->gen.vmaster_mute_enum = 1;
3172 codec->power_filter = led_power_filter; 3172 codec->power_filter = led_power_filter;
3173 snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid, 3173 codec_dbg(codec,
3174 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
3174 spec->mute_led_polarity); 3175 spec->mute_led_polarity);
3175 break; 3176 break;
3176 } 3177 }
@@ -3296,7 +3297,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
3296 alc_write_coef_idx(codec, 0xb7, 0x802b); 3297 alc_write_coef_idx(codec, 0xb7, 0x802b);
3297 break; 3298 break;
3298 } 3299 }
3299 snd_printdd("Headset jack set to unplugged mode.\n"); 3300 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
3300} 3301}
3301 3302
3302 3303
@@ -3339,7 +3340,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
3339 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); 3340 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
3340 break; 3341 break;
3341 } 3342 }
3342 snd_printdd("Headset jack set to mic-in mode.\n"); 3343 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
3343} 3344}
3344 3345
3345static void alc_headset_mode_default(struct hda_codec *codec) 3346static void alc_headset_mode_default(struct hda_codec *codec)
@@ -3367,7 +3368,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
3367 alc_write_coef_idx(codec, 0xb7, 0x802b); 3368 alc_write_coef_idx(codec, 0xb7, 0x802b);
3368 break; 3369 break;
3369 } 3370 }
3370 snd_printdd("Headset jack set to headphone (default) mode.\n"); 3371 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
3371} 3372}
3372 3373
3373/* Iphone type */ 3374/* Iphone type */
@@ -3396,7 +3397,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
3396 alc_write_coef_idx(codec, 0xc3, 0x0000); 3397 alc_write_coef_idx(codec, 0xc3, 0x0000);
3397 break; 3398 break;
3398 } 3399 }
3399 snd_printdd("Headset jack set to iPhone-style headset mode.\n"); 3400 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
3400} 3401}
3401 3402
3402/* Nokia type */ 3403/* Nokia type */
@@ -3425,7 +3426,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
3425 alc_write_coef_idx(codec, 0xc3, 0x0000); 3426 alc_write_coef_idx(codec, 0xc3, 0x0000);
3426 break; 3427 break;
3427 } 3428 }
3428 snd_printdd("Headset jack set to Nokia-style headset mode.\n"); 3429 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
3429} 3430}
3430 3431
3431static void alc_determine_headset_type(struct hda_codec *codec) 3432static void alc_determine_headset_type(struct hda_codec *codec)
@@ -3467,7 +3468,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
3467 break; 3468 break;
3468 } 3469 }
3469 3470
3470 snd_printdd("Headset jack detected iPhone-style headset: %s\n", 3471 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
3471 is_ctia ? "yes" : "no"); 3472 is_ctia ? "yes" : "no");
3472 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; 3473 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
3473} 3474}
@@ -4901,8 +4902,7 @@ static void alc272_fixup_mario(struct hda_codec *codec,
4901 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | 4902 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
4902 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | 4903 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
4903 (0 << AC_AMPCAP_MUTE_SHIFT))) 4904 (0 << AC_AMPCAP_MUTE_SHIFT)))
4904 printk(KERN_WARNING 4905 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
4905 "hda_codec: failed to override amp caps for NID 0x2\n");
4906} 4906}
4907 4907
4908static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { 4908static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c
index 6679a5095e55..3208ad69583e 100644
--- a/sound/pci/hda/patch_si3054.c
+++ b/sound/pci/hda/patch_si3054.c
@@ -236,7 +236,7 @@ static int si3054_init(struct hda_codec *codec)
236 } while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--); 236 } while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--);
237 237
238 if((val&SI3054_MEI_READY) != SI3054_MEI_READY) { 238 if((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
239 snd_printk(KERN_ERR "si3054: cannot initialize. EXT MID = %04x\n", val); 239 codec_err(codec, "si3054: cannot initialize. EXT MID = %04x\n", val);
240 /* let's pray that this is no fatal error */ 240 /* let's pray that this is no fatal error */
241 /* return -EACCES; */ 241 /* return -EACCES; */
242 } 242 }
@@ -247,7 +247,8 @@ static int si3054_init(struct hda_codec *codec)
247 SET_REG(codec, SI3054_LINE_CFG1,0x200); 247 SET_REG(codec, SI3054_LINE_CFG1,0x200);
248 248
249 if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) { 249 if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
250 snd_printd("Link Frame Detect(FDT) is not ready (line status: %04x)\n", 250 codec_dbg(codec,
251 "Link Frame Detect(FDT) is not ready (line status: %04x)\n",
251 GET_REG(codec,SI3054_LINE_STATUS)); 252 GET_REG(codec,SI3054_LINE_STATUS));
252 } 253 }
253 254
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 3bc29c9b2529..f3784808758e 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -296,7 +296,7 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
296{ 296{
297 unsigned int gpiostate, gpiomask, gpiodir; 297 unsigned int gpiostate, gpiomask, gpiodir;
298 298
299 snd_printdd("%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); 299 codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
300 300
301 gpiostate = snd_hda_codec_read(codec, codec->afg, 0, 301 gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
302 AC_VERB_GET_GPIO_DATA, 0); 302 AC_VERB_GET_GPIO_DATA, 0);
@@ -359,7 +359,7 @@ static int stac_vrefout_set(struct hda_codec *codec,
359{ 359{
360 int error, pinctl; 360 int error, pinctl;
361 361
362 snd_printdd("%s, nid %x ctl %x\n", __func__, nid, new_vref); 362 codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref);
363 pinctl = snd_hda_codec_read(codec, nid, 0, 363 pinctl = snd_hda_codec_read(codec, nid, 0,
364 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 364 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
365 365
@@ -2086,7 +2086,7 @@ static void stac92hd83xxx_fixup_hp(struct hda_codec *codec,
2086 } 2086 }
2087 2087
2088 if (find_mute_led_cfg(codec, spec->default_polarity)) 2088 if (find_mute_led_cfg(codec, spec->default_polarity))
2089 snd_printd("mute LED gpio %d polarity %d\n", 2089 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
2090 spec->gpio_led, 2090 spec->gpio_led,
2091 spec->gpio_led_polarity); 2091 spec->gpio_led_polarity);
2092} 2092}
@@ -3077,7 +3077,7 @@ static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
3077 } 3077 }
3078 3078
3079 if (find_mute_led_cfg(codec, 1)) 3079 if (find_mute_led_cfg(codec, 1))
3080 snd_printd("mute LED gpio %d polarity %d\n", 3080 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
3081 spec->gpio_led, 3081 spec->gpio_led,
3082 spec->gpio_led_polarity); 3082 spec->gpio_led_polarity);
3083 3083
@@ -4422,8 +4422,8 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
4422 4422
4423 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; 4423 num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1;
4424 if (num_dacs < 3 || num_dacs > 5) { 4424 if (num_dacs < 3 || num_dacs > 5) {
4425 printk(KERN_WARNING "hda_codec: Could not determine " 4425 codec_warn(codec,
4426 "number of channels defaulting to DAC count\n"); 4426 "Could not determine number of channels defaulting to DAC count\n");
4427 num_dacs = 5; 4427 num_dacs = 5;
4428 } 4428 }
4429 4429
diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c
index 8fe3b8c18ed4..6ba0b5517c40 100644
--- a/sound/pci/hda/thinkpad_helper.c
+++ b/sound/pci/hda/thinkpad_helper.c
@@ -63,7 +63,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
63 if (!led_set_func) 63 if (!led_set_func)
64 led_set_func = symbol_request(tpacpi_led_set); 64 led_set_func = symbol_request(tpacpi_led_set);
65 if (!led_set_func) { 65 if (!led_set_func) {
66 snd_printk(KERN_WARNING "Failed to find thinkpad-acpi symbol tpacpi_led_set\n"); 66 codec_warn(codec,
67 "Failed to find thinkpad-acpi symbol tpacpi_led_set\n");
67 return; 68 return;
68 } 69 }
69 70
@@ -75,7 +76,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
75 } 76 }
76 if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) { 77 if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
77 if (spec->num_adc_nids > 1) 78 if (spec->num_adc_nids > 1)
78 snd_printdd("Skipping micmute LED control due to several ADCs"); 79 codec_dbg(codec,
80 "Skipping micmute LED control due to several ADCs");
79 else { 81 else {
80 spec->cap_sync_hook = update_tpacpi_micmute_led; 82 spec->cap_sync_hook = update_tpacpi_micmute_led;
81 removefunc = false; 83 removefunc = false;