Commit c1286b86 authored by Mark Brown's avatar Mark Brown Committed by Jaroslav Kysela

ALSA: ASoC: Switch DAPM to use of standard DEBUG macro

DAPM contains debug output controlled by a DAPM_DEBUG macro. Change this
to be controlled by the standard DEBUG, dropping the custom dbg() macro
as we go.

Also fix the error printed when configuring an unknown pin to be an
unconditionally displayed error rather than debug output.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 53640650
...@@ -45,13 +45,10 @@ ...@@ -45,13 +45,10 @@
#include <sound/initval.h> #include <sound/initval.h>
/* debug */ /* debug */
#define DAPM_DEBUG 0 #ifdef DEBUG
#if DAPM_DEBUG
#define dump_dapm(codec, action) dbg_dump_dapm(codec, action) #define dump_dapm(codec, action) dbg_dump_dapm(codec, action)
#define dbg(format, arg...) printk(format, ## arg)
#else #else
#define dump_dapm(codec, action) #define dump_dapm(codec, action)
#define dbg(format, arg...)
#endif #endif
/* dapm power sequences - make this per codec in the future */ /* dapm power sequences - make this per codec in the future */
...@@ -233,7 +230,8 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget) ...@@ -233,7 +230,8 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
snd_soc_write(codec, widget->reg, new); snd_soc_write(codec, widget->reg, new);
pop_wait(); pop_wait();
} }
dbg("reg %x old %x new %x change %d\n", widget->reg, old, new, change); pr_debug("reg %x old %x new %x change %d\n", widget->reg,
old, new, change);
return change; return change;
} }
...@@ -591,7 +589,7 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) ...@@ -591,7 +589,7 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
/* call any power change event handlers */ /* call any power change event handlers */
if (power_change) { if (power_change) {
if (w->event) { if (w->event) {
dbg("power %s event for %s flags %x\n", pr_debug("power %s event for %s flags %x\n",
w->power ? "on" : "off", w->name, w->event_flags); w->power ? "on" : "off", w->name, w->event_flags);
if (power) { if (power) {
/* power up event */ /* power up event */
...@@ -634,7 +632,7 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) ...@@ -634,7 +632,7 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
return ret; return ret;
} }
#if DAPM_DEBUG #ifdef DEBUG
static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action) static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action)
{ {
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
...@@ -887,13 +885,13 @@ static int snd_soc_dapm_set_pin(struct snd_soc_codec *codec, ...@@ -887,13 +885,13 @@ static int snd_soc_dapm_set_pin(struct snd_soc_codec *codec,
list_for_each_entry(w, &codec->dapm_widgets, list) { list_for_each_entry(w, &codec->dapm_widgets, list) {
if (!strcmp(w->name, pin)) { if (!strcmp(w->name, pin)) {
dbg("dapm: %s: pin %s\n", codec->name, pin); pr_debug("dapm: %s: pin %s\n", codec->name, pin);
w->connected = status; w->connected = status;
return 0; return 0;
} }
} }
dbg("dapm: %s: configuring unknown pin %s\n", codec->name, pin); pr_err("dapm: %s: configuring unknown pin %s\n", codec->name, pin);
return -EINVAL; return -EINVAL;
} }
...@@ -1397,8 +1395,8 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, ...@@ -1397,8 +1395,8 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
{ {
if (!w->sname) if (!w->sname)
continue; continue;
dbg("widget %s\n %s stream %s event %d\n", w->name, w->sname, pr_debug("widget %s\n %s stream %s event %d\n",
stream, event); w->name, w->sname, stream, event);
if (strstr(w->sname, stream)) { if (strstr(w->sname, stream)) {
switch(event) { switch(event) {
case SND_SOC_DAPM_STREAM_START: case SND_SOC_DAPM_STREAM_START:
......
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