Skip to content

Commit

Permalink
ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widget
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Oct 10, 2011
1 parent 3ebb5c9 commit 25c77c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/sound/soc-dapm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,15 @@ 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",
w->name, 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(
Expand Down

0 comments on commit 25c77c5

Please sign in to comment.