diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-11-05 14:35:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-06 11:28:35 -0400 |
commit | 3a45b8672d3f8542e430e7a5c7366ec9bdded054 (patch) | |
tree | e15feaaddb1f81727c0e9c0af3a9b5d642b96684 /sound/soc/soc-dapm.c | |
parent | d6ce4cf3967dca78f967cd0bf70b175084885f40 (diff) |
ASoC: Move pop time from DAPM context to sound card
Based on discussion the dapm_pop_time in debugsfs should be per card rather
than per device. Single pop time value for entire card is cleaner when the
DAPM sequencing is extended to cross-device paths.
debugfs/asoc/{card->name}/{codec dir}/dapm_pop_time
->
debugfs/asoc/{card->name}/dapm_pop_time
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b8f653eaffaa..960790cc6fbc 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -293,6 +293,7 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget) | |||
293 | unsigned int old, new; | 293 | unsigned int old, new; |
294 | struct snd_soc_codec *codec = widget->codec; | 294 | struct snd_soc_codec *codec = widget->codec; |
295 | struct snd_soc_dapm_context *dapm = widget->dapm; | 295 | struct snd_soc_dapm_context *dapm = widget->dapm; |
296 | struct snd_soc_card *card = dapm->card; | ||
296 | 297 | ||
297 | /* check for valid widgets */ | 298 | /* check for valid widgets */ |
298 | if (widget->reg < 0 || widget->id == snd_soc_dapm_input || | 299 | if (widget->reg < 0 || widget->id == snd_soc_dapm_input || |
@@ -312,10 +313,10 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget) | |||
312 | 313 | ||
313 | change = old != new; | 314 | change = old != new; |
314 | if (change) { | 315 | if (change) { |
315 | pop_dbg(dapm->pop_time, "pop test %s : %s in %d ms\n", | 316 | pop_dbg(card->pop_time, "pop test %s : %s in %d ms\n", |
316 | widget->name, widget->power ? "on" : "off", | 317 | widget->name, widget->power ? "on" : "off", |
317 | dapm->pop_time); | 318 | card->pop_time); |
318 | pop_wait(dapm->pop_time); | 319 | pop_wait(card->pop_time); |
319 | snd_soc_write(codec, widget->reg, new); | 320 | snd_soc_write(codec, widget->reg, new); |
320 | } | 321 | } |
321 | pr_debug("reg %x old %x new %x change %d\n", widget->reg, | 322 | pr_debug("reg %x old %x new %x change %d\n", widget->reg, |
@@ -720,6 +721,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
720 | struct list_head *pending) | 721 | struct list_head *pending) |
721 | { | 722 | { |
722 | struct snd_soc_dapm_widget *w; | 723 | struct snd_soc_dapm_widget *w; |
724 | struct snd_soc_card *card = dapm->card; | ||
723 | int reg, power, ret; | 725 | int reg, power, ret; |
724 | unsigned int value = 0; | 726 | unsigned int value = 0; |
725 | unsigned int mask = 0; | 727 | unsigned int mask = 0; |
@@ -741,14 +743,14 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
741 | if (power) | 743 | if (power) |
742 | value |= cur_mask; | 744 | value |= cur_mask; |
743 | 745 | ||
744 | pop_dbg(dapm->pop_time, | 746 | pop_dbg(card->pop_time, |
745 | "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n", | 747 | "pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n", |
746 | w->name, reg, value, mask); | 748 | w->name, reg, value, mask); |
747 | 749 | ||
748 | /* power up pre event */ | 750 | /* power up pre event */ |
749 | if (w->power && w->event && | 751 | if (w->power && w->event && |
750 | (w->event_flags & SND_SOC_DAPM_PRE_PMU)) { | 752 | (w->event_flags & SND_SOC_DAPM_PRE_PMU)) { |
751 | pop_dbg(dapm->pop_time, "pop test : %s PRE_PMU\n", | 753 | pop_dbg(card->pop_time, "pop test : %s PRE_PMU\n", |
752 | w->name); | 754 | w->name); |
753 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU); | 755 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU); |
754 | if (ret < 0) | 756 | if (ret < 0) |
@@ -759,7 +761,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
759 | /* power down pre event */ | 761 | /* power down pre event */ |
760 | if (!w->power && w->event && | 762 | if (!w->power && w->event && |
761 | (w->event_flags & SND_SOC_DAPM_PRE_PMD)) { | 763 | (w->event_flags & SND_SOC_DAPM_PRE_PMD)) { |
762 | pop_dbg(dapm->pop_time, "pop test : %s PRE_PMD\n", | 764 | pop_dbg(card->pop_time, "pop test : %s PRE_PMD\n", |
763 | w->name); | 765 | w->name); |
764 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD); | 766 | ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD); |
765 | if (ret < 0) | 767 | if (ret < 0) |
@@ -769,10 +771,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
769 | } | 771 | } |
770 | 772 | ||
771 | if (reg >= 0) { | 773 | if (reg >= 0) { |
772 | pop_dbg(dapm->pop_time, | 774 | pop_dbg(card->pop_time, |
773 | "pop test : Applying 0x%x/0x%x to %x in %dms\n", | 775 | "pop test : Applying 0x%x/0x%x to %x in %dms\n", |
774 | value, mask, reg, dapm->pop_time); | 776 | value, mask, reg, card->pop_time); |
775 | pop_wait(dapm->pop_time); | 777 | pop_wait(card->pop_time); |
776 | snd_soc_update_bits(dapm->codec, reg, mask, value); | 778 | snd_soc_update_bits(dapm->codec, reg, mask, value); |
777 | } | 779 | } |
778 | 780 | ||
@@ -780,7 +782,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
780 | /* power up post event */ | 782 | /* power up post event */ |
781 | if (w->power && w->event && | 783 | if (w->power && w->event && |
782 | (w->event_flags & SND_SOC_DAPM_POST_PMU)) { | 784 | (w->event_flags & SND_SOC_DAPM_POST_PMU)) { |
783 | pop_dbg(dapm->pop_time, "pop test : %s POST_PMU\n", | 785 | pop_dbg(card->pop_time, "pop test : %s POST_PMU\n", |
784 | w->name); | 786 | w->name); |
785 | ret = w->event(w, | 787 | ret = w->event(w, |
786 | NULL, SND_SOC_DAPM_POST_PMU); | 788 | NULL, SND_SOC_DAPM_POST_PMU); |
@@ -792,7 +794,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, | |||
792 | /* power down post event */ | 794 | /* power down post event */ |
793 | if (!w->power && w->event && | 795 | if (!w->power && w->event && |
794 | (w->event_flags & SND_SOC_DAPM_POST_PMD)) { | 796 | (w->event_flags & SND_SOC_DAPM_POST_PMD)) { |
795 | pop_dbg(dapm->pop_time, "pop test : %s POST_PMD\n", | 797 | pop_dbg(card->pop_time, "pop test : %s POST_PMD\n", |
796 | w->name); | 798 | w->name); |
797 | ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD); | 799 | ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD); |
798 | if (ret < 0) | 800 | if (ret < 0) |
@@ -1012,9 +1014,9 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
1012 | pr_err("Failed to apply active bias: %d\n", ret); | 1014 | pr_err("Failed to apply active bias: %d\n", ret); |
1013 | } | 1015 | } |
1014 | 1016 | ||
1015 | pop_dbg(dapm->pop_time, "DAPM sequencing finished, waiting %dms\n", | 1017 | pop_dbg(card->pop_time, "DAPM sequencing finished, waiting %dms\n", |
1016 | dapm->pop_time); | 1018 | card->pop_time); |
1017 | pop_wait(dapm->pop_time); | 1019 | pop_wait(card->pop_time); |
1018 | 1020 | ||
1019 | return 0; | 1021 | return 0; |
1020 | } | 1022 | } |