aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-07 08:37:44 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-08 08:52:05 -0400
commit4f1c1923851f9734c972812121e80a3b04ab3af4 (patch)
tree04fe3675139896b7aeda0b955956b7f3834a98d5 /sound/soc/soc-dapm.c
parent81628103dd8527d99ea39b054a3f002d5859d7c3 (diff)
ASoC: Coalesce power updates for PGAs
Handle gain ramping for PGAs so we can coalesce their power updates too. This is not ideal since we can't cope properly with gain ramping for stereo paths but that was the case without coalescing and gain ramping is relatively infrequently used so the effects are limited. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3fc791c28aa8..7299ce405b2d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -786,6 +786,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_codec *codec,
786 pr_err("%s: pre event failed: %d\n", 786 pr_err("%s: pre event failed: %d\n",
787 w->name, ret); 787 w->name, ret);
788 } 788 }
789
790 /* Lower PGA volume to reduce pops */
791 if (w->id == snd_soc_dapm_pga && !w->power)
792 dapm_set_pga(w, w->power);
789 } 793 }
790 794
791 if (reg >= 0) { 795 if (reg >= 0) {
@@ -797,6 +801,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_codec *codec,
797 } 801 }
798 802
799 list_for_each_entry(w, pending, power_list) { 803 list_for_each_entry(w, pending, power_list) {
804 /* Raise PGA volume to reduce pops */
805 if (w->id == snd_soc_dapm_pga && w->power)
806 dapm_set_pga(w, w->power);
807
800 /* power up post event */ 808 /* power up post event */
801 if (w->power && w->event && 809 if (w->power && w->event &&
802 (w->event_flags & SND_SOC_DAPM_POST_PMU)) { 810 (w->event_flags & SND_SOC_DAPM_POST_PMU)) {
@@ -886,8 +894,6 @@ static void dapm_seq_run(struct snd_soc_codec *codec, struct list_head *list,
886 case snd_soc_dapm_line: 894 case snd_soc_dapm_line:
887 case snd_soc_dapm_spk: 895 case snd_soc_dapm_spk:
888 /* No register support currently */ 896 /* No register support currently */
889 case snd_soc_dapm_pga:
890 /* Don't coalsece these yet due to gain ramping */
891 ret = dapm_generic_apply_power(w); 897 ret = dapm_generic_apply_power(w);
892 break; 898 break;
893 899