Skip to content

Commit

Permalink
ASoC: Ensure we only run Speyside WM8962 bias level callbacks once
Browse files Browse the repository at this point in the history
We get called once per DAPM context but only need to run once. When DAPM
was serialized this was a series of noops but now it can run in parallel
we need to take proper care.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Aug 22, 2011
1 parent 7691cd7 commit f79e7ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/samsung/speyside_wm8962.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ static int speyside_wm8962_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
int ret;

if (dapm->dev != codec_dai->dev)
return 0;

switch (level) {
case SND_SOC_BIAS_PREPARE:
if (dapm->bias_level == SND_SOC_BIAS_STANDBY) {
Expand Down Expand Up @@ -57,6 +60,9 @@ static int speyside_wm8962_set_bias_level_post(struct snd_soc_card *card,
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
int ret;

if (dapm->dev != codec_dai->dev)
return 0;

switch (level) {
case SND_SOC_BIAS_STANDBY:
ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK,
Expand Down

0 comments on commit f79e7ff

Please sign in to comment.