]> err.no Git - linux-2.6/blobdiff - sound/soc/soc-dapm.c
Merge branch 'linus' into sched/clock
[linux-2.6] / sound / soc / soc-dapm.c
index 17698ef58dfb5ab707c4cca31158ea8fac4d87f8..f9d100bc8479e970225c6f1274c824f3ee12dfee 100644 (file)
@@ -470,6 +470,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(dapm_reg_event);
 
 /*
  * Scan each dapm widget for complete audio path.
@@ -523,24 +524,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)
@@ -611,8 +594,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)) {