summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2019-12-02 11:01:51 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2019-12-03 15:52:52 +0100
commit308bfca3a341b147db694d12d759b3f106e1cf51 (patch)
tree92022046a5cd67dfdf097bc5438f78e8e8f19c10 /sound
parenta746ee0e69f7032cd0a651c38ad34a0e38aeab1a (diff)
ASoC: wm8904: assume mclk as the clk_id for simple-audio-card
The simple-audio-card driver sets clk_id to a constant 0. Assume that we want to derive the sysclk from the MCLK in that case rather than error out with -EINVAL. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8904.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 4fd350e8420d..2782b8064542 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1408,6 +1408,13 @@ static int wm8904_set_sysclk(struct snd_soc_dai *dai, int clk_id,
struct snd_soc_codec *codec = dai->codec;
struct wm8904_priv *priv = snd_soc_codec_get_drvdata(codec);
+ /*
+ * If using sound-simple-card this is called with clk_id fixed to 0.
+ * Assume we want WM8904_CLK_MCLK for now in that case.
+ */
+ if (clk_id == 0)
+ clk_id = WM8904_CLK_MCLK;
+
switch (clk_id) {
case WM8904_CLK_MCLK:
priv->sysclk_src = clk_id;