diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2019-12-02 11:01:51 +0100 |
---|---|---|
committer | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2021-01-27 20:36:32 +0200 |
commit | c957c63e26c7cf5112753d2b094d676431c1f9cc (patch) | |
tree | 62d9d5993945a0f330f810e49131ae94455dbfe6 /sound/soc/codecs | |
parent | 5e467a883d3b0614bdc197732d4e1f7721e1e852 (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>
(cherry picked from commit 333c14961b18abad74cf7bd0aeb2929e58cc308a)
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm8904.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 9e8c564f6e9c..b174a9381c0c 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1417,6 +1417,13 @@ static int wm8904_set_sysclk(struct snd_soc_dai *dai, int clk_id, struct snd_soc_component *component = dai->component; struct wm8904_priv *priv = snd_soc_component_get_drvdata(component); + /* + * 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; |