diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-05 12:55:20 +0100 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-04-30 11:03:58 +0200 |
commit | 3e0f0b2a926774ed4e65f1396f76d656bd2672fc (patch) | |
tree | 704b8a904ee43ac69160cda898c7f4fee3064a51 /sound | |
parent | 5a6ff123e2a340d33079b9f7920859b155615527 (diff) | |
download | kernel_samsung_espresso10-3e0f0b2a926774ed4e65f1396f76d656bd2672fc.zip kernel_samsung_espresso10-3e0f0b2a926774ed4e65f1396f76d656bd2672fc.tar.gz kernel_samsung_espresso10-3e0f0b2a926774ed4e65f1396f76d656bd2672fc.tar.bz2 |
ASoC: wm8994: Implement FLL bypass support
Later WM8994 class devices can bypass the FLL from BCLK. Do this
automatically when the FLL input and output frequencies match up.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 19 | ||||
-rw-r--r-- | sound/soc/codecs/wm8994.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 1de5dbd..c8c714a 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2283,6 +2283,14 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset, WM8994_FLL1_ENA, 0); + if (wm8994->fll_byp && src == WM8994_FLL_SRC_BCLK && + freq_in == freq_out) { + dev_dbg(codec->dev, "Bypassing FLL%d\n", id + 1); + snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_5 + reg_offset, + WM8958_FLL1_BYP, WM8958_FLL1_BYP); + goto out; + } + reg = (fll.outdiv << WM8994_FLL1_OUTDIV_SHIFT) | (fll.fll_fratio << WM8994_FLL1_FRATIO_SHIFT); snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_2 + reg_offset, @@ -2297,6 +2305,7 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, fll.n << WM8994_FLL1_N_SHIFT); snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_5 + reg_offset, + WM8958_FLL1_BYP | WM8994_FLL1_REFCLK_DIV_MASK | WM8994_FLL1_REFCLK_SRC_MASK, (fll.clk_ref_div << WM8994_FLL1_REFCLK_DIV_SHIFT) | @@ -2359,6 +2368,7 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, } } +out: wm8994->fll[id].in = freq_in; wm8994->fll[id].out = freq_out; wm8994->fll[id].src = src; @@ -3905,6 +3915,14 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) case WM8958: wm8994->hubs.dcs_readback_mode = 1; wm8994->hubs.hp_startup_mode = 1; + + switch (wm8994->revision) { + case 0: + break; + default: + wm8994->fll_byp = true; + break; + } break; case WM1811: @@ -3912,6 +3930,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) wm8994->hubs.no_series_update = 1; wm8994->hubs.hp_startup_mode = 1; wm8994->hubs.no_cache_class_w = true; + wm8994->fll_byp = true; switch (wm8994->revision) { case 0: diff --git a/sound/soc/codecs/wm8994.h b/sound/soc/codecs/wm8994.h index 20a6073..a962b72 100644 --- a/sound/soc/codecs/wm8994.h +++ b/sound/soc/codecs/wm8994.h @@ -89,6 +89,7 @@ struct wm8994_priv { struct wm8994_fll_config fll[2], fll_suspend[2]; struct completion fll_locked[2]; bool fll_locked_irq; + bool fll_byp; int vmid_refcount; int active_refcount; |