Skip to content

Commit

Permalink
ASoC: wm8994: Unsuspend the device while reading GPIO statuses
Browse files Browse the repository at this point in the history
Otherwise we might get an error if the GPIO is configured as an input
since that makes the register volatile and a suspended device can't be
read from.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 6, 2012
1 parent 5fab517 commit 27060b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -3539,6 +3539,9 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
wm8994->fll_locked_irq = false;
}

/* Make sure we can read from the GPIOs if they're inputs */
pm_runtime_get_sync(codec->dev);

/* Remember if AIFnLRCLK is configured as a GPIO. This should be
* configured on init - if a system wants to do this dynamically
* at runtime we can deal with that then.
Expand Down Expand Up @@ -3567,6 +3570,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
wm8994->lrclk_shared[1] = 0;
}

pm_runtime_put(codec->dev);

/* Latch volume updates (right only; we always do left then right). */
snd_soc_update_bits(codec, WM8994_AIF1_DAC1_LEFT_VOLUME,
WM8994_AIF1DAC1_VU, WM8994_AIF1DAC1_VU);
Expand Down

0 comments on commit 27060b3

Please sign in to comment.