pop_wait(card->pop_time);
snd_soc_write(codec, widget->reg, new);
}
- pr_debug("reg %x old %x new %x change %d\n", widget->reg,
- old, new, change);
+ dev_dbg(dapm->dev, "reg %x old %x new %x change %d\n", widget->reg,
+ old, new, change);
return change;
}
path->long_name);
ret = snd_ctl_add(card, path->kcontrol);
if (ret < 0) {
- printk(KERN_ERR "asoc: failed to add dapm kcontrol %s: %d\n",
- path->long_name,
- ret);
+ dev_err(dapm->dev,
+ "asoc: failed to add dapm kcontrol %s: %d\n",
+ path->long_name, ret);
kfree(path->long_name);
path->long_name = NULL;
return ret;
int ret = 0;
if (!w->num_kcontrols) {
- printk(KERN_ERR "asoc: mux %s has no controls\n", w->name);
+ dev_err(dapm->dev, "asoc: mux %s has no controls\n", w->name);
return -EINVAL;
}
return ret;
err:
- printk(KERN_ERR "asoc: failed to add kcontrol %s\n", w->name);
+ dev_err(dapm->dev, "asoc: failed to add kcontrol %s\n", w->name);
return ret;
}
struct snd_soc_dapm_widget *w)
{
if (w->num_kcontrols)
- pr_err("asoc: PGA controls not supported: '%s'\n", w->name);
+ dev_err(w->dapm->dev,
+ "asoc: PGA controls not supported: '%s'\n", w->name);
return 0;
}
case SNDRV_CTL_POWER_D3hot:
case SNDRV_CTL_POWER_D3cold:
if (widget->ignore_suspend)
- pr_debug("%s ignoring suspend\n", widget->name);
+ dev_dbg(widget->dapm->dev, "%s ignoring suspend\n",
+ widget->name);
return widget->ignore_suspend;
default:
return 1;
/* call any power change event handlers */
if (w->event)
- pr_debug("power %s event for %s flags %x\n",
+ dev_dbg(w->dapm->dev, "power %s event for %s flags %x\n",
w->power ? "on" : "off",
w->name, w->event_flags);
w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU);
if (ret < 0)
- pr_err("%s: pre event failed: %d\n",
- w->name, ret);
+ dev_err(dapm->dev,
+ "%s: pre event failed: %d\n",
+ w->name, ret);
}
/* power down pre event */
w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD);
if (ret < 0)
- pr_err("%s: pre event failed: %d\n",
- w->name, ret);
+ dev_err(dapm->dev,
+ "%s: pre event failed: %d\n",
+ w->name, ret);
}
}
ret = w->event(w,
NULL, SND_SOC_DAPM_POST_PMU);
if (ret < 0)
- pr_err("%s: post event failed: %d\n",
- w->name, ret);
+ dev_err(dapm->dev,
+ "%s: post event failed: %d\n",
+ w->name, ret);
}
/* power down post event */
w->name);
ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD);
if (ret < 0)
- pr_err("%s: post event failed: %d\n",
- w->name, ret);
+ dev_err(dapm->dev,
+ "%s: post event failed: %d\n",
+ w->name, ret);
}
}
}
}
if (ret < 0)
- pr_err("Failed to apply widget power: %d\n",
- ret);
+ dev_err(w->dapm->dev,
+ "Failed to apply widget power: %d\n", ret);
}
if (!list_empty(&pending))
ret = snd_soc_dapm_set_bias_level(card, dapm,
SND_SOC_BIAS_STANDBY);
if (ret != 0)
- pr_err("Failed to turn on bias: %d\n", ret);
+ dev_err(dapm->dev,
+ "Failed to turn on bias: %d\n", ret);
}
/* If we're changing to all on or all off then prepare */
(!sys_power && dapm->bias_level == SND_SOC_BIAS_ON)) {
ret = snd_soc_dapm_set_bias_level(card, dapm, SND_SOC_BIAS_PREPARE);
if (ret != 0)
- pr_err("Failed to prepare bias: %d\n", ret);
+ dev_err(dapm->dev,
+ "Failed to prepare bias: %d\n", ret);
}
/* Power down widgets first; try to avoid amplifying pops. */
if (dapm->bias_level == SND_SOC_BIAS_PREPARE && !sys_power) {
ret = snd_soc_dapm_set_bias_level(card, dapm, SND_SOC_BIAS_STANDBY);
if (ret != 0)
- pr_err("Failed to apply standby bias: %d\n", ret);
+ dev_err(dapm->dev,
+ "Failed to apply standby bias: %d\n", ret);
}
/* If we're in standby and can support bias off then do that */
dapm->idle_bias_off) {
ret = snd_soc_dapm_set_bias_level(card, dapm, SND_SOC_BIAS_OFF);
if (ret != 0)
- pr_err("Failed to turn off bias: %d\n", ret);
+ dev_err(dapm->dev,
+ "Failed to turn off bias: %d\n", ret);
}
/* If we just powered up then move to active bias */
if (dapm->bias_level == SND_SOC_BIAS_PREPARE && sys_power) {
ret = snd_soc_dapm_set_bias_level(card, dapm, SND_SOC_BIAS_ON);
if (ret != 0)
- pr_err("Failed to apply active bias: %d\n", ret);
+ dev_err(dapm->dev,
+ "Failed to apply active bias: %d\n", ret);
}
pop_dbg(card->pop_time, "DAPM sequencing finished, waiting %dms\n",
dapm->debugfs_dapm, w,
&dapm_widget_power_fops);
if (!d)
- printk(KERN_WARNING
- "ASoC: Failed to create %s debugfs file\n",
- w->name);
+ dev_warn(w->dapm->dev,
+ "ASoC: Failed to create %s debugfs file\n",
+ w->name);
}
}
#else
list_for_each_entry(w, &dapm->widgets, list) {
if (!strcmp(w->name, pin)) {
- pr_debug("dapm: %s: pin %s\n", dapm->codec->name, pin);
+ dev_dbg(w->dapm->dev, "dapm: pin %s = %d\n",
+ pin, status);
w->connected = status;
/* Allow disabling of forced pins */
if (status == 0)
}
}
- pr_err("dapm: %s: configuring unknown pin %s\n",
- dapm->codec->name, pin);
+ dev_err(dapm->dev, "dapm: unknown pin %s\n", pin);
return -EINVAL;
}
return 0;
err:
- printk(KERN_WARNING "asoc: no dapm match for %s --> %s --> %s\n", source,
- control, sink);
+ dev_warn(dapm->dev, "asoc: no dapm match for %s --> %s --> %s\n",
+ source, control, sink);
kfree(path);
return ret;
}
for (i = 0; i < num; i++) {
ret = snd_soc_dapm_add_route(dapm, route);
if (ret < 0) {
- printk(KERN_ERR "Failed to add route %s->%s\n",
- route->source,
- route->sink);
+ dev_err(dapm->dev, "Failed to add route %s->%s\n",
+ route->source, route->sink);
return ret;
}
route++;
for (i = 0; i < num; i++) {
ret = snd_soc_dapm_new_control(dapm, widget);
if (ret < 0) {
- printk(KERN_ERR
- "ASoC: Failed to create DAPM control %s: %d\n",
- widget->name, ret);
+ dev_err(dapm->dev,
+ "ASoC: Failed to create DAPM control %s: %d\n",
+ widget->name, ret);
return ret;
}
widget++;
{
if (!w->sname)
continue;
- pr_debug("widget %s\n %s stream %s event %d\n",
- w->name, w->sname, stream, event);
+ dev_dbg(w->dapm->dev, "widget %s\n %s stream %s event %d\n",
+ w->name, w->sname, stream, event);
if (strstr(w->sname, stream)) {
switch(event) {
case SND_SOC_DAPM_STREAM_START:
list_for_each_entry(w, &dapm->widgets, list) {
if (!strcmp(w->name, pin)) {
- pr_debug("dapm: %s: pin %s\n", dapm->codec->name, pin);
+ dev_dbg(w->dapm->dev,
+ "dapm: force enable pin %s\n", pin);
w->connected = 1;
w->force = 1;
return 0;
}
}
- pr_err("dapm: %s: configuring unknown pin %s\n",
- dapm->codec->name, pin);
+ dev_err(dapm->dev, "dapm: unknown pin %s\n", pin);
return -EINVAL;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_force_enable_pin);
}
}
- pr_err("Unknown DAPM pin: %s\n", pin);
+ dev_err(dapm->dev, "dapm: unknown pin %s\n", pin);
return -EINVAL;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_ignore_suspend);