Commit 4e76a883 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent b989d044
...@@ -313,9 +313,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, ...@@ -313,9 +313,9 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
} }
if (hsmic) if (hsmic)
snd_printdd("Told to look for a headset mic, but didn't find any.\n"); codec_dbg(codec, "Told to look for a headset mic, but didn't find any.\n");
if (hpmic) if (hpmic)
snd_printdd("Told to look for a headphone mic, but didn't find any.\n"); codec_dbg(codec, "Told to look for a headphone mic, but didn't find any.\n");
} }
/* FIX-UP: /* FIX-UP:
...@@ -384,33 +384,33 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec, ...@@ -384,33 +384,33 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
/* /*
* debug prints of the parsed results * debug prints of the parsed results
*/ */
snd_printd("autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n", codec_info(codec, "autoconfig: line_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x) type:%s\n",
cfg->line_outs, cfg->line_out_pins[0], cfg->line_out_pins[1], cfg->line_outs, cfg->line_out_pins[0], cfg->line_out_pins[1],
cfg->line_out_pins[2], cfg->line_out_pins[3], cfg->line_out_pins[2], cfg->line_out_pins[3],
cfg->line_out_pins[4], cfg->line_out_pins[4],
cfg->line_out_type == AUTO_PIN_HP_OUT ? "hp" : cfg->line_out_type == AUTO_PIN_HP_OUT ? "hp" :
(cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ? (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT ?
"speaker" : "line")); "speaker" : "line"));
snd_printd(" speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n", codec_info(codec, " speaker_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
cfg->speaker_outs, cfg->speaker_pins[0], cfg->speaker_outs, cfg->speaker_pins[0],
cfg->speaker_pins[1], cfg->speaker_pins[2], cfg->speaker_pins[1], cfg->speaker_pins[2],
cfg->speaker_pins[3], cfg->speaker_pins[4]); cfg->speaker_pins[3], cfg->speaker_pins[4]);
snd_printd(" hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n", codec_info(codec, " hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
cfg->hp_outs, cfg->hp_pins[0], cfg->hp_outs, cfg->hp_pins[0],
cfg->hp_pins[1], cfg->hp_pins[2], cfg->hp_pins[1], cfg->hp_pins[2],
cfg->hp_pins[3], cfg->hp_pins[4]); cfg->hp_pins[3], cfg->hp_pins[4]);
snd_printd(" mono: mono_out=0x%x\n", cfg->mono_out_pin); codec_info(codec, " mono: mono_out=0x%x\n", cfg->mono_out_pin);
if (cfg->dig_outs) if (cfg->dig_outs)
snd_printd(" dig-out=0x%x/0x%x\n", codec_info(codec, " dig-out=0x%x/0x%x\n",
cfg->dig_out_pins[0], cfg->dig_out_pins[1]); cfg->dig_out_pins[0], cfg->dig_out_pins[1]);
snd_printd(" inputs:\n"); codec_info(codec, " inputs:\n");
for (i = 0; i < cfg->num_inputs; i++) { for (i = 0; i < cfg->num_inputs; i++) {
snd_printd(" %s=0x%x\n", codec_info(codec, " %s=0x%x\n",
hda_get_autocfg_input_label(codec, cfg, i), hda_get_autocfg_input_label(codec, cfg, i),
cfg->inputs[i].pin); cfg->inputs[i].pin);
} }
if (cfg->dig_in_pin) if (cfg->dig_in_pin)
snd_printd(" dig-in=0x%x\n", cfg->dig_in_pin); codec_info(codec, " dig-in=0x%x\n", cfg->dig_in_pin);
return 0; return 0;
} }
...@@ -774,38 +774,33 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth) ...@@ -774,38 +774,33 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
case HDA_FIXUP_PINS: case HDA_FIXUP_PINS:
if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins) if (action != HDA_FIXUP_ACT_PRE_PROBE || !fix->v.pins)
break; break;
snd_printdd(KERN_INFO SFX codec_dbg(codec, "%s: Apply pincfg for %s\n",
"%s: Apply pincfg for %s\n",
codec->chip_name, modelname); codec->chip_name, modelname);
snd_hda_apply_pincfgs(codec, fix->v.pins); snd_hda_apply_pincfgs(codec, fix->v.pins);
break; break;
case HDA_FIXUP_VERBS: case HDA_FIXUP_VERBS:
if (action != HDA_FIXUP_ACT_PROBE || !fix->v.verbs) if (action != HDA_FIXUP_ACT_PROBE || !fix->v.verbs)
break; break;
snd_printdd(KERN_INFO SFX codec_dbg(codec, "%s: Apply fix-verbs for %s\n",
"%s: Apply fix-verbs for %s\n",
codec->chip_name, modelname); codec->chip_name, modelname);
snd_hda_add_verbs(codec, fix->v.verbs); snd_hda_add_verbs(codec, fix->v.verbs);
break; break;
case HDA_FIXUP_FUNC: case HDA_FIXUP_FUNC:
if (!fix->v.func) if (!fix->v.func)
break; break;
snd_printdd(KERN_INFO SFX codec_dbg(codec, "%s: Apply fix-func for %s\n",
"%s: Apply fix-func for %s\n",
codec->chip_name, modelname); codec->chip_name, modelname);
fix->v.func(codec, fix, action); fix->v.func(codec, fix, action);
break; break;
case HDA_FIXUP_PINCTLS: case HDA_FIXUP_PINCTLS:
if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins) if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins)
break; break;
snd_printdd(KERN_INFO SFX codec_dbg(codec, "%s: Apply pinctl for %s\n",
"%s: Apply pinctl for %s\n",
codec->chip_name, modelname); codec->chip_name, modelname);
set_pin_targets(codec, fix->v.pins); set_pin_targets(codec, fix->v.pins);
break; break;
default: default:
snd_printk(KERN_ERR SFX codec_err(codec, "%s: Invalid fixup type %d\n",
"%s: Invalid fixup type %d\n",
codec->chip_name, fix->type); codec->chip_name, fix->type);
break; break;
} }
......
...@@ -172,7 +172,7 @@ static int snd_hda_do_attach(struct hda_beep *beep) ...@@ -172,7 +172,7 @@ static int snd_hda_do_attach(struct hda_beep *beep)
err = input_register_device(input_dev); err = input_register_device(input_dev);
if (err < 0) { if (err < 0) {
input_free_device(input_dev); input_free_device(input_dev);
printk(KERN_INFO "hda_beep: unable to register input device\n"); codec_err(codec, "hda_beep: unable to register input device\n");
return err; return err;
} }
beep->dev = input_dev; beep->dev = input_dev;
......
This diff is collapsed.
...@@ -153,7 +153,7 @@ static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid, ...@@ -153,7 +153,7 @@ static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid,
val = snd_hda_codec_read(codec, nid, 0, val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_HDMI_ELDD, byte_index); AC_VERB_GET_HDMI_ELDD, byte_index);
#ifdef BE_PARANOID #ifdef BE_PARANOID
printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); codec_info(codec, "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
#endif #endif
return val; return val;
} }
...@@ -332,11 +332,11 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid, ...@@ -332,11 +332,11 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
size = snd_hdmi_get_eld_size(codec, nid); size = snd_hdmi_get_eld_size(codec, nid);
if (size == 0) { if (size == 0) {
/* wfg: workaround for ASUS P5E-VM HDMI board */ /* wfg: workaround for ASUS P5E-VM HDMI board */
snd_printd(KERN_INFO "HDMI: ELD buf size is 0, force 128\n"); codec_info(codec, "HDMI: ELD buf size is 0, force 128\n");
size = 128; size = 128;
} }
if (size < ELD_FIXED_BYTES || size > ELD_MAX_SIZE) { if (size < ELD_FIXED_BYTES || size > ELD_MAX_SIZE) {
snd_printd(KERN_INFO "HDMI: invalid ELD buf size %d\n", size); codec_info(codec, "HDMI: invalid ELD buf size %d\n", size);
return -ERANGE; return -ERANGE;
} }
...@@ -348,8 +348,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid, ...@@ -348,8 +348,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
* Just abort. The caller will repoll after a while. * Just abort. The caller will repoll after a while.
*/ */
if (!(val & AC_ELDD_ELD_VALID)) { if (!(val & AC_ELDD_ELD_VALID)) {
snd_printd(KERN_INFO codec_info(codec, "HDMI: invalid ELD data byte %d\n", i);
"HDMI: invalid ELD data byte %d\n", i);
ret = -EINVAL; ret = -EINVAL;
goto error; goto error;
} }
...@@ -361,7 +360,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid, ...@@ -361,7 +360,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
* correctly writes ELD content before setting ELD_valid bit. * correctly writes ELD content before setting ELD_valid bit.
*/ */
if (!val && !i) { if (!val && !i) {
snd_printdd(KERN_INFO "HDMI: 0 ELD data\n"); codec_dbg(codec, "HDMI: 0 ELD data\n");
ret = -EINVAL; ret = -EINVAL;
goto error; goto error;
} }
...@@ -681,7 +680,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid, ...@@ -681,7 +680,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0); spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0);
if (spkalloc <= 0) { if (spkalloc <= 0) {
snd_printd(KERN_INFO "HDMI ATI/AMD: no speaker allocation for ELD\n"); codec_info(codec, "HDMI ATI/AMD: no speaker allocation for ELD\n");
return -EINVAL; return -EINVAL;
} }
...@@ -722,7 +721,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid, ...@@ -722,7 +721,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
if (sink_desc_len > ELD_MAX_MNL) { if (sink_desc_len > ELD_MAX_MNL) {
snd_printd(KERN_INFO "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n", codec_info(codec, "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n",
sink_desc_len); sink_desc_len);
sink_desc_len = ELD_MAX_MNL; sink_desc_len = ELD_MAX_MNL;
} }
...@@ -764,7 +763,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid, ...@@ -764,7 +763,7 @@ int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
} }
if (pos == ELD_FIXED_BYTES + sink_desc_len) { if (pos == ELD_FIXED_BYTES + sink_desc_len) {
snd_printd(KERN_INFO "HDMI ATI/AMD: no audio descriptors for ELD\n"); codec_info(codec, "HDMI ATI/AMD: no audio descriptors for ELD\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -346,7 +346,8 @@ static bool is_ctl_associated(struct hda_codec *codec, hda_nid_t nid, ...@@ -346,7 +346,8 @@ static bool is_ctl_associated(struct hda_codec *codec, hda_nid_t nid,
return is_ctl_used(codec, val, type); return is_ctl_used(codec, val, type);
} }
static void print_nid_path(const char *pfx, struct nid_path *path) static void print_nid_path(struct hda_codec *codec,
const char *pfx, struct nid_path *path)
{ {
char buf[40]; char buf[40];
int i; int i;
...@@ -358,7 +359,7 @@ static void print_nid_path(const char *pfx, struct nid_path *path) ...@@ -358,7 +359,7 @@ static void print_nid_path(const char *pfx, struct nid_path *path)
sprintf(tmp, ":%02x", path->path[i]); sprintf(tmp, ":%02x", path->path[i]);
strlcat(buf, tmp, sizeof(buf)); strlcat(buf, tmp, sizeof(buf));
} }
snd_printdd("%s path: depth=%d %s\n", pfx, path->depth, buf); codec_dbg(codec, "%s path: depth=%d %s\n", pfx, path->depth, buf);
} }
/* called recursively */ /* called recursively */
...@@ -1260,7 +1261,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, ...@@ -1260,7 +1261,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
dac = dacs[i] = 0; dac = dacs[i] = 0;
badness += bad->no_dac; badness += bad->no_dac;
} else { } else {
/* print_nid_path("output", path); */ /* print_nid_path(codec, "output", path); */
path->active = true; path->active = true;
path_idx[i] = snd_hda_get_path_idx(codec, path); path_idx[i] = snd_hda_get_path_idx(codec, path);
badness += assign_out_path_ctls(codec, path); badness += assign_out_path_ctls(codec, path);
...@@ -1387,7 +1388,7 @@ static int fill_multi_ios(struct hda_codec *codec, ...@@ -1387,7 +1388,7 @@ static int fill_multi_ios(struct hda_codec *codec,
badness++; badness++;
continue; continue;
} }
/* print_nid_path("multiio", path); */ /* print_nid_path(codec, "multiio", path); */
spec->multi_io[spec->multi_ios].pin = nid; spec->multi_io[spec->multi_ios].pin = nid;
spec->multi_io[spec->multi_ios].dac = dac; spec->multi_io[spec->multi_ios].dac = dac;
spec->out_paths[cfg->line_outs + spec->multi_ios] = spec->out_paths[cfg->line_outs + spec->multi_ios] =
...@@ -1444,7 +1445,7 @@ static bool map_singles(struct hda_codec *codec, int outs, ...@@ -1444,7 +1445,7 @@ static bool map_singles(struct hda_codec *codec, int outs,
if (path) { if (path) {
dacs[i] = dac; dacs[i] = dac;
found = true; found = true;
/* print_nid_path("output", path); */ /* print_nid_path(codec, "output", path); */
path->active = true; path->active = true;
path_idx[i] = snd_hda_get_path_idx(codec, path); path_idx[i] = snd_hda_get_path_idx(codec, path);
} }
...@@ -1482,7 +1483,7 @@ static int check_aamix_out_path(struct hda_codec *codec, int path_idx) ...@@ -1482,7 +1483,7 @@ static int check_aamix_out_path(struct hda_codec *codec, int path_idx)
} }
if (!path) if (!path)
return 0; return 0;
/* print_nid_path("output-aamix", path); */ /* print_nid_path(codec, "output-aamix", path); */
path->active = false; /* unused as default */ path->active = false; /* unused as default */
return snd_hda_get_path_idx(codec, path); return snd_hda_get_path_idx(codec, path);
} }
...@@ -1699,7 +1700,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec, ...@@ -1699,7 +1700,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
#define DEBUG_BADNESS #define DEBUG_BADNESS
#ifdef DEBUG_BADNESS #ifdef DEBUG_BADNESS
#define debug_badness snd_printdd #define debug_badness(fmt, args...) codec_dbg(codec, fmt, ##args)
#else #else
#define debug_badness(...) #define debug_badness(...)
#endif #endif
...@@ -1712,7 +1713,7 @@ static inline void print_nid_path_idx(struct hda_codec *codec, ...@@ -1712,7 +1713,7 @@ static inline void print_nid_path_idx(struct hda_codec *codec,
path = snd_hda_get_path_from_idx(codec, idx); path = snd_hda_get_path_from_idx(codec, idx);
if (path) if (path)
print_nid_path(pfx, path); print_nid_path(codec, pfx, path);
} }
static void debug_show_configs(struct hda_codec *codec, static void debug_show_configs(struct hda_codec *codec,
...@@ -1780,7 +1781,7 @@ static void fill_all_dac_nids(struct hda_codec *codec) ...@@ -1780,7 +1781,7 @@ static void fill_all_dac_nids(struct hda_codec *codec)
if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_AUD_OUT) if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_AUD_OUT)
continue; continue;
if (spec->num_all_dacs >= ARRAY_SIZE(spec->all_dacs)) { if (spec->num_all_dacs >= ARRAY_SIZE(spec->all_dacs)) {
snd_printk(KERN_ERR "hda: Too many DACs!\n"); codec_err(codec, "Too many DACs!\n");
break; break;
} }
spec->all_dacs[spec->num_all_dacs++] = nid; spec->all_dacs[spec->num_all_dacs++] = nid;
...@@ -2429,7 +2430,7 @@ static int create_hp_mic(struct hda_codec *codec) ...@@ -2429,7 +2430,7 @@ static int create_hp_mic(struct hda_codec *codec)
spec->hp_mic_pin = nid; spec->hp_mic_pin = nid;
/* we can't handle auto-mic together with HP-mic */ /* we can't handle auto-mic together with HP-mic */
spec->suppress_auto_mic = 1; spec->suppress_auto_mic = 1;
snd_printdd("hda-codec: Enable shared I/O jack on NID 0x%x\n", nid); codec_dbg(codec, "Enable shared I/O jack on NID 0x%x\n", nid);
return 0; return 0;
} }
...@@ -2883,7 +2884,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx, ...@@ -2883,7 +2884,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
path = snd_hda_add_new_path(codec, pin, mix_nid, 0); path = snd_hda_add_new_path(codec, pin, mix_nid, 0);
if (!path) if (!path)
return -EINVAL; return -EINVAL;
print_nid_path("loopback", path); print_nid_path(codec, "loopback", path);
spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path); spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path);
idx = path->idx[path->depth - 1]; idx = path->idx[path->depth - 1];
...@@ -2911,7 +2912,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx, ...@@ -2911,7 +2912,7 @@ static int new_analog_input(struct hda_codec *codec, int input_idx,
path = snd_hda_add_new_path(codec, spec->mixer_nid, path = snd_hda_add_new_path(codec, spec->mixer_nid,
spec->mixer_merge_nid, 0); spec->mixer_merge_nid, 0);
if (path) { if (path) {
print_nid_path("loopback-merge", path); print_nid_path(codec, "loopback-merge", path);
path->active = true; path->active = true;
spec->loopback_merge_path = spec->loopback_merge_path =
snd_hda_get_path_idx(codec, path); snd_hda_get_path_idx(codec, path);
...@@ -2990,7 +2991,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec) ...@@ -2990,7 +2991,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
} }
} }
snd_printdd("hda-codec: enabling ADC switching\n"); codec_dbg(codec, "enabling ADC switching\n");
spec->dyn_adc_switch = 1; spec->dyn_adc_switch = 1;
} else if (nums != spec->num_adc_nids) { } else if (nums != spec->num_adc_nids) {
/* shrink the invalid adcs and input paths */ /* shrink the invalid adcs and input paths */
...@@ -3014,7 +3015,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec) ...@@ -3014,7 +3015,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
if (imux->num_items == 1 || if (imux->num_items == 1 ||
(imux->num_items == 2 && spec->hp_mic)) { (imux->num_items == 2 && spec->hp_mic)) {
snd_printdd("hda-codec: reducing to a single ADC\n"); codec_dbg(codec, "reducing to a single ADC\n");
spec->num_adc_nids = 1; /* reduce to a single ADC */ spec->num_adc_nids = 1; /* reduce to a single ADC */
} }
...@@ -3045,7 +3046,7 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin, ...@@ -3045,7 +3046,7 @@ static int parse_capture_source(struct hda_codec *codec, hda_nid_t pin,
path = snd_hda_add_new_path(codec, pin, adc, anchor); path = snd_hda_add_new_path(codec, pin, adc, anchor);
if (!path) if (!path)
continue; continue;
print_nid_path("input", path); print_nid_path(codec, "input", path);
spec->input_paths[imux_idx][c] = spec->input_paths[imux_idx][c] =
snd_hda_get_path_idx(codec, path); snd_hda_get_path_idx(codec, path);
...@@ -3711,7 +3712,7 @@ static void parse_digital(struct hda_codec *codec) ...@@ -3711,7 +3712,7 @@ static void parse_digital(struct hda_codec *codec)
path = snd_hda_add_new_path(codec, dig_nid, pin, 0); path = snd_hda_add_new_path(codec, dig_nid, pin, 0);
if (!path) if (!path)
continue; continue;
print_nid_path("digout", path); print_nid_path(codec, "digout", path);
path->active = true; path->active = true;
spec->digout_paths[i] = snd_hda_get_path_idx(codec, path); spec->digout_paths[i] = snd_hda_get_path_idx(codec, path);
set_pin_target(codec, pin, PIN_OUT, false); set_pin_target(codec, pin, PIN_OUT, false);
...@@ -3738,7 +3739,7 @@ static void parse_digital(struct hda_codec *codec) ...@@ -3738,7 +3739,7 @@ static void parse_digital(struct hda_codec *codec)
continue; continue;
path = snd_hda_add_new_path(codec, pin, dig_nid, 0); path = snd_hda_add_new_path(codec, pin, dig_nid, 0);
if (path) { if (path) {
print_nid_path("digin", path); print_nid_path(codec, "digin", path);
path->active = true; path->active = true;
spec->dig_in_nid = dig_nid; spec->dig_in_nid = dig_nid;
spec->digin_path = snd_hda_get_path_idx(codec, path); 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,8 +4170,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
hda_nid_t nid = cfg->hp_pins[i]; hda_nid_t nid = cfg->hp_pins[i];
if (!is_jack_detectable(codec, nid)) if (!is_jack_detectable(codec, nid))
continue; continue;
snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n", codec_dbg(codec, "Enable HP auto-muting on NID 0x%x\n", nid);
nid);
snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT, snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT,
call_hp_automute); call_hp_automute);
spec->detect_hp = 1; spec->detect_hp = 1;
...@@ -4182,7 +4182,7 @@ static int check_auto_mute_availability(struct hda_codec *codec) ...@@ -4182,7 +4182,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
hda_nid_t nid = cfg->line_out_pins[i]; hda_nid_t nid = cfg->line_out_pins[i];
if (!is_jack_detectable(codec, nid)) if (!is_jack_detectable(codec, nid))
continue; continue;
snd_printdd("hda-codec: Enable Line-Out auto-muting on NID 0x%x\n", nid); codec_dbg(codec, "Enable Line-Out auto-muting on NID 0x%x\n", nid);
snd_hda_jack_detect_enable_callback(codec, nid, snd_hda_jack_detect_enable_callback(codec, nid,
HDA_GEN_FRONT_EVENT, HDA_GEN_FRONT_EVENT,
call_line_automute); call_line_automute);
...@@ -4302,7 +4302,7 @@ static int check_auto_mic_availability(struct hda_codec *codec) ...@@ -4302,7 +4302,7 @@ static int check_auto_mic_availability(struct hda_codec *codec)
spec->auto_mic = 1; spec->auto_mic = 1;
spec->num_adc_nids = 1; spec->num_adc_nids = 1;
spec->cur_mux[0] = spec->am_entry[0].idx; spec->cur_mux[0] = spec->am_entry[0].idx;
snd_printdd("hda-codec: Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n", codec_dbg(codec, "Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n",
spec->am_entry[0].pin, spec->am_entry[0].pin,
spec->am_entry[1].pin, spec->am_entry[1].pin,
spec->am_entry[2].pin); spec->am_entry[2].pin);
......
...@@ -30,7 +30,7 @@ void hda_display_power(bool enable) ...@@ -30,7 +30,7 @@ void hda_display_power(bool enable)
if (!get_power || !put_power) if (!get_power || !put_power)
return; return;
snd_printdd("HDA display power %s \n", pr_debug("HDA display power %s \n",
enable ? "Enable" : "Disable"); enable ? "Enable" : "Disable");
if (enable) if (enable)
get_power(); get_power();
...@@ -44,7 +44,7 @@ int hda_i915_init(void) ...@@ -44,7 +44,7 @@ int hda_i915_init(void)
get_power = symbol_request(i915_request_power_well); get_power = symbol_request(i915_request_power_well);
if (!get_power) { if (!get_power) {
snd_printk(KERN_WARNING "hda-i915: get_power symbol get fail\n"); pr_warn("hda-i915: get_power symbol get fail\n");
return -ENODEV; return -ENODEV;
} }
...@@ -55,7 +55,7 @@ int hda_i915_init(void) ...@@ -55,7 +55,7 @@ int hda_i915_init(void)
return -ENODEV; return -ENODEV;
} }
snd_printd("HDA driver get symbol successfully from i915 module\n"); pr_debug("HDA driver get symbol successfully from i915 module\n");
return err; return err;
} }
......
This diff is collapsed.
...@@ -758,4 +758,11 @@ void snd_hdmi_write_eld_info(struct hdmi_eld *eld, ...@@ -758,4 +758,11 @@ void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80 #define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
/*
*/
#define codec_err(codec, fmt, args...) dev_err(&(codec)->dev, fmt, ##args)
#define codec_warn(codec, fmt, args...) dev_warn(&(codec)->dev, fmt, ##args)
#define codec_info(codec, fmt, args...) dev_info(&(codec)->dev, fmt, ##args)
#define codec_dbg(codec, fmt, args...) dev_dbg(&(codec)->dev, fmt, ##args)
#endif /* __SOUND_HDA_LOCAL_H */ #endif /* __SOUND_HDA_LOCAL_H */
...@@ -119,7 +119,7 @@ static int clear_codec(struct hda_codec *codec) ...@@ -119,7 +119,7 @@ static int clear_codec(struct hda_codec *codec)
err = snd_hda_codec_reset(codec); err = snd_hda_codec_reset(codec);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR "The codec is being used, can't free.\n"); codec_err(codec, "The codec is being used, can't free.\n");
return err; return err;
} }
snd_hda_sysfs_clear(codec); snd_hda_sysfs_clear(codec);
...@@ -131,10 +131,10 @@ static int reconfig_codec(struct hda_codec *codec) ...@@ -131,10 +131,10 @@ static int reconfig_codec(struct hda_codec *codec)
int err; int err;
snd_hda_power_up(codec); snd_hda_power_up(codec);
snd_printk(KERN_INFO "hda-codec: reconfiguring\n"); codec_info(codec, "hda-codec: reconfiguring\n");
err = snd_hda_codec_reset(codec); err = snd_hda_codec_reset(codec);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR codec_err(codec,
"The codec is being used, can't reconfigure.\n"); "The codec is being used, can't reconfigure.\n");
goto error; goto error;
} }
......
This diff is collapsed.
...@@ -623,7 +623,7 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -623,7 +623,7 @@ static int patch_cmi9880(struct hda_codec *codec)
cmi9880_models, cmi9880_models,
cmi9880_cfg_tbl); cmi9880_cfg_tbl);
if (spec->board_config < 0) { if (spec->board_config < 0) {
snd_printdd(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", codec_dbg(codec, "%s: BIOS auto-probing.\n",
codec->chip_name); codec->chip_name);
spec->board_config = CMI_AUTO; /* try everything */ spec->board_config = CMI_AUTO; /* try everything */
} }
......
...@@ -1900,7 +1900,8 @@ static void cxt5066_update_speaker(struct hda_codec *codec) ...@@ -1900,7 +1900,8 @@ static void cxt5066_update_speaker(struct hda_codec *codec)
struct conexant_spec *spec = codec->spec; struct conexant_spec *spec = codec->spec;
unsigned int pinctl; unsigned int pinctl;
snd_printdd("CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n", codec_dbg(codec,
"CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n",
spec->hp_present, spec->cur_eapd); spec->hp_present, spec->cur_eapd);
/* Port A (HP) */ /* Port A (HP) */
...@@ -1969,10 +1970,10 @@ static void cxt5066_vostro_automic(struct hda_codec *codec) ...@@ -1969,10 +1970,10 @@ static void cxt5066_vostro_automic(struct hda_codec *codec)
present = snd_hda_jack_detect(codec, 0x1a); present = snd_hda_jack_detect(codec, 0x1a);
if (present) { if (present) {
snd_printdd("CXT5066: external microphone detected\n"); codec_dbg(codec, "CXT5066: external microphone detected\n");
snd_hda_sequence_write(codec, ext_mic_present); snd_hda_sequence_write(codec, ext_mic_present);
} else { } else {
snd_printdd("CXT5066: external microphone absent\n"); codec_dbg(codec, "CXT5066: external microphone absent\n");
snd_hda_sequence_write(codec, ext_mic_absent); snd_hda_sequence_write(codec, ext_mic_absent);
} }
} }
...@@ -1997,10 +1998,10 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec) ...@@ -1997,10 +1998,10 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec)
present = snd_hda_jack_detect(codec, 0x1b); present = snd_hda_jack_detect(codec, 0x1b);
if (present) { if (present) {
snd_printdd("CXT5066: external microphone detected\n"); codec_dbg(codec, "CXT5066: external microphone detected\n");
snd_hda_sequence_write(codec, ext_mic_present); snd_hda_sequence_write(codec, ext_mic_present);
} else { } else {
snd_printdd("CXT5066: external microphone absent\n"); codec_dbg(codec, "CXT5066: external microphone absent\n");
snd_hda_sequence_write(codec, ext_mic_absent); snd_hda_sequence_write(codec, ext_mic_absent);
} }
} }
...@@ -2012,7 +2013,7 @@ static void cxt5066_asus_automic(struct hda_codec *codec) ...@@ -2012,7 +2013,7 @@ static void cxt5066_asus_automic(struct hda_codec *codec)
unsigned int present; unsigned int present;
present = snd_hda_jack_detect(codec, 0x1b); present = snd_hda_jack_detect(codec, 0x1b);
snd_printdd("CXT5066: external microphone present=%d\n", present); codec_dbg(codec, "CXT5066: external microphone present=%d\n", present);
snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
present ? 1 : 0); present ? 1 : 0);
} }
...@@ -2024,7 +2025,7 @@ static void cxt5066_hp_laptop_automic(struct hda_codec *codec) ...@@ -2024,7 +2025,7 @@ static void cxt5066_hp_laptop_automic(struct hda_codec *codec)
unsigned int present; unsigned int present;
present = snd_hda_jack_detect(codec, 0x1b); present = snd_hda_jack_detect(codec, 0x1b);
snd_printdd("CXT5066: external microphone present=%d\n", present); codec_dbg(codec, "CXT5066: external microphone present=%d\n", present);
snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL,
present ? 1 : 3); present ? 1 : 3);
} }
...@@ -2063,13 +2064,13 @@ static void cxt5066_thinkpad_automic(struct hda_codec *codec) ...@@ -2063,13 +2064,13 @@ static void cxt5066_thinkpad_automic(struct hda_codec *codec)
ext_present = snd_hda_jack_detect(codec, 0x1b); ext_present = snd_hda_jack_detect(codec, 0x1b);
dock_present = snd_hda_jack_detect(codec, 0x1a); dock_present = snd_hda_jack_detect(codec, 0x1a);
if (ext_present) { if (ext_present) {
snd_printdd("CXT5066: external microphone detected\n"); codec_dbg(codec, "CXT5066: external microphone detected\n");
snd_hda_sequence_write(codec, ext_mic_present); snd_hda_sequence_write(codec, ext_mic_present);
} else if (dock_present) { } else if (dock_present) {
snd_printdd("CXT5066: dock microphone detected\n"); codec_dbg(codec, "CXT5066: dock microphone detected\n");
snd_hda_sequence_write(codec, dock_mic_present); snd_hda_sequence_write(codec, dock_mic_present);
} else { } else {
snd_printdd("CXT5066: external microphone absent\n"); codec_dbg(codec, "CXT5066: external microphone absent\n");
snd_hda_sequence_write(codec, ext_mic_absent); snd_hda_sequence_write(codec, ext_mic_absent);
} }
} }
...@@ -2088,7 +2089,7 @@ static void cxt5066_hp_automute(struct hda_codec *codec) ...@@ -2088,7 +2089,7 @@ static void cxt5066_hp_automute(struct hda_codec *codec)
spec->hp_present = portA ? HP_PRESENT_PORT_A : 0; spec->hp_present = portA ? HP_PRESENT_PORT_A : 0;
spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0; spec->hp_present |= portD ? HP_PRESENT_PORT_D : 0;
snd_printdd("CXT5066: hp automute portA=%x portD=%x present=%d\n", codec_dbg(codec, "CXT5066: hp automute portA=%x portD=%x present=%d\n",
portA, portD, spec->hp_present); portA, portD, spec->hp_present);
cxt5066_update_speaker(codec); cxt5066_update_speaker(codec);
} }
...@@ -2113,7 +2114,7 @@ static void cxt5066_automic(struct hda_codec *codec) ...@@ -2113,7 +2114,7 @@ static void cxt5066_automic(struct hda_codec *codec)
/* unsolicited event for jack sensing */ /* unsolicited event for jack sensing */
static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res) static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res)
{ {
snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); codec_dbg(codec, "CXT5066: unsol event %x (%x)\n", res, res >> 26);
switch (res >> 26) { switch (res >> 26) {
case CONEXANT_HP_EVENT: case CONEXANT_HP_EVENT:
cxt5066_hp_automute(codec); cxt5066_hp_automute(codec);
...@@ -2509,7 +2510,7 @@ static const struct hda_verb cxt5066_init_verbs_hp_laptop[] = { ...@@ -2509,7 +2510,7 @@ static const struct hda_verb cxt5066_init_verbs_hp_laptop[] = {
/* initialize jack-sensing, too */ /* initialize jack-sensing, too */
static int cxt5066_init(struct hda_codec *codec) static int cxt5066_init(struct hda_codec *codec)
{ {
snd_printdd("CXT5066: init\n"); codec_dbg(codec, "CXT5066: init\n");
conexant_init(codec); conexant_init(codec);
if (codec->patch_ops.unsol_event) { if (codec->patch_ops.unsol_event) {
cxt5066_hp_automute(codec); cxt5066_hp_automute(codec);
...@@ -3401,8 +3402,7 @@ static int patch_conexant_auto(struct hda_codec *codec) ...@@ -3401,8 +3402,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
struct conexant_spec *spec; struct conexant_spec *spec;
int err; int err;
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", codec_info(codec, "%s: BIOS auto-probing.\n", codec->chip_name);
codec->chip_name);
spec = kzalloc(sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec) if (!spec)
...@@ -3474,7 +3474,7 @@ static int patch_conexant_auto(struct hda_codec *codec) ...@@ -3474,7 +3474,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
* Better to make reset, then. * Better to make reset, then.
*/ */
if (!codec->bus->sync_write) { if (!codec->bus->sync_write) {
snd_printd("hda_codec: " codec_info(codec,
"Enable sync_write for stable communication\n"); "Enable sync_write for stable communication\n");
codec->bus->sync_write = 1; codec->bus->sync_write = 1;
codec->bus->allow_bus_reset = 1; codec->bus->allow_bus_reset = 1;
......
This diff is collapsed.
...@@ -407,8 +407,8 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) ...@@ -407,8 +407,8 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
ass = snd_hda_codec_get_pincfg(codec, nid); ass = snd_hda_codec_get_pincfg(codec, nid);
if (!(ass & 1)) { if (!(ass & 1)) {
printk(KERN_INFO "hda_codec: %s: SKU not ready 0x%08x\n", codec_info(codec, "%s: SKU not ready 0x%08x\n",
codec->chip_name, ass); codec->chip_name, ass);
return -1; return -1;
} }
...@@ -432,17 +432,17 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) ...@@ -432,17 +432,17 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)
spec->cdefine.swap = (ass & 0x2) >> 1; spec->cdefine.swap = (ass & 0x2) >> 1;
spec->cdefine.override = ass & 0x1; spec->cdefine.override = ass & 0x1;
snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n", codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
nid, spec->cdefine.sku_cfg); nid, spec->cdefine.sku_cfg);
snd_printd("SKU: port_connectivity=0x%x\n", codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
spec->cdefine.port_connectivity); spec->cdefine.port_connectivity);
snd_printd("SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep); codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
snd_printd("SKU: check_sum=0x%08x\n", spec->cdefine.check_sum); codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
snd_printd("SKU: customization=0x%08x\n", spec->cdefine.customization); codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
snd_printd("SKU: external_amp=0x%x\n", spec->cdefine.external_amp); codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
snd_printd("SKU: platform_type=0x%x\n", spec->cdefine.platform_type); codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
snd_printd("SKU: swap=0x%x\n", spec->cdefine.swap); codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
snd_printd("SKU: override=0x%x\n", spec->cdefine.override); codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
return 0; return 0;
} }
...@@ -502,8 +502,8 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) ...@@ -502,8 +502,8 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
if (codec->vendor_id == 0x10ec0260) if (codec->vendor_id == 0x10ec0260)
nid = 0x17; nid = 0x17;
ass = snd_hda_codec_get_pincfg(codec, nid); ass = snd_hda_codec_get_pincfg(codec, nid);
snd_printd("realtek: No valid SSID, " codec_dbg(codec,
"checking pincfg 0x%08x for NID 0x%x\n", "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
ass, nid); ass, nid);
if (!(ass & 1)) if (!(ass & 1))
return 0; return 0;
...@@ -519,7 +519,7 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports) ...@@ -519,7 +519,7 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
if (((ass >> 16) & 0xf) != tmp) if (((ass >> 16) & 0xf) != tmp)
return 0; return 0;
do_sku: do_sku:
snd_printd("realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n", codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
ass & 0xffff, codec->vendor_id); ass & 0xffff, codec->vendor_id);
/* /*
* 0 : override * 0 : override
...@@ -577,8 +577,8 @@ static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) ...@@ -577,8 +577,8 @@ static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
{ {
if (!alc_subsystem_id(codec, ports)) { if (!alc_subsystem_id(codec, ports)) {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
snd_printd("realtek: " codec_dbg(codec,
"Enable default setup for auto mode as fallback\n"); "realtek: Enable default setup for auto mode as fallback\n");
spec->init_amp = ALC_INIT_DEFAULT; spec->init_amp = ALC_INIT_DEFAULT;
} }
} }
...@@ -3170,7 +3170,8 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec, ...@@ -3170,7 +3170,8 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
spec->gen.vmaster_mute_enum = 1; spec->gen.vmaster_mute_enum = 1;
codec->power_filter = led_power_filter; codec->power_filter = led_power_filter;
snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid, codec_dbg(codec,
"Detected mute LED for %x:%d\n", spec->mute_led_nid,
spec->mute_led_polarity); spec->mute_led_polarity);
break; break;
} }
...@@ -3296,7 +3297,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) ...@@ -3296,7 +3297,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
alc_write_coef_idx(codec, 0xb7, 0x802b); alc_write_coef_idx(codec, 0xb7, 0x802b);
break; break;
} }
snd_printdd("Headset jack set to unplugged mode.\n"); codec_dbg(codec, "Headset jack set to unplugged mode.\n");
} }
...@@ -3339,7 +3340,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, ...@@ -3339,7 +3340,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
break; break;
} }
snd_printdd("Headset jack set to mic-in mode.\n"); codec_dbg(codec, "Headset jack set to mic-in mode.\n");
} }
static void alc_headset_mode_default(struct hda_codec *codec) static void alc_headset_mode_default(struct hda_codec *codec)
...@@ -3367,7 +3368,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) ...@@ -3367,7 +3368,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
alc_write_coef_idx(codec, 0xb7, 0x802b); alc_write_coef_idx(codec, 0xb7, 0x802b);
break; break;
} }
snd_printdd("Headset jack set to headphone (default) mode.\n"); codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
} }
/* Iphone type */ /* Iphone type */
...@@ -3396,7 +3397,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) ...@@ -3396,7 +3397,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
alc_write_coef_idx(codec, 0xc3, 0x0000); alc_write_coef_idx(codec, 0xc3, 0x0000);
break; break;
} }
snd_printdd("Headset jack set to iPhone-style headset mode.\n"); codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
} }
/* Nokia type */ /* Nokia type */
...@@ -3425,7 +3426,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) ...@@ -3425,7 +3426,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
alc_write_coef_idx(codec, 0xc3, 0x0000); alc_write_coef_idx(codec, 0xc3, 0x0000);
break; break;
} }
snd_printdd("Headset jack set to Nokia-style headset mode.\n"); codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
} }
static void alc_determine_headset_type(struct hda_codec *codec) static void alc_determine_headset_type(struct hda_codec *codec)
...@@ -3467,7 +3468,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) ...@@ -3467,7 +3468,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
break; break;
} }
snd_printdd("Headset jack detected iPhone-style headset: %s\n", codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
is_ctia ? "yes" : "no"); is_ctia ? "yes" : "no");
spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP; spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
} }
...@@ -4901,8 +4902,7 @@ static void alc272_fixup_mario(struct hda_codec *codec, ...@@ -4901,8 +4902,7 @@ static void alc272_fixup_mario(struct hda_codec *codec,
(0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) | (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
(0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) | (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
(0 << AC_AMPCAP_MUTE_SHIFT))) (0 << AC_AMPCAP_MUTE_SHIFT)))
printk(KERN_WARNING codec_warn(codec, "failed to override amp caps for NID 0x2\n");
"hda_codec: failed to override amp caps for NID 0x2\n");
} }
static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = { static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
......
...@@ -236,7 +236,7 @@ static int si3054_init(struct hda_codec *codec) ...@@ -236,7 +236,7 @@ static int si3054_init(struct hda_codec *codec)
} while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--); } while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--);
if((val&SI3054_MEI_READY) != SI3054_MEI_READY) { if((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
snd_printk(KERN_ERR "si3054: cannot initialize. EXT MID = %04x\n", val); codec_err(codec, "si3054: cannot initialize. EXT MID = %04x\n", val);
/* let's pray that this is no fatal error */ /* let's pray that this is no fatal error */
/* return -EACCES; */ /* return -EACCES; */
} }
...@@ -247,7 +247,8 @@ static int si3054_init(struct hda_codec *codec) ...@@ -247,7 +247,8 @@ static int si3054_init(struct hda_codec *codec)
SET_REG(codec, SI3054_LINE_CFG1,0x200); SET_REG(codec, SI3054_LINE_CFG1,0x200);
if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) { if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
snd_printd("Link Frame Detect(FDT) is not ready (line status: %04x)\n", codec_dbg(codec,
"Link Frame Detect(FDT) is not ready (line status: %04x)\n",
GET_REG(codec,SI3054_LINE_STATUS)); GET_REG(codec,SI3054_LINE_STATUS));
} }
......
...@@ -296,7 +296,7 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask, ...@@ -296,7 +296,7 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
{ {
unsigned int gpiostate, gpiomask, gpiodir; unsigned int gpiostate, gpiomask, gpiodir;
snd_printdd("%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data); codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
gpiostate = snd_hda_codec_read(codec, codec->afg, 0, gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
AC_VERB_GET_GPIO_DATA, 0); AC_VERB_GET_GPIO_DATA, 0);
...@@ -359,7 +359,7 @@ static int stac_vrefout_set(struct hda_codec *codec, ...@@ -359,7 +359,7 @@ static int stac_vrefout_set(struct hda_codec *codec,
{ {
int error, pinctl; int error, pinctl;
snd_printdd("%s, nid %x ctl %x\n", __func__, nid, new_vref); codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref);
pinctl = snd_hda_codec_read(codec, nid, 0, pinctl = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_PIN_WIDGET_CONTROL, 0); AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
...@@ -2086,7 +2086,7 @@ static void stac92hd83xxx_fixup_hp(struct hda_codec *codec, ...@@ -2086,7 +2086,7 @@ static void stac92hd83xxx_fixup_hp(struct hda_codec *codec,
} }
if (find_mute_led_cfg(codec, spec->default_polarity)) if (find_mute_led_cfg(codec, spec->default_polarity))
snd_printd("mute LED gpio %d polarity %d\n", codec_dbg(codec, "mute LED gpio %d polarity %d\n",
spec->gpio_led, spec->gpio_led,
spec->gpio_led_polarity); spec->gpio_led_polarity);
} }
...@@ -3077,7 +3077,7 @@ static void stac92hd71bxx_fixup_hp(struct hda_codec *codec, ...@@ -3077,7 +3077,7 @@ static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
} }
if (find_mute_led_cfg(codec, 1)) if (find_mute_led_cfg(codec, 1))
snd_printd("mute LED gpio %d polarity %d\n", codec_dbg(codec, "mute LED gpio %d polarity %d\n",
spec->gpio_led, spec->gpio_led,
spec->gpio_led_polarity); spec->gpio_led_polarity);
...@@ -4422,8 +4422,8 @@ static int patch_stac92hd73xx(struct hda_codec *codec) ...@@ -4422,8 +4422,8 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1; num_dacs = snd_hda_get_num_conns(codec, 0x0a) - 1;
if (num_dacs < 3 || num_dacs > 5) { if (num_dacs < 3 || num_dacs > 5) {
printk(KERN_WARNING "hda_codec: Could not determine " codec_warn(codec,
"number of channels defaulting to DAC count\n"); "Could not determine number of channels defaulting to DAC count\n");
num_dacs = 5; num_dacs = 5;
} }
......
...@@ -63,7 +63,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, ...@@ -63,7 +63,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
if (!led_set_func) if (!led_set_func)
led_set_func = symbol_request(tpacpi_led_set); led_set_func = symbol_request(tpacpi_led_set);
if (!led_set_func) { if (!led_set_func) {
snd_printk(KERN_WARNING "Failed to find thinkpad-acpi symbol tpacpi_led_set\n"); codec_warn(codec,
"Failed to find thinkpad-acpi symbol tpacpi_led_set\n");
return; return;
} }
...@@ -75,7 +76,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, ...@@ -75,7 +76,8 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
} }
if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) { if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
if (spec->num_adc_nids > 1) if (spec->num_adc_nids > 1)
snd_printdd("Skipping micmute LED control due to several ADCs"); codec_dbg(codec,
"Skipping micmute LED control due to several ADCs");
else { else {
spec->cap_sync_hook = update_tpacpi_micmute_led; spec->cap_sync_hook = update_tpacpi_micmute_led;
removefunc = false; removefunc = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment