]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/pci/hda/hda_generic.c
ALSA: hda - Replace with standard printk
[mirror_ubuntu-bionic-kernel.git] / sound / pci / hda / hda_generic.c
index bcd9c712356f5495179793e940a0a9bf375a73d9..9e0609a4b2ba55d8adfde269b11a9512a585ddda 100644 (file)
@@ -346,7 +346,8 @@ static bool is_ctl_associated(struct hda_codec *codec, hda_nid_t nid,
        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];
        int i;
@@ -358,7 +359,7 @@ static void print_nid_path(const char *pfx, struct nid_path *path)
                sprintf(tmp, ":%02x", path->path[i]);
                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 */
@@ -1260,7 +1261,7 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
                        dac = dacs[i] = 0;
                        badness += bad->no_dac;
                } else {
-                       /* print_nid_path("output", path); */
+                       /* print_nid_path(codec, "output", path); */
                        path->active = true;
                        path_idx[i] = snd_hda_get_path_idx(codec, path);
                        badness += assign_out_path_ctls(codec, path);
@@ -1387,7 +1388,7 @@ static int fill_multi_ios(struct hda_codec *codec,
                                badness++;
                                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].dac = dac;
                        spec->out_paths[cfg->line_outs + spec->multi_ios] =
@@ -1444,7 +1445,7 @@ static bool map_singles(struct hda_codec *codec, int outs,
                if (path) {
                        dacs[i] = dac;
                        found = true;
-                       /* print_nid_path("output", path); */
+                       /* print_nid_path(codec, "output", path); */
                        path->active = true;
                        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)
        }
        if (!path)
                return 0;
-       /* print_nid_path("output-aamix", path); */
+       /* print_nid_path(codec, "output-aamix", path); */
        path->active = false; /* unused as default */
        return snd_hda_get_path_idx(codec, path);
 }
@@ -1699,7 +1700,7 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 #define DEBUG_BADNESS
 
 #ifdef DEBUG_BADNESS
-#define debug_badness  snd_printdd
+#define debug_badness(fmt, args...)    codec_dbg(codec, fmt, ##args)
 #else
 #define debug_badness(...)
 #endif
@@ -1712,7 +1713,7 @@ static inline void print_nid_path_idx(struct hda_codec *codec,
 
        path = snd_hda_get_path_from_idx(codec, idx);
        if (path)
-               print_nid_path(pfx, path);
+               print_nid_path(codec, pfx, path);
 }
 
 static void debug_show_configs(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)
                        continue;
                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;
                }
                spec->all_dacs[spec->num_all_dacs++] = nid;
@@ -2429,7 +2430,7 @@ static int create_hp_mic(struct hda_codec *codec)
        spec->hp_mic_pin = nid;
        /* we can't handle auto-mic together with HP-mic */
        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;
 }
 
@@ -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);
        if (!path)
                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);
 
        idx = path->idx[path->depth - 1];
@@ -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,
                                            spec->mixer_merge_nid, 0);
                if (path) {
-                       print_nid_path("loopback-merge", path);
+                       print_nid_path(codec, "loopback-merge", path);
                        path->active = true;
                        spec->loopback_merge_path =
                                snd_hda_get_path_idx(codec, path);
@@ -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;
        } else if (nums != spec->num_adc_nids) {
                /* shrink the invalid adcs and input paths */
@@ -3014,7 +3015,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
 
        if (imux->num_items == 1 ||
            (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 */
        }
 
@@ -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);
                if (!path)
                        continue;
-               print_nid_path("input", path);
+               print_nid_path(codec, "input", path);
                spec->input_paths[imux_idx][c] =
                        snd_hda_get_path_idx(codec, path);
 
@@ -3711,7 +3712,7 @@ static void parse_digital(struct hda_codec *codec)
                path = snd_hda_add_new_path(codec, dig_nid, pin, 0);
                if (!path)
                        continue;
-               print_nid_path("digout", path);
+               print_nid_path(codec, "digout", path);
                path->active = true;
                spec->digout_paths[i] = snd_hda_get_path_idx(codec, path);
                set_pin_target(codec, pin, PIN_OUT, false);
@@ -3738,7 +3739,7 @@ static void parse_digital(struct hda_codec *codec)
                                continue;
                        path = snd_hda_add_new_path(codec, pin, dig_nid, 0);
                        if (path) {
-                               print_nid_path("digin", path);
+                               print_nid_path(codec, "digin", path);
                                path->active = true;
                                spec->dig_in_nid = dig_nid;
                                spec->digin_path = snd_hda_get_path_idx(codec, path);
@@ -4169,8 +4170,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
                hda_nid_t nid = cfg->hp_pins[i];
                if (!is_jack_detectable(codec, nid))
                        continue;
-               snd_printdd("hda-codec: Enable HP auto-muting on NID 0x%x\n",
-                           nid);
+               codec_dbg(codec, "Enable HP auto-muting on NID 0x%x\n", nid);
                snd_hda_jack_detect_enable_callback(codec, nid, HDA_GEN_HP_EVENT,
                                                    call_hp_automute);
                spec->detect_hp = 1;
@@ -4182,7 +4182,7 @@ static int check_auto_mute_availability(struct hda_codec *codec)
                                hda_nid_t nid = cfg->line_out_pins[i];
                                if (!is_jack_detectable(codec, nid))
                                        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,
                                                                    HDA_GEN_FRONT_EVENT,
                                                                    call_line_automute);
@@ -4302,7 +4302,7 @@ static int check_auto_mic_availability(struct hda_codec *codec)
        spec->auto_mic = 1;
        spec->num_adc_nids = 1;
        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[1].pin,
                    spec->am_entry[2].pin);