ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widget
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 8 Oct 2011 12:36:03 +0000 (13:36 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Oct 2011 09:28:26 +0000 (10:28 +0100)
We really should be doing this in the core, not in a driver...

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
include/sound/soc-dapm.h
sound/soc/codecs/tlv320aic3x.c
sound/soc/soc-dapm.c

index bfefc16137ea37e7a9aa2981a1dfb35e2d40ce91..17a4c17f19f5ff672030d448bb84ea5b3d8a354a 100644 (file)
@@ -381,6 +381,9 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
                                const char *pin);
 
+/* Mostly internal - should not normally be used */
+void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason);
+
 /* dapm widget types */
 enum snd_soc_dapm_type {
        snd_soc_dapm_input = 0,         /* input pin */
index d877b39b50009ab4ed60f610085aa61f07f54b6c..be55b7f362827fc29815e2def8b3198dd2549573 100644 (file)
@@ -197,6 +197,10 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
                        else
                                /* old connection must be powered down */
                                path->connect = invert ? 1 : 0;
+
+                       dapm_mark_dirty(path->source, "tlv320aic3x source");
+                       dapm_mark_dirty(path->sink, "tlv320aic3x sink");
+
                        break;
                }
 
index 258326b031cfa115304cab000b3a5ff7eb852d91..f42e8b9fb17db7baeabaf7152f81123773cdecd0 100644 (file)
@@ -124,7 +124,7 @@ static bool dapm_dirty_widget(struct snd_soc_dapm_widget *w)
        return !list_empty(&w->dirty);
 }
 
-static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
+void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
 {
        if (!dapm_dirty_widget(w)) {
                dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n",
@@ -132,6 +132,7 @@ static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
                list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty);
        }
 }
+EXPORT_SYMBOL_GPL(dapm_mark_dirty);
 
 /* create a new dapm widget */
 static inline struct snd_soc_dapm_widget *dapm_cnew_widget(