소스 검색

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>
Mark Brown 16 년 전
부모
커밋
4f1c192385
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      sound/soc/soc-dapm.c

+ 8 - 2
sound/soc/soc-dapm.c

@@ -786,6 +786,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_codec *codec,
 				pr_err("%s: pre event failed: %d\n",
 				pr_err("%s: pre event failed: %d\n",
 				       w->name, ret);
 				       w->name, ret);
 		}
 		}
+
+		/* Lower PGA volume to reduce pops */
+		if (w->id == snd_soc_dapm_pga && !w->power)
+			dapm_set_pga(w, w->power);
 	}
 	}
 
 
 	if (reg >= 0) {
 	if (reg >= 0) {
@@ -797,6 +801,10 @@ static void dapm_seq_run_coalesced(struct snd_soc_codec *codec,
 	}
 	}
 
 
 	list_for_each_entry(w, pending, power_list) {
 	list_for_each_entry(w, pending, power_list) {
+		/* Raise PGA volume to reduce pops */
+		if (w->id == snd_soc_dapm_pga && w->power)
+			dapm_set_pga(w, w->power);
+
 		/* power up post event */
 		/* power up post event */
 		if (w->power && w->event &&
 		if (w->power && w->event &&
 		    (w->event_flags & SND_SOC_DAPM_POST_PMU)) {
 		    (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,
 		case snd_soc_dapm_line:
 		case snd_soc_dapm_line:
 		case snd_soc_dapm_spk:
 		case snd_soc_dapm_spk:
 			/* No register support currently */
 			/* No register support currently */
-		case snd_soc_dapm_pga:
-			/* Don't coalsece these yet due to gain ramping */
 			ret = dapm_generic_apply_power(w);
 			ret = dapm_generic_apply_power(w);
 			break;
 			break;