Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106476
b: refs/heads/master
c: 9dd8d81
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Takashi Iwai committed Jul 17, 2008
1 parent fe793b8 commit bb35a41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2927d6eeca0a5004d81fa5bedbdf3f2b1b842903
refs/heads/master: 9dd8d812d3b4d208a769ca3cf23a7f9294632d0d
26 changes: 8 additions & 18 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,24 +523,6 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
continue;
}

/* programmable gain/attenuation */
if (w->id == snd_soc_dapm_pga) {
int on;
in = is_connected_input_ep(w);
dapm_clear_walk(w->codec);
out = is_connected_output_ep(w);
dapm_clear_walk(w->codec);
w->power = on = (out != 0 && in != 0) ? 1 : 0;

if (!on)
dapm_set_pga(w, on); /* lower volume to reduce pops */
dapm_update_bits(w);
if (on)
dapm_set_pga(w, on); /* restore volume from zero */

continue;
}

/* pre and post event widgets */
if (w->id == snd_soc_dapm_pre) {
if (!w->event)
Expand Down Expand Up @@ -611,8 +593,16 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
return ret;
}

/* Lower PGA volume to reduce pops */
if (w->id == snd_soc_dapm_pga && !power)
dapm_set_pga(w, power);

dapm_update_bits(w);

/* Raise PGA volume to reduce pops */
if (w->id == snd_soc_dapm_pga && power)
dapm_set_pga(w, power);

/* power up post event */
if (power && w->event &&
(w->event_flags & SND_SOC_DAPM_POST_PMU)) {
Expand Down

0 comments on commit bb35a41

Please sign in to comment.