diff options
author | Shengjiu Wang <b02247@freescale.com> | 2014-03-31 10:01:46 +0800 |
---|---|---|
committer | Shengjiu Wang <b02247@freescale.com> | 2014-03-31 10:26:59 +0800 |
commit | 24c1d64737577fba4b4cc8d83170c9dfd6fd6dec (patch) | |
tree | a48b0b0dc6c69510e71edf08bc9a67d2623a7c30 | |
parent | 772bc74f5065ee679ab92739460f876a8b87987e (diff) |
ENGR00305534 asoc: audio block when switch between headphone and HDMI
Machine driver will swith sysclk to MCLK when hw_free(). When switch from
headphone -> HDMI -> headphone through hotplug headphone in Android, in
HDMI->headphone, the dapm will call POST_PMD -> PRE_PMU, then call hw_params().
So in sysclk_enent(), the FLL_ENA will not be set, because currently sysclk is
MCLK. then audio is blocked. because hw_params() set the sysclk to FLL, but FLL
is not enabled.
So update the sysclk_enent(), the FLL_ENA will be set always when audio enabled.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
-rw-r--r-- | sound/soc/codecs/wm8962.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 509c0fef5555..1409ecf2ef2a 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2343,39 +2343,21 @@ static int sysclk_event(struct snd_soc_dapm_widget *w, struct snd_soc_codec *codec = w->codec; struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec); unsigned long timeout; - int src; - int fll; - - src = snd_soc_read(codec, WM8962_CLOCKING2) & WM8962_SYSCLK_SRC_MASK; - - switch (src) { - case 0: /* MCLK */ - fll = 0; - break; - case 0x200: /* FLL */ - fll = 1; - break; - default: - dev_err(codec->dev, "Unknown SYSCLK source %x\n", src); - return -EINVAL; - } switch (event) { case SND_SOC_DAPM_PRE_PMU: - if (fll) { - try_wait_for_completion(&wm8962->fll_lock); + try_wait_for_completion(&wm8962->fll_lock); - snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, - WM8962_FLL_ENA, WM8962_FLL_ENA); + snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, + WM8962_FLL_ENA, WM8962_FLL_ENA); - timeout = msecs_to_jiffies(5); - timeout = wait_for_completion_timeout(&wm8962->fll_lock, - timeout); + timeout = msecs_to_jiffies(5); + timeout = wait_for_completion_timeout(&wm8962->fll_lock, + timeout); - if (wm8962->irq && timeout == 0) - dev_err(codec->dev, - "Timed out starting FLL\n"); - } + if (wm8962->irq && timeout == 0) + dev_err(codec->dev, + "Timed out starting FLL\n"); break; case SND_SOC_DAPM_POST_PMD: |