2 * soc-dapm.c -- ALSA SoC Dynamic Audio Power Management
4 * Copyright 2005 Wolfson Microelectronics PLC.
5 * Author: Liam Girdwood <lrg@slimlogic.co.uk>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 * o Changes power status of internal codec blocks depending on the
14 * dynamic configuration of codec internal audio paths and active
16 * o Platform power domain - can support external components i.e. amps and
17 * mic/meadphone insertion events.
18 * o Automatic Mic Bias support
19 * o Jack insertion power event initiation - e.g. hp insertion will enable
21 * o Delayed powerdown of audio susbsystem to reduce pops between a quick
25 * o DAPM power change sequencing - allow for configurable per
27 * o Support for analogue bias optimisation.
28 * o Support for reduced codec oversampling rates.
29 * o Support for reduced codec bias currents.
32 #include <linux/module.h>
33 #include <linux/moduleparam.h>
34 #include <linux/init.h>
35 #include <linux/delay.h>
37 #include <linux/bitops.h>
38 #include <linux/platform_device.h>
39 #include <linux/jiffies.h>
40 #include <sound/core.h>
41 #include <sound/pcm.h>
42 #include <sound/pcm_params.h>
43 #include <sound/soc-dapm.h>
44 #include <sound/initval.h>
48 #define dump_dapm(codec, action) dbg_dump_dapm(codec, action)
50 #define dump_dapm(codec, action)
53 /* dapm power sequences - make this per codec in the future */
54 static int dapm_up_seq[] = {
55 snd_soc_dapm_pre, snd_soc_dapm_micbias, snd_soc_dapm_mic,
56 snd_soc_dapm_mux, snd_soc_dapm_value_mux, snd_soc_dapm_dac,
57 snd_soc_dapm_mixer, snd_soc_dapm_mixer_named_ctl, snd_soc_dapm_pga,
58 snd_soc_dapm_adc, snd_soc_dapm_hp, snd_soc_dapm_spk, snd_soc_dapm_post
61 static int dapm_down_seq[] = {
62 snd_soc_dapm_pre, snd_soc_dapm_adc, snd_soc_dapm_hp, snd_soc_dapm_spk,
63 snd_soc_dapm_pga, snd_soc_dapm_mixer_named_ctl, snd_soc_dapm_mixer,
64 snd_soc_dapm_dac, snd_soc_dapm_mic, snd_soc_dapm_micbias,
65 snd_soc_dapm_mux, snd_soc_dapm_value_mux, snd_soc_dapm_post
68 static int dapm_status = 1;
69 module_param(dapm_status, int, 0);
70 MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");
72 static void pop_wait(u32 pop_time)
75 schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
78 static void pop_dbg(u32 pop_time, const char *fmt, ...)
92 /* create a new dapm widget */
93 static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
94 const struct snd_soc_dapm_widget *_widget)
96 return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
99 /* set up initial codec paths */
100 static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
101 struct snd_soc_dapm_path *p, int i)
104 case snd_soc_dapm_switch:
105 case snd_soc_dapm_mixer:
106 case snd_soc_dapm_mixer_named_ctl: {
108 struct soc_mixer_control *mc = (struct soc_mixer_control *)
109 w->kcontrols[i].private_value;
110 unsigned int reg = mc->reg;
111 unsigned int shift = mc->shift;
113 unsigned int mask = (1 << fls(max)) - 1;
114 unsigned int invert = mc->invert;
116 val = snd_soc_read(w->codec, reg);
117 val = (val >> shift) & mask;
119 if ((invert && !val) || (!invert && val))
125 case snd_soc_dapm_mux: {
126 struct soc_enum *e = (struct soc_enum *)w->kcontrols[i].private_value;
127 int val, item, bitmask;
129 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
131 val = snd_soc_read(w->codec, e->reg);
132 item = (val >> e->shift_l) & (bitmask - 1);
135 for (i = 0; i < e->max; i++) {
136 if (!(strcmp(p->name, e->texts[i])) && item == i)
141 case snd_soc_dapm_value_mux: {
142 struct soc_value_enum *e = (struct soc_value_enum *)
143 w->kcontrols[i].private_value;
146 val = snd_soc_read(w->codec, e->reg);
147 val = (val >> e->shift_l) & e->mask;
148 for (item = 0; item < e->max; item++) {
149 if (val == e->values[item])
154 for (i = 0; i < e->max; i++) {
155 if (!(strcmp(p->name, e->texts[i])) && item == i)
160 /* does not effect routing - always connected */
161 case snd_soc_dapm_pga:
162 case snd_soc_dapm_output:
163 case snd_soc_dapm_adc:
164 case snd_soc_dapm_input:
165 case snd_soc_dapm_dac:
166 case snd_soc_dapm_micbias:
167 case snd_soc_dapm_vmid:
170 /* does effect routing - dynamically connected */
171 case snd_soc_dapm_hp:
172 case snd_soc_dapm_mic:
173 case snd_soc_dapm_spk:
174 case snd_soc_dapm_line:
175 case snd_soc_dapm_pre:
176 case snd_soc_dapm_post:
182 /* connect mux widget to it's interconnecting audio paths */
183 static int dapm_connect_mux(struct snd_soc_codec *codec,
184 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
185 struct snd_soc_dapm_path *path, const char *control_name,
186 const struct snd_kcontrol_new *kcontrol)
188 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
191 for (i = 0; i < e->max; i++) {
192 if (!(strcmp(control_name, e->texts[i]))) {
193 list_add(&path->list, &codec->dapm_paths);
194 list_add(&path->list_sink, &dest->sources);
195 list_add(&path->list_source, &src->sinks);
196 path->name = (char*)e->texts[i];
197 dapm_set_path_status(dest, path, 0);
205 /* connect value_mux widget to it's interconnecting audio paths */
206 static int dapm_connect_value_mux(struct snd_soc_codec *codec,
207 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
208 struct snd_soc_dapm_path *path, const char *control_name,
209 const struct snd_kcontrol_new *kcontrol)
211 struct soc_value_enum *e = (struct soc_value_enum *)
212 kcontrol->private_value;
215 for (i = 0; i < e->max; i++) {
216 if (!(strcmp(control_name, e->texts[i]))) {
217 list_add(&path->list, &codec->dapm_paths);
218 list_add(&path->list_sink, &dest->sources);
219 list_add(&path->list_source, &src->sinks);
220 path->name = (char *)e->texts[i];
221 dapm_set_path_status(dest, path, 0);
229 /* connect mixer widget to it's interconnecting audio paths */
230 static int dapm_connect_mixer(struct snd_soc_codec *codec,
231 struct snd_soc_dapm_widget *src, struct snd_soc_dapm_widget *dest,
232 struct snd_soc_dapm_path *path, const char *control_name)
236 /* search for mixer kcontrol */
237 for (i = 0; i < dest->num_kcontrols; i++) {
238 if (!strcmp(control_name, dest->kcontrols[i].name)) {
239 list_add(&path->list, &codec->dapm_paths);
240 list_add(&path->list_sink, &dest->sources);
241 list_add(&path->list_source, &src->sinks);
242 path->name = dest->kcontrols[i].name;
243 dapm_set_path_status(dest, path, i);
250 /* update dapm codec register bits */
251 static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
254 unsigned short old, new;
255 struct snd_soc_codec *codec = widget->codec;
257 /* check for valid widgets */
258 if (widget->reg < 0 || widget->id == snd_soc_dapm_input ||
259 widget->id == snd_soc_dapm_output ||
260 widget->id == snd_soc_dapm_hp ||
261 widget->id == snd_soc_dapm_mic ||
262 widget->id == snd_soc_dapm_line ||
263 widget->id == snd_soc_dapm_spk)
266 power = widget->power;
268 power = (power ? 0:1);
270 old = snd_soc_read(codec, widget->reg);
271 new = (old & ~(0x1 << widget->shift)) | (power << widget->shift);
275 pop_dbg(codec->pop_time, "pop test %s : %s in %d ms\n",
276 widget->name, widget->power ? "on" : "off",
278 snd_soc_write(codec, widget->reg, new);
279 pop_wait(codec->pop_time);
281 pr_debug("reg %x old %x new %x change %d\n", widget->reg,
286 /* ramps the volume up or down to minimise pops before or after a
287 * DAPM power event */
288 static int dapm_set_pga(struct snd_soc_dapm_widget *widget, int power)
290 const struct snd_kcontrol_new *k = widget->kcontrols;
292 if (widget->muted && !power)
294 if (!widget->muted && power)
297 if (widget->num_kcontrols && k) {
298 struct soc_mixer_control *mc =
299 (struct soc_mixer_control *)k->private_value;
300 unsigned int reg = mc->reg;
301 unsigned int shift = mc->shift;
303 unsigned int mask = (1 << fls(max)) - 1;
304 unsigned int invert = mc->invert;
308 /* power up has happended, increase volume to last level */
310 for (i = max; i > widget->saved_value; i--)
311 snd_soc_update_bits(widget->codec, reg, mask, i);
313 for (i = 0; i < widget->saved_value; i++)
314 snd_soc_update_bits(widget->codec, reg, mask, i);
318 /* power down is about to occur, decrease volume to mute */
319 int val = snd_soc_read(widget->codec, reg);
320 int i = widget->saved_value = (val >> shift) & mask;
322 for (; i < mask; i++)
323 snd_soc_update_bits(widget->codec, reg, mask, i);
326 snd_soc_update_bits(widget->codec, reg, mask, i);
334 /* create new dapm mixer control */
335 static int dapm_new_mixer(struct snd_soc_codec *codec,
336 struct snd_soc_dapm_widget *w)
340 struct snd_soc_dapm_path *path;
343 for (i = 0; i < w->num_kcontrols; i++) {
346 list_for_each_entry(path, &w->sources, list_sink) {
348 /* mixer/mux paths name must match control name */
349 if (path->name != (char*)w->kcontrols[i].name)
352 /* add dapm control with long name.
353 * for dapm_mixer this is the concatenation of the
354 * mixer and kcontrol name.
355 * for dapm_mixer_named_ctl this is simply the
358 name_len = strlen(w->kcontrols[i].name) + 1;
359 if (w->id == snd_soc_dapm_mixer)
360 name_len += 1 + strlen(w->name);
362 path->long_name = kmalloc(name_len, GFP_KERNEL);
364 if (path->long_name == NULL)
368 case snd_soc_dapm_mixer:
370 snprintf(path->long_name, name_len, "%s %s",
371 w->name, w->kcontrols[i].name);
373 case snd_soc_dapm_mixer_named_ctl:
374 snprintf(path->long_name, name_len, "%s",
375 w->kcontrols[i].name);
379 path->long_name[name_len - 1] = '\0';
381 path->kcontrol = snd_soc_cnew(&w->kcontrols[i], w,
383 ret = snd_ctl_add(codec->card, path->kcontrol);
385 printk(KERN_ERR "asoc: failed to add dapm kcontrol %s\n",
387 kfree(path->long_name);
388 path->long_name = NULL;
396 /* create new dapm mux control */
397 static int dapm_new_mux(struct snd_soc_codec *codec,
398 struct snd_soc_dapm_widget *w)
400 struct snd_soc_dapm_path *path = NULL;
401 struct snd_kcontrol *kcontrol;
404 if (!w->num_kcontrols) {
405 printk(KERN_ERR "asoc: mux %s has no controls\n", w->name);
409 kcontrol = snd_soc_cnew(&w->kcontrols[0], w, w->name);
410 ret = snd_ctl_add(codec->card, kcontrol);
414 list_for_each_entry(path, &w->sources, list_sink)
415 path->kcontrol = kcontrol;
420 printk(KERN_ERR "asoc: failed to add kcontrol %s\n", w->name);
424 /* create new dapm volume control */
425 static int dapm_new_pga(struct snd_soc_codec *codec,
426 struct snd_soc_dapm_widget *w)
428 struct snd_kcontrol *kcontrol;
431 if (!w->num_kcontrols)
434 kcontrol = snd_soc_cnew(&w->kcontrols[0], w, w->name);
435 ret = snd_ctl_add(codec->card, kcontrol);
437 printk(KERN_ERR "asoc: failed to add kcontrol %s\n", w->name);
444 /* reset 'walked' bit for each dapm path */
445 static inline void dapm_clear_walk(struct snd_soc_codec *codec)
447 struct snd_soc_dapm_path *p;
449 list_for_each_entry(p, &codec->dapm_paths, list)
454 * Recursively check for a completed path to an active or physically connected
455 * output widget. Returns number of complete paths.
457 static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
459 struct snd_soc_dapm_path *path;
462 if (widget->id == snd_soc_dapm_adc && widget->active)
465 if (widget->connected) {
466 /* connected pin ? */
467 if (widget->id == snd_soc_dapm_output && !widget->ext)
470 /* connected jack or spk ? */
471 if (widget->id == snd_soc_dapm_hp || widget->id == snd_soc_dapm_spk ||
472 widget->id == snd_soc_dapm_line)
476 list_for_each_entry(path, &widget->sinks, list_source) {
480 if (path->sink && path->connect) {
482 con += is_connected_output_ep(path->sink);
490 * Recursively check for a completed path to an active or physically connected
491 * input widget. Returns number of complete paths.
493 static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
495 struct snd_soc_dapm_path *path;
498 /* active stream ? */
499 if (widget->id == snd_soc_dapm_dac && widget->active)
502 if (widget->connected) {
503 /* connected pin ? */
504 if (widget->id == snd_soc_dapm_input && !widget->ext)
507 /* connected VMID/Bias for lower pops */
508 if (widget->id == snd_soc_dapm_vmid)
511 /* connected jack ? */
512 if (widget->id == snd_soc_dapm_mic || widget->id == snd_soc_dapm_line)
516 list_for_each_entry(path, &widget->sources, list_sink) {
520 if (path->source && path->connect) {
522 con += is_connected_input_ep(path->source);
530 * Handler for generic register modifier widget.
532 int dapm_reg_event(struct snd_soc_dapm_widget *w,
533 struct snd_kcontrol *kcontrol, int event)
537 if (SND_SOC_DAPM_EVENT_ON(event))
542 snd_soc_update_bits(w->codec, -(w->reg + 1),
543 w->mask << w->shift, val << w->shift);
547 EXPORT_SYMBOL_GPL(dapm_reg_event);
550 * Scan each dapm widget for complete audio path.
551 * A complete path is a route that has valid endpoints i.e.:-
553 * o DAC to output pin.
554 * o Input Pin to ADC.
555 * o Input pin to Output pin (bypass, sidetone)
556 * o DAC to ADC (loopback).
558 static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
560 struct snd_soc_dapm_widget *w;
561 int in, out, i, c = 1, *seq = NULL, ret = 0, power_change, power;
563 /* do we have a sequenced stream event */
564 if (event == SND_SOC_DAPM_STREAM_START) {
565 c = ARRAY_SIZE(dapm_up_seq);
567 } else if (event == SND_SOC_DAPM_STREAM_STOP) {
568 c = ARRAY_SIZE(dapm_down_seq);
572 for(i = 0; i < c; i++) {
573 list_for_each_entry(w, &codec->dapm_widgets, list) {
575 /* is widget in stream order */
576 if (seq && seq[i] && w->id != seq[i])
579 /* vmid - no action */
580 if (w->id == snd_soc_dapm_vmid)
584 if (w->id == snd_soc_dapm_adc && w->active) {
585 in = is_connected_input_ep(w);
586 dapm_clear_walk(w->codec);
587 w->power = (in != 0) ? 1 : 0;
593 if (w->id == snd_soc_dapm_dac && w->active) {
594 out = is_connected_output_ep(w);
595 dapm_clear_walk(w->codec);
596 w->power = (out != 0) ? 1 : 0;
601 /* pre and post event widgets */
602 if (w->id == snd_soc_dapm_pre) {
606 if (event == SND_SOC_DAPM_STREAM_START) {
608 NULL, SND_SOC_DAPM_PRE_PMU);
611 } else if (event == SND_SOC_DAPM_STREAM_STOP) {
613 NULL, SND_SOC_DAPM_PRE_PMD);
619 if (w->id == snd_soc_dapm_post) {
623 if (event == SND_SOC_DAPM_STREAM_START) {
625 NULL, SND_SOC_DAPM_POST_PMU);
628 } else if (event == SND_SOC_DAPM_STREAM_STOP) {
630 NULL, SND_SOC_DAPM_POST_PMD);
637 /* all other widgets */
638 in = is_connected_input_ep(w);
639 dapm_clear_walk(w->codec);
640 out = is_connected_output_ep(w);
641 dapm_clear_walk(w->codec);
642 power = (out != 0 && in != 0) ? 1 : 0;
643 power_change = (w->power == power) ? 0: 1;
649 /* call any power change event handlers */
651 pr_debug("power %s event for %s flags %x\n",
652 w->power ? "on" : "off",
653 w->name, w->event_flags);
655 /* power up pre event */
656 if (power && w->event &&
657 (w->event_flags & SND_SOC_DAPM_PRE_PMU)) {
658 ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU);
663 /* power down pre event */
664 if (!power && w->event &&
665 (w->event_flags & SND_SOC_DAPM_PRE_PMD)) {
666 ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD);
671 /* Lower PGA volume to reduce pops */
672 if (w->id == snd_soc_dapm_pga && !power)
673 dapm_set_pga(w, power);
677 /* Raise PGA volume to reduce pops */
678 if (w->id == snd_soc_dapm_pga && power)
679 dapm_set_pga(w, power);
681 /* power up post event */
682 if (power && w->event &&
683 (w->event_flags & SND_SOC_DAPM_POST_PMU)) {
685 NULL, SND_SOC_DAPM_POST_PMU);
690 /* power down post event */
691 if (!power && w->event &&
692 (w->event_flags & SND_SOC_DAPM_POST_PMD)) {
693 ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD);
704 static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action)
706 struct snd_soc_dapm_widget *w;
707 struct snd_soc_dapm_path *p = NULL;
710 printk("DAPM %s %s\n", codec->name, action);
712 list_for_each_entry(w, &codec->dapm_widgets, list) {
714 /* only display widgets that effect routing */
716 case snd_soc_dapm_pre:
717 case snd_soc_dapm_post:
718 case snd_soc_dapm_vmid:
720 case snd_soc_dapm_mux:
721 case snd_soc_dapm_value_mux:
722 case snd_soc_dapm_output:
723 case snd_soc_dapm_input:
724 case snd_soc_dapm_switch:
725 case snd_soc_dapm_hp:
726 case snd_soc_dapm_mic:
727 case snd_soc_dapm_spk:
728 case snd_soc_dapm_line:
729 case snd_soc_dapm_micbias:
730 case snd_soc_dapm_dac:
731 case snd_soc_dapm_adc:
732 case snd_soc_dapm_pga:
733 case snd_soc_dapm_mixer:
734 case snd_soc_dapm_mixer_named_ctl:
736 in = is_connected_input_ep(w);
737 dapm_clear_walk(w->codec);
738 out = is_connected_output_ep(w);
739 dapm_clear_walk(w->codec);
740 printk("%s: %s in %d out %d\n", w->name,
741 w->power ? "On":"Off",in, out);
743 list_for_each_entry(p, &w->sources, list_sink) {
745 printk(" in %s %s\n", p->name ? p->name : "static",
748 list_for_each_entry(p, &w->sinks, list_source) {
750 printk(" out %s %s\n", p->name ? p->name : "static",
760 /* test and update the power status of a mux widget */
761 static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
762 struct snd_kcontrol *kcontrol, int mask,
763 int mux, int val, struct soc_enum *e)
765 struct snd_soc_dapm_path *path;
768 if (widget->id != snd_soc_dapm_mux)
771 if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
774 /* find dapm widget path assoc with kcontrol */
775 list_for_each_entry(path, &widget->codec->dapm_paths, list) {
776 if (path->kcontrol != kcontrol)
779 if (!path->name || !e->texts[mux])
783 /* we now need to match the string in the enum to the path */
784 if (!(strcmp(path->name, e->texts[mux])))
785 path->connect = 1; /* new connection */
787 path->connect = 0; /* old connection must be powered down */
791 dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
792 dump_dapm(widget->codec, "mux power update");
798 /* test and update the power status of a value_mux widget */
799 static int dapm_value_mux_update_power(struct snd_soc_dapm_widget *widget,
800 struct snd_kcontrol *kcontrol, int mask,
801 int mux, int val, struct soc_value_enum *e)
803 struct snd_soc_dapm_path *path;
806 if (widget->id != snd_soc_dapm_value_mux)
809 if (!snd_soc_test_bits(widget->codec, e->reg, mask, val))
812 /* find dapm widget path assoc with kcontrol */
813 list_for_each_entry(path, &widget->codec->dapm_paths, list) {
814 if (path->kcontrol != kcontrol)
817 if (!path->name || !e->texts[mux])
821 /* we now need to match the string in the enum to the path */
822 if (!(strcmp(path->name, e->texts[mux])))
823 path->connect = 1; /* new connection */
825 path->connect = 0; /* old connection must be
830 dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
831 dump_dapm(widget->codec, "mux power update");
837 /* test and update the power status of a mixer or switch widget */
838 static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
839 struct snd_kcontrol *kcontrol, int reg,
840 int val_mask, int val, int invert)
842 struct snd_soc_dapm_path *path;
845 if (widget->id != snd_soc_dapm_mixer &&
846 widget->id != snd_soc_dapm_mixer_named_ctl &&
847 widget->id != snd_soc_dapm_switch)
850 if (!snd_soc_test_bits(widget->codec, reg, val_mask, val))
853 /* find dapm widget path assoc with kcontrol */
854 list_for_each_entry(path, &widget->codec->dapm_paths, list) {
855 if (path->kcontrol != kcontrol)
858 /* found, now check type */
862 path->connect = invert ? 0:1;
864 /* old connection must be powered down */
865 path->connect = invert ? 1:0;
870 dapm_power_widgets(widget->codec, SND_SOC_DAPM_STREAM_NOP);
871 dump_dapm(widget->codec, "mixer power update");
877 /* show dapm widget status in sys fs */
878 static ssize_t dapm_widget_show(struct device *dev,
879 struct device_attribute *attr, char *buf)
881 struct snd_soc_device *devdata = dev_get_drvdata(dev);
882 struct snd_soc_codec *codec = devdata->codec;
883 struct snd_soc_dapm_widget *w;
885 char *state = "not set";
887 list_for_each_entry(w, &codec->dapm_widgets, list) {
889 /* only display widgets that burnm power */
891 case snd_soc_dapm_hp:
892 case snd_soc_dapm_mic:
893 case snd_soc_dapm_spk:
894 case snd_soc_dapm_line:
895 case snd_soc_dapm_micbias:
896 case snd_soc_dapm_dac:
897 case snd_soc_dapm_adc:
898 case snd_soc_dapm_pga:
899 case snd_soc_dapm_mixer:
900 case snd_soc_dapm_mixer_named_ctl:
902 count += sprintf(buf + count, "%s: %s\n",
903 w->name, w->power ? "On":"Off");
910 switch (codec->bias_level) {
911 case SND_SOC_BIAS_ON:
914 case SND_SOC_BIAS_PREPARE:
917 case SND_SOC_BIAS_STANDBY:
920 case SND_SOC_BIAS_OFF:
924 count += sprintf(buf + count, "PM State: %s\n", state);
929 static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);
931 int snd_soc_dapm_sys_add(struct device *dev)
935 return device_create_file(dev, &dev_attr_dapm_widget);
938 static void snd_soc_dapm_sys_remove(struct device *dev)
941 device_remove_file(dev, &dev_attr_dapm_widget);
945 /* free all dapm widgets and resources */
946 static void dapm_free_widgets(struct snd_soc_codec *codec)
948 struct snd_soc_dapm_widget *w, *next_w;
949 struct snd_soc_dapm_path *p, *next_p;
951 list_for_each_entry_safe(w, next_w, &codec->dapm_widgets, list) {
956 list_for_each_entry_safe(p, next_p, &codec->dapm_paths, list) {
963 static int snd_soc_dapm_set_pin(struct snd_soc_codec *codec,
964 char *pin, int status)
966 struct snd_soc_dapm_widget *w;
968 list_for_each_entry(w, &codec->dapm_widgets, list) {
969 if (!strcmp(w->name, pin)) {
970 pr_debug("dapm: %s: pin %s\n", codec->name, pin);
971 w->connected = status;
976 pr_err("dapm: %s: configuring unknown pin %s\n", codec->name, pin);
981 * snd_soc_dapm_sync - scan and power dapm paths
982 * @codec: audio codec
984 * Walks all dapm audio paths and powers widgets according to their
985 * stream or path usage.
987 * Returns 0 for success.
989 int snd_soc_dapm_sync(struct snd_soc_codec *codec)
991 int ret = dapm_power_widgets(codec, SND_SOC_DAPM_STREAM_NOP);
992 dump_dapm(codec, "sync");
995 EXPORT_SYMBOL_GPL(snd_soc_dapm_sync);
997 static int snd_soc_dapm_add_route(struct snd_soc_codec *codec,
998 const char *sink, const char *control, const char *source)
1000 struct snd_soc_dapm_path *path;
1001 struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w;
1004 /* find src and dest widgets */
1005 list_for_each_entry(w, &codec->dapm_widgets, list) {
1007 if (!wsink && !(strcmp(w->name, sink))) {
1011 if (!wsource && !(strcmp(w->name, source))) {
1016 if (wsource == NULL || wsink == NULL)
1019 path = kzalloc(sizeof(struct snd_soc_dapm_path), GFP_KERNEL);
1023 path->source = wsource;
1025 INIT_LIST_HEAD(&path->list);
1026 INIT_LIST_HEAD(&path->list_source);
1027 INIT_LIST_HEAD(&path->list_sink);
1029 /* check for external widgets */
1030 if (wsink->id == snd_soc_dapm_input) {
1031 if (wsource->id == snd_soc_dapm_micbias ||
1032 wsource->id == snd_soc_dapm_mic ||
1033 wsink->id == snd_soc_dapm_line ||
1034 wsink->id == snd_soc_dapm_output)
1037 if (wsource->id == snd_soc_dapm_output) {
1038 if (wsink->id == snd_soc_dapm_spk ||
1039 wsink->id == snd_soc_dapm_hp ||
1040 wsink->id == snd_soc_dapm_line ||
1041 wsink->id == snd_soc_dapm_input)
1045 /* connect static paths */
1046 if (control == NULL) {
1047 list_add(&path->list, &codec->dapm_paths);
1048 list_add(&path->list_sink, &wsink->sources);
1049 list_add(&path->list_source, &wsource->sinks);
1054 /* connect dynamic paths */
1056 case snd_soc_dapm_adc:
1057 case snd_soc_dapm_dac:
1058 case snd_soc_dapm_pga:
1059 case snd_soc_dapm_input:
1060 case snd_soc_dapm_output:
1061 case snd_soc_dapm_micbias:
1062 case snd_soc_dapm_vmid:
1063 case snd_soc_dapm_pre:
1064 case snd_soc_dapm_post:
1065 list_add(&path->list, &codec->dapm_paths);
1066 list_add(&path->list_sink, &wsink->sources);
1067 list_add(&path->list_source, &wsource->sinks);
1070 case snd_soc_dapm_mux:
1071 ret = dapm_connect_mux(codec, wsource, wsink, path, control,
1072 &wsink->kcontrols[0]);
1076 case snd_soc_dapm_value_mux:
1077 ret = dapm_connect_value_mux(codec, wsource, wsink, path,
1078 control, &wsink->kcontrols[0]);
1082 case snd_soc_dapm_switch:
1083 case snd_soc_dapm_mixer:
1084 case snd_soc_dapm_mixer_named_ctl:
1085 ret = dapm_connect_mixer(codec, wsource, wsink, path, control);
1089 case snd_soc_dapm_hp:
1090 case snd_soc_dapm_mic:
1091 case snd_soc_dapm_line:
1092 case snd_soc_dapm_spk:
1093 list_add(&path->list, &codec->dapm_paths);
1094 list_add(&path->list_sink, &wsink->sources);
1095 list_add(&path->list_source, &wsource->sinks);
1102 printk(KERN_WARNING "asoc: no dapm match for %s --> %s --> %s\n", source,
1109 * snd_soc_dapm_add_routes - Add routes between DAPM widgets
1111 * @route: audio routes
1112 * @num: number of routes
1114 * Connects 2 dapm widgets together via a named audio path. The sink is
1115 * the widget receiving the audio signal, whilst the source is the sender
1116 * of the audio signal.
1118 * Returns 0 for success else error. On error all resources can be freed
1119 * with a call to snd_soc_card_free().
1121 int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
1122 const struct snd_soc_dapm_route *route, int num)
1126 for (i = 0; i < num; i++) {
1127 ret = snd_soc_dapm_add_route(codec, route->sink,
1128 route->control, route->source);
1130 printk(KERN_ERR "Failed to add route %s->%s\n",
1140 EXPORT_SYMBOL_GPL(snd_soc_dapm_add_routes);
1143 * snd_soc_dapm_new_widgets - add new dapm widgets
1144 * @codec: audio codec
1146 * Checks the codec for any new dapm widgets and creates them if found.
1148 * Returns 0 for success.
1150 int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec)
1152 struct snd_soc_dapm_widget *w;
1154 list_for_each_entry(w, &codec->dapm_widgets, list)
1160 case snd_soc_dapm_switch:
1161 case snd_soc_dapm_mixer:
1162 case snd_soc_dapm_mixer_named_ctl:
1163 dapm_new_mixer(codec, w);
1165 case snd_soc_dapm_mux:
1166 case snd_soc_dapm_value_mux:
1167 dapm_new_mux(codec, w);
1169 case snd_soc_dapm_adc:
1170 case snd_soc_dapm_dac:
1171 case snd_soc_dapm_pga:
1172 dapm_new_pga(codec, w);
1174 case snd_soc_dapm_input:
1175 case snd_soc_dapm_output:
1176 case snd_soc_dapm_micbias:
1177 case snd_soc_dapm_spk:
1178 case snd_soc_dapm_hp:
1179 case snd_soc_dapm_mic:
1180 case snd_soc_dapm_line:
1181 case snd_soc_dapm_vmid:
1182 case snd_soc_dapm_pre:
1183 case snd_soc_dapm_post:
1189 dapm_power_widgets(codec, SND_SOC_DAPM_STREAM_NOP);
1192 EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets);
1195 * snd_soc_dapm_get_volsw - dapm mixer get callback
1196 * @kcontrol: mixer control
1197 * @ucontrol: control element information
1199 * Callback to get the value of a dapm mixer control.
1201 * Returns 0 for success.
1203 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
1204 struct snd_ctl_elem_value *ucontrol)
1206 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1207 struct soc_mixer_control *mc =
1208 (struct soc_mixer_control *)kcontrol->private_value;
1209 unsigned int reg = mc->reg;
1210 unsigned int shift = mc->shift;
1211 unsigned int rshift = mc->rshift;
1213 unsigned int invert = mc->invert;
1214 unsigned int mask = (1 << fls(max)) - 1;
1216 /* return the saved value if we are powered down */
1217 if (widget->id == snd_soc_dapm_pga && !widget->power) {
1218 ucontrol->value.integer.value[0] = widget->saved_value;
1222 ucontrol->value.integer.value[0] =
1223 (snd_soc_read(widget->codec, reg) >> shift) & mask;
1224 if (shift != rshift)
1225 ucontrol->value.integer.value[1] =
1226 (snd_soc_read(widget->codec, reg) >> rshift) & mask;
1228 ucontrol->value.integer.value[0] =
1229 max - ucontrol->value.integer.value[0];
1230 if (shift != rshift)
1231 ucontrol->value.integer.value[1] =
1232 max - ucontrol->value.integer.value[1];
1237 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_volsw);
1240 * snd_soc_dapm_put_volsw - dapm mixer set callback
1241 * @kcontrol: mixer control
1242 * @ucontrol: control element information
1244 * Callback to set the value of a dapm mixer control.
1246 * Returns 0 for success.
1248 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
1249 struct snd_ctl_elem_value *ucontrol)
1251 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1252 struct soc_mixer_control *mc =
1253 (struct soc_mixer_control *)kcontrol->private_value;
1254 unsigned int reg = mc->reg;
1255 unsigned int shift = mc->shift;
1256 unsigned int rshift = mc->rshift;
1258 unsigned int mask = (1 << fls(max)) - 1;
1259 unsigned int invert = mc->invert;
1260 unsigned short val, val2, val_mask;
1263 val = (ucontrol->value.integer.value[0] & mask);
1267 val_mask = mask << shift;
1269 if (shift != rshift) {
1270 val2 = (ucontrol->value.integer.value[1] & mask);
1273 val_mask |= mask << rshift;
1274 val |= val2 << rshift;
1277 mutex_lock(&widget->codec->mutex);
1278 widget->value = val;
1280 /* save volume value if the widget is powered down */
1281 if (widget->id == snd_soc_dapm_pga && !widget->power) {
1282 widget->saved_value = val;
1283 mutex_unlock(&widget->codec->mutex);
1287 dapm_mixer_update_power(widget, kcontrol, reg, val_mask, val, invert);
1288 if (widget->event) {
1289 if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
1290 ret = widget->event(widget, kcontrol,
1291 SND_SOC_DAPM_PRE_REG);
1297 ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
1298 if (widget->event_flags & SND_SOC_DAPM_POST_REG)
1299 ret = widget->event(widget, kcontrol,
1300 SND_SOC_DAPM_POST_REG);
1302 ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
1305 mutex_unlock(&widget->codec->mutex);
1308 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
1311 * snd_soc_dapm_get_enum_double - dapm enumerated double mixer get callback
1312 * @kcontrol: mixer control
1313 * @ucontrol: control element information
1315 * Callback to get the value of a dapm enumerated double mixer control.
1317 * Returns 0 for success.
1319 int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
1320 struct snd_ctl_elem_value *ucontrol)
1322 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1323 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1324 unsigned short val, bitmask;
1326 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1328 val = snd_soc_read(widget->codec, e->reg);
1329 ucontrol->value.enumerated.item[0] = (val >> e->shift_l) & (bitmask - 1);
1330 if (e->shift_l != e->shift_r)
1331 ucontrol->value.enumerated.item[1] =
1332 (val >> e->shift_r) & (bitmask - 1);
1336 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double);
1339 * snd_soc_dapm_put_enum_double - dapm enumerated double mixer set callback
1340 * @kcontrol: mixer control
1341 * @ucontrol: control element information
1343 * Callback to set the value of a dapm enumerated double mixer control.
1345 * Returns 0 for success.
1347 int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
1348 struct snd_ctl_elem_value *ucontrol)
1350 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1351 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
1352 unsigned short val, mux;
1353 unsigned short mask, bitmask;
1356 for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
1358 if (ucontrol->value.enumerated.item[0] > e->max - 1)
1360 mux = ucontrol->value.enumerated.item[0];
1361 val = mux << e->shift_l;
1362 mask = (bitmask - 1) << e->shift_l;
1363 if (e->shift_l != e->shift_r) {
1364 if (ucontrol->value.enumerated.item[1] > e->max - 1)
1366 val |= ucontrol->value.enumerated.item[1] << e->shift_r;
1367 mask |= (bitmask - 1) << e->shift_r;
1370 mutex_lock(&widget->codec->mutex);
1371 widget->value = val;
1372 dapm_mux_update_power(widget, kcontrol, mask, mux, val, e);
1373 if (widget->event) {
1374 if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
1375 ret = widget->event(widget,
1376 kcontrol, SND_SOC_DAPM_PRE_REG);
1380 ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);
1381 if (widget->event_flags & SND_SOC_DAPM_POST_REG)
1382 ret = widget->event(widget,
1383 kcontrol, SND_SOC_DAPM_POST_REG);
1385 ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);
1388 mutex_unlock(&widget->codec->mutex);
1391 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_double);
1394 * snd_soc_dapm_get_value_enum_double - dapm semi enumerated double mixer get
1396 * @kcontrol: mixer control
1397 * @ucontrol: control element information
1399 * Callback to get the value of a dapm semi enumerated double mixer control.
1401 * Semi enumerated mixer: the enumerated items are referred as values. Can be
1402 * used for handling bitfield coded enumeration for example.
1404 * Returns 0 for success.
1406 int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
1407 struct snd_ctl_elem_value *ucontrol)
1409 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1410 struct soc_value_enum *e = (struct soc_value_enum *)
1411 kcontrol->private_value;
1412 unsigned short reg_val, val, mux;
1414 reg_val = snd_soc_read(widget->codec, e->reg);
1415 val = (reg_val >> e->shift_l) & e->mask;
1416 for (mux = 0; mux < e->max; mux++) {
1417 if (val == e->values[mux])
1420 ucontrol->value.enumerated.item[0] = mux;
1421 if (e->shift_l != e->shift_r) {
1422 val = (reg_val >> e->shift_r) & e->mask;
1423 for (mux = 0; mux < e->max; mux++) {
1424 if (val == e->values[mux])
1427 ucontrol->value.enumerated.item[1] = mux;
1432 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_value_enum_double);
1435 * snd_soc_dapm_put_value_enum_double - dapm semi enumerated double mixer set
1437 * @kcontrol: mixer control
1438 * @ucontrol: control element information
1440 * Callback to set the value of a dapm semi enumerated double mixer control.
1442 * Semi enumerated mixer: the enumerated items are referred as values. Can be
1443 * used for handling bitfield coded enumeration for example.
1445 * Returns 0 for success.
1447 int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
1448 struct snd_ctl_elem_value *ucontrol)
1450 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
1451 struct soc_value_enum *e = (struct soc_value_enum *)
1452 kcontrol->private_value;
1453 unsigned short val, mux;
1454 unsigned short mask;
1457 if (ucontrol->value.enumerated.item[0] > e->max - 1)
1459 mux = ucontrol->value.enumerated.item[0];
1460 val = e->values[ucontrol->value.enumerated.item[0]] << e->shift_l;
1461 mask = e->mask << e->shift_l;
1462 if (e->shift_l != e->shift_r) {
1463 if (ucontrol->value.enumerated.item[1] > e->max - 1)
1465 val |= e->values[ucontrol->value.enumerated.item[1]] << e->shift_r;
1466 mask |= e->mask << e->shift_r;
1469 mutex_lock(&widget->codec->mutex);
1470 widget->value = val;
1471 dapm_value_mux_update_power(widget, kcontrol, mask, mux, val, e);
1472 if (widget->event) {
1473 if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
1474 ret = widget->event(widget,
1475 kcontrol, SND_SOC_DAPM_PRE_REG);
1479 ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);
1480 if (widget->event_flags & SND_SOC_DAPM_POST_REG)
1481 ret = widget->event(widget,
1482 kcontrol, SND_SOC_DAPM_POST_REG);
1484 ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);
1487 mutex_unlock(&widget->codec->mutex);
1490 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_value_enum_double);
1493 * snd_soc_dapm_new_control - create new dapm control
1494 * @codec: audio codec
1495 * @widget: widget template
1497 * Creates a new dapm control based upon the template.
1499 * Returns 0 for success else error.
1501 int snd_soc_dapm_new_control(struct snd_soc_codec *codec,
1502 const struct snd_soc_dapm_widget *widget)
1504 struct snd_soc_dapm_widget *w;
1506 if ((w = dapm_cnew_widget(widget)) == NULL)
1510 INIT_LIST_HEAD(&w->sources);
1511 INIT_LIST_HEAD(&w->sinks);
1512 INIT_LIST_HEAD(&w->list);
1513 list_add(&w->list, &codec->dapm_widgets);
1515 /* machine layer set ups unconnected pins and insertions */
1519 EXPORT_SYMBOL_GPL(snd_soc_dapm_new_control);
1522 * snd_soc_dapm_new_controls - create new dapm controls
1523 * @codec: audio codec
1524 * @widget: widget array
1525 * @num: number of widgets
1527 * Creates new DAPM controls based upon the templates.
1529 * Returns 0 for success else error.
1531 int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
1532 const struct snd_soc_dapm_widget *widget,
1537 for (i = 0; i < num; i++) {
1538 ret = snd_soc_dapm_new_control(codec, widget);
1541 "ASoC: Failed to create DAPM control %s: %d\n",
1549 EXPORT_SYMBOL_GPL(snd_soc_dapm_new_controls);
1553 * snd_soc_dapm_stream_event - send a stream event to the dapm core
1554 * @codec: audio codec
1555 * @stream: stream name
1556 * @event: stream event
1558 * Sends a stream event to the dapm core. The core then makes any
1559 * necessary widget power changes.
1561 * Returns 0 for success else error.
1563 int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
1564 char *stream, int event)
1566 struct snd_soc_dapm_widget *w;
1571 mutex_lock(&codec->mutex);
1572 list_for_each_entry(w, &codec->dapm_widgets, list)
1576 pr_debug("widget %s\n %s stream %s event %d\n",
1577 w->name, w->sname, stream, event);
1578 if (strstr(w->sname, stream)) {
1580 case SND_SOC_DAPM_STREAM_START:
1583 case SND_SOC_DAPM_STREAM_STOP:
1586 case SND_SOC_DAPM_STREAM_SUSPEND:
1591 case SND_SOC_DAPM_STREAM_RESUME:
1597 case SND_SOC_DAPM_STREAM_PAUSE_PUSH:
1599 case SND_SOC_DAPM_STREAM_PAUSE_RELEASE:
1604 mutex_unlock(&codec->mutex);
1606 dapm_power_widgets(codec, event);
1607 dump_dapm(codec, __func__);
1610 EXPORT_SYMBOL_GPL(snd_soc_dapm_stream_event);
1613 * snd_soc_dapm_set_bias_level - set the bias level for the system
1614 * @socdev: audio device
1615 * @level: level to configure
1617 * Configure the bias (power) levels for the SoC audio device.
1619 * Returns 0 for success else error.
1621 int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev,
1622 enum snd_soc_bias_level level)
1624 struct snd_soc_codec *codec = socdev->codec;
1625 struct snd_soc_card *card = socdev->card;
1628 if (card->set_bias_level)
1629 ret = card->set_bias_level(card, level);
1630 if (ret == 0 && codec->set_bias_level)
1631 ret = codec->set_bias_level(codec, level);
1637 * snd_soc_dapm_enable_pin - enable pin.
1641 * Enables input/output pin and it's parents or children widgets iff there is
1642 * a valid audio route and active audio stream.
1643 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
1644 * do any widget power switching.
1646 int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin)
1648 return snd_soc_dapm_set_pin(codec, pin, 1);
1650 EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin);
1653 * snd_soc_dapm_disable_pin - disable pin.
1657 * Disables input/output pin and it's parents or children widgets.
1658 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
1659 * do any widget power switching.
1661 int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin)
1663 return snd_soc_dapm_set_pin(codec, pin, 0);
1665 EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin);
1668 * snd_soc_dapm_nc_pin - permanently disable pin.
1672 * Marks the specified pin as being not connected, disabling it along
1673 * any parent or child widgets. At present this is identical to
1674 * snd_soc_dapm_disable_pin() but in future it will be extended to do
1675 * additional things such as disabling controls which only affect
1676 * paths through the pin.
1678 * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
1679 * do any widget power switching.
1681 int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, char *pin)
1683 return snd_soc_dapm_set_pin(codec, pin, 0);
1685 EXPORT_SYMBOL_GPL(snd_soc_dapm_nc_pin);
1688 * snd_soc_dapm_get_pin_status - get audio pin status
1689 * @codec: audio codec
1690 * @pin: audio signal pin endpoint (or start point)
1692 * Get audio pin status - connected or disconnected.
1694 * Returns 1 for connected otherwise 0.
1696 int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin)
1698 struct snd_soc_dapm_widget *w;
1700 list_for_each_entry(w, &codec->dapm_widgets, list) {
1701 if (!strcmp(w->name, pin))
1702 return w->connected;
1707 EXPORT_SYMBOL_GPL(snd_soc_dapm_get_pin_status);
1710 * snd_soc_dapm_free - free dapm resources
1711 * @socdev: SoC device
1713 * Free all dapm widgets and resources.
1715 void snd_soc_dapm_free(struct snd_soc_device *socdev)
1717 struct snd_soc_codec *codec = socdev->codec;
1719 snd_soc_dapm_sys_remove(socdev->dev);
1720 dapm_free_widgets(codec);
1722 EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
1724 /* Module information */
1725 MODULE_AUTHOR("Liam Girdwood, lrg@slimlogic.co.uk");
1726 MODULE_DESCRIPTION("Dynamic Audio Power Management core for ALSA SoC");
1727 MODULE_LICENSE("GPL");