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;
+ char *buf;
- va_start(args, fmt);
+ if (!pop_time)
+ return;
- if (pop_time) {
- vprintk(fmt, args);
- }
+ buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ if (buf == NULL)
+ return;
+ va_start(args, fmt);
+ vsnprintf(buf, PAGE_SIZE, fmt, args);
+ dev_info(dev, buf);
va_end(args);
+
+ kfree(buf);
}
/* create a new dapm widget */
change = old != new;
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",
card->pop_time);
pop_wait(card->pop_time);
if (power)
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",
w->name, reg, value, mask);
/* power up pre event */
if (w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_PRE_PMU)) {
- pop_dbg(card->pop_time, "pop test : %s PRE_PMU\n",
- w->name);
+ pop_dbg(dapm->dev, card->pop_time,
+ "pop test : %s PRE_PMU\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU);
if (ret < 0)
dev_err(dapm->dev,
/* power down pre event */
if (!w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_PRE_PMD)) {
- pop_dbg(card->pop_time, "pop test : %s PRE_PMD\n",
- w->name);
+ pop_dbg(dapm->dev, card->pop_time,
+ "pop test : %s PRE_PMD\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD);
if (ret < 0)
dev_err(dapm->dev,
}
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",
value, mask, reg, card->pop_time);
pop_wait(card->pop_time);
/* power up post event */
if (w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_POST_PMU)) {
- pop_dbg(card->pop_time, "pop test : %s POST_PMU\n",
- w->name);
+ pop_dbg(dapm->dev, card->pop_time,
+ "pop test : %s POST_PMU\n", w->name);
ret = w->event(w,
NULL, SND_SOC_DAPM_POST_PMU);
if (ret < 0)
/* power down post event */
if (!w->power && w->event &&
(w->event_flags & SND_SOC_DAPM_POST_PMD)) {
- pop_dbg(card->pop_time, "pop test : %s POST_PMD\n",
- w->name);
+ pop_dbg(dapm->dev, card->pop_time,
+ "pop test : %s POST_PMD\n", w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD);
if (ret < 0)
dev_err(dapm->dev,
"Failed to apply active bias: %d\n", ret);
}
- pop_dbg(card->pop_time, "DAPM sequencing finished, waiting %dms\n",
- card->pop_time);
+ pop_dbg(dapm->dev, card->pop_time,
+ "DAPM sequencing finished, waiting %dms\n", card->pop_time);
pop_wait(card->pop_time);
return 0;