ASoC: AMD: Enable clk in startup intead of hw_params
authorYu-Hsuan Hsu <yuhsuan@chromium.org>
Tue, 26 Nov 2019 07:54:24 +0000 (15:54 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 27 Nov 2019 12:50:08 +0000 (12:50 +0000)
commit756ae8f237e19a014a1c20ad5a51b0686463d1f7
treeb389febafc3c72768fd76ae62e1468030738d67e
parentbc094709de0192a756c6946a7c89c543243ae609
ASoC: AMD: Enable clk in startup intead of hw_params

Some usages only call startup and shutdown without setting hw_params
(e.g. arecord --dump-hw-params). If we don't enable clk in startup, it
will cause ref count error because the clk will be disabled in shutdown.
For this reason, we should move enabling clk from hw_params to startup.

In addition, the hw_params is fixed in this driver(48000 rate, 2
channels, S16_LE format) so we don't need to change the clk rate after
the hw_params is set.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Acked-by: Akshu Agrawal <akshu.agarawal@amd.com>
Link: https://lore.kernel.org/r/20191126075424.80668-1-yuhsuan@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp-da7219-max98357a.c