Commit fd8d3bc0 authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Mark Brown

ASoC: Convert pop_dbg to use dev_info

Prints from pop_dbg are enabled when dapm_pop_time != 0. Convert it to
use dev_info so that parent device of DAPM context is printed.
Signed-off-by: default avatarJarkko Nikula <jhnikula@gmail.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f7d41ae8
...@@ -91,17 +91,24 @@ static void pop_wait(u32 pop_time) ...@@ -91,17 +91,24 @@ static void pop_wait(u32 pop_time)
schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time)); schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
} }
static void pop_dbg(u32 pop_time, const char *fmt, ...) static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
{ {
va_list args; va_list args;
char *buf;
va_start(args, fmt); if (!pop_time)
return;
if (pop_time) { buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
vprintk(fmt, args); if (buf == NULL)
} return;
va_start(args, fmt);
vsnprintf(buf, PAGE_SIZE, fmt, args);
dev_info(dev, buf);
va_end(args); va_end(args);
kfree(buf);
} }
/* create a new dapm widget */ /* create a new dapm widget */
...@@ -313,7 +320,8 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget) ...@@ -313,7 +320,8 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
change = old != new; change = old != new;
if (change) { if (change) {
pop_dbg(card->pop_time, "pop test %s : %s in %d ms\n", pop_dbg(dapm->dev, card->pop_time,
"pop test %s : %s in %d ms\n",
widget->name, widget->power ? "on" : "off", widget->name, widget->power ? "on" : "off",
card->pop_time); card->pop_time);
pop_wait(card->pop_time); pop_wait(card->pop_time);
...@@ -745,15 +753,15 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, ...@@ -745,15 +753,15 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
if (power) if (power)
value |= cur_mask; value |= cur_mask;
pop_dbg(card->pop_time, pop_dbg(dapm->dev, card->pop_time,
"pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n", "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n",
w->name, reg, value, mask); w->name, reg, value, mask);
/* power up pre event */ /* power up pre event */
if (w->power && w->event && if (w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_PRE_PMU)) { (w->event_flags & SND_SOC_DAPM_PRE_PMU)) {
pop_dbg(card->pop_time, "pop test : %s PRE_PMU\n", pop_dbg(dapm->dev, card->pop_time,
w->name); "pop test : %s PRE_PMU\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU); ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU);
if (ret < 0) if (ret < 0)
dev_err(dapm->dev, dev_err(dapm->dev,
...@@ -764,8 +772,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, ...@@ -764,8 +772,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
/* power down pre event */ /* power down pre event */
if (!w->power && w->event && if (!w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_PRE_PMD)) { (w->event_flags & SND_SOC_DAPM_PRE_PMD)) {
pop_dbg(card->pop_time, "pop test : %s PRE_PMD\n", pop_dbg(dapm->dev, card->pop_time,
w->name); "pop test : %s PRE_PMD\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD); ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD);
if (ret < 0) if (ret < 0)
dev_err(dapm->dev, dev_err(dapm->dev,
...@@ -775,7 +783,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, ...@@ -775,7 +783,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
} }
if (reg >= 0) { if (reg >= 0) {
pop_dbg(card->pop_time, pop_dbg(dapm->dev, card->pop_time,
"pop test : Applying 0x%x/0x%x to %x in %dms\n", "pop test : Applying 0x%x/0x%x to %x in %dms\n",
value, mask, reg, card->pop_time); value, mask, reg, card->pop_time);
pop_wait(card->pop_time); pop_wait(card->pop_time);
...@@ -786,8 +794,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, ...@@ -786,8 +794,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
/* power up post event */ /* power up post event */
if (w->power && w->event && if (w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_POST_PMU)) { (w->event_flags & SND_SOC_DAPM_POST_PMU)) {
pop_dbg(card->pop_time, "pop test : %s POST_PMU\n", pop_dbg(dapm->dev, card->pop_time,
w->name); "pop test : %s POST_PMU\n", w->name);
ret = w->event(w, ret = w->event(w,
NULL, SND_SOC_DAPM_POST_PMU); NULL, SND_SOC_DAPM_POST_PMU);
if (ret < 0) if (ret < 0)
...@@ -799,8 +807,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, ...@@ -799,8 +807,8 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm,
/* power down post event */ /* power down post event */
if (!w->power && w->event && if (!w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_POST_PMD)) { (w->event_flags & SND_SOC_DAPM_POST_PMD)) {
pop_dbg(card->pop_time, "pop test : %s POST_PMD\n", pop_dbg(dapm->dev, card->pop_time,
w->name); "pop test : %s POST_PMD\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD); ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD);
if (ret < 0) if (ret < 0)
dev_err(dapm->dev, dev_err(dapm->dev,
...@@ -1025,8 +1033,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) ...@@ -1025,8 +1033,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
"Failed to apply active bias: %d\n", ret); "Failed to apply active bias: %d\n", ret);
} }
pop_dbg(card->pop_time, "DAPM sequencing finished, waiting %dms\n", pop_dbg(dapm->dev, card->pop_time,
card->pop_time); "DAPM sequencing finished, waiting %dms\n", card->pop_time);
pop_wait(card->pop_time); pop_wait(card->pop_time);
return 0; return 0;
......
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