diff options
author | Hui Wang <hui.wang@canonical.com> | 2022-05-30 12:01:51 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-06-06 12:33:04 +0100 |
commit | fed3d9297a9bf8b342c034e74a1fdba6940fe84a (patch) | |
tree | d63847de5d675519d75a6175880c5e3d429f96ff /sound/soc/codecs/nau8822.c | |
parent | be1a63daffdd152ba4c7b71ab9fec2e39259b42b (diff) |
ASoC: nau8822: Disable internal PLL if freq_out is zero
After finishing the playback or recording, the machine driver might
call snd_soc_dai_set_pll(codec, pll_id, 0, 0, 0) to stop the internal
PLL, but with the codec driver nau8822, it will print error as below:
nau8822 0-001a: Unsupported input clock 0
fsl-asoc-card sound-nau8822: failed to stop FLL: -22
Refer to the function wm8962_set_fll() in the codec driver wm8962, if
the freq_out is zero, turn off the internal PLL and return 0.
Cc: David Lin <ctlin0@nuvoton.com>
Cc: John Hsu <kchsu0@nuvoton.com>
Cc: Seven Li <wtli@nuvoton.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20220530040151.95221-3-hui.wang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/nau8822.c')
-rw-r--r-- | sound/soc/codecs/nau8822.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index 08f6c56dc387..fd9c766e277f 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -726,6 +726,13 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source, struct nau8822_pll *pll_param = &nau8822->pll; int ret, fs; + if (freq_out == 0) { + dev_dbg(component->dev, "PLL disabled\n"); + snd_soc_component_update_bits(component, + NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_OFF); + return 0; + } + fs = freq_out / 256; ret = nau8822_calc_pll(freq_in, fs, pll_param); |