diff mbox series

ASoC: wm8904: fix automatic sysclk configuration

Message ID 20191122232532.22258-1-michael@walle.cc (mailing list archive)
State Accepted
Commit 2a0bda276c64212e517cc1d65cf65719a9ab1ef6
Headers show
Series ASoC: wm8904: fix automatic sysclk configuration | expand

Commit Message

Michael Walle Nov. 22, 2019, 11:25 p.m. UTC
The simple-card tries to signal the codec to disable rate constraints,
see commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk when
shutdown"). This wasn't handled by the codec, instead it would set the
FLL frequency to 0Hz which isn't working. Since we don't have any rate
constraints just ignore this request.

Fixes: 13409d27cb39 ("ASoC: wm8904: configure sysclk/FLL automatically")
Signed-off-by: Michael Walle <michael@walle.cc>
---
 sound/soc/codecs/wm8904.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Charles Keepax Nov. 26, 2019, 5:04 p.m. UTC | #1
On Sat, Nov 23, 2019 at 12:25:32AM +0100, Michael Walle wrote:
> The simple-card tries to signal the codec to disable rate constraints,
> see commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk when
> shutdown"). This wasn't handled by the codec, instead it would set the
> FLL frequency to 0Hz which isn't working. Since we don't have any rate
> constraints just ignore this request.
> 
> Fixes: 13409d27cb39 ("ASoC: wm8904: configure sysclk/FLL automatically")
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 7d7ea15d73e0..5ffbaddd6e49 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1806,6 +1806,12 @@  static int wm8904_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 	switch (clk_id) {
 	case WM8904_CLK_AUTO:
+		/* We don't have any rate constraints, so just ignore the
+		 * request to disable constraining.
+		 */
+		if (!freq)
+			return 0;
+
 		mclk_freq = clk_get_rate(priv->mclk);
 		/* enable FLL if a different sysclk is desired */
 		if (mclk_freq != freq) {