#include <sound/soc-dapm.h>
#include <sound/initval.h>
-/* debug */
-#ifdef DEBUG
-#define dump_dapm(codec, action) dbg_dump_dapm(codec, action)
-#else
-#define dump_dapm(codec, action)
-#endif
-
/* dapm power sequences - make this per codec in the future */
static int dapm_up_seq[] = {
[snd_soc_dapm_pre] = 0,
return 0;
}
-#ifdef DEBUG
-static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action)
-{
- struct snd_soc_dapm_widget *w;
- struct snd_soc_dapm_path *p = NULL;
- int in, out;
-
- printk("DAPM %s %s\n", codec->name, action);
-
- list_for_each_entry(w, &codec->dapm_widgets, list) {
-
- /* only display widgets that effect routing */
- switch (w->id) {
- case snd_soc_dapm_pre:
- case snd_soc_dapm_post:
- case snd_soc_dapm_vmid:
- continue;
- case snd_soc_dapm_mux:
- case snd_soc_dapm_value_mux:
- case snd_soc_dapm_output:
- case snd_soc_dapm_input:
- case snd_soc_dapm_switch:
- case snd_soc_dapm_hp:
- case snd_soc_dapm_mic:
- case snd_soc_dapm_spk:
- case snd_soc_dapm_line:
- case snd_soc_dapm_micbias:
- case snd_soc_dapm_dac:
- case snd_soc_dapm_adc:
- case snd_soc_dapm_pga:
- case snd_soc_dapm_mixer:
- case snd_soc_dapm_mixer_named_ctl:
- case snd_soc_dapm_supply:
- case snd_soc_dapm_aif_in:
- case snd_soc_dapm_aif_out:
- if (w->name) {
- in = is_connected_input_ep(w);
- dapm_clear_walk(w->codec);
- out = is_connected_output_ep(w);
- dapm_clear_walk(w->codec);
- printk("%s: %s in %d out %d\n", w->name,
- w->power ? "On":"Off",in, out);
-
- list_for_each_entry(p, &w->sources, list_sink) {
- if (p->connect)
- printk(" in %s %s\n", p->name ? p->name : "static",
- p->source->name);
- }
- list_for_each_entry(p, &w->sinks, list_source) {
- if (p->connect)
- printk(" out %s %s\n", p->name ? p->name : "static",
- p->sink->name);
- }
- }
- break;
- }
- }
-}
-#endif
-
#ifdef CONFIG_DEBUG_FS
static int dapm_widget_power_open_file(struct inode *inode, struct file *file)
{
path->connect = 0; /* old connection must be powered down */
}
- if (found) {
+ if (found)
dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
- dump_dapm(widget->codec, "mux power update");
- }
return 0;
}
break;
}
- if (found) {
+ if (found)
dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
- dump_dapm(widget->codec, "mixer power update");
- }
return 0;
}
*/
int snd_soc_dapm_sync(struct snd_soc_codec *codec)
{
- int ret = dapm_power_widgets(codec, SND_SOC_DAPM_STREAM_NOP);
- dump_dapm(codec, "sync");
- return ret;
+ return dapm_power_widgets(codec, SND_SOC_DAPM_STREAM_NOP);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_sync);
dapm_power_widgets(codec, event);
mutex_unlock(&codec->mutex);
- dump_dapm(codec, __func__);
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_stream_event);