return !list_empty(&w->dirty);
}
-static void dapm_mark_dirty(struct snd_soc_dapm_widget *w)
+static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
{
- if (!dapm_dirty_widget(w))
+ if (!dapm_dirty_widget(w)) {
+ dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n",
+ w->name, reason);
list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty);
+ }
}
/* create a new dapm widget */
/* If the peer is already in the state we're moving to then we
* won't have an impact on it. */
if (power != peer->power)
- dapm_mark_dirty(peer);
+ dapm_mark_dirty(peer, "peer state change");
}
static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
/* we now need to match the string in the enum to the path */
if (!(strcmp(path->name, e->texts[mux]))) {
path->connect = 1; /* new connection */
- dapm_mark_dirty(path->source);
+ dapm_mark_dirty(path->source, "mux connection");
} else {
if (path->connect)
- dapm_mark_dirty(path->source);
+ dapm_mark_dirty(path->source,
+ "mux disconnection");
path->connect = 0; /* old connection must be powered down */
}
}
if (found) {
- dapm_mark_dirty(widget);
+ dapm_mark_dirty(widget, "mux change");
dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
}
/* found, now check type */
found = 1;
path->connect = connect;
- dapm_mark_dirty(path->source);
+ dapm_mark_dirty(path->source, "mixer connection");
}
if (found) {
- dapm_mark_dirty(widget);
+ dapm_mark_dirty(widget, "mixer update");
dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
}
w->connected = status;
if (status == 0)
w->force = 0;
- dapm_mark_dirty(w);
+ dapm_mark_dirty(w, "pin configuration");
return 0;
}
dev_vdbg(w->dapm->dev, "widget %s\n %s stream %s event %d\n",
w->name, w->sname, stream, event);
if (strstr(w->sname, stream)) {
- dapm_mark_dirty(w);
+ dapm_mark_dirty(w, "stream event");
switch(event) {
case SND_SOC_DAPM_STREAM_START:
w->active = 1;
dev_dbg(w->dapm->dev, "dapm: force enable pin %s\n", pin);
w->connected = 1;
w->force = 1;
- dapm_mark_dirty(w);
+ dapm_mark_dirty(w, "force enable");
return 0;
}