From 50c2e3af27dbd6c77d448e464acdae9e9668503d Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 27 Jun 2017 09:38:46 +0800 Subject: [PATCH] ASoC: rockchip: hdmi_analog: set sysclk for codec dai Change-Id: Ia9eabcc482451c64897b6d9d09d484da77624cbb Signed-off-by: Sugar Zhang --- sound/soc/rockchip/rockchip_hdmi_analog.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/rockchip/rockchip_hdmi_analog.c b/sound/soc/rockchip/rockchip_hdmi_analog.c index e4a4a993e29a..3642cec00a04 100644 --- a/sound/soc/rockchip/rockchip_hdmi_analog.c +++ b/sound/soc/rockchip/rockchip_hdmi_analog.c @@ -40,6 +40,7 @@ static int rk_hdmi_analog_hw_params(struct snd_pcm_substream *substream, int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_dai *codec_dai = rtd->codec_dai; int mclk; switch (params_rate(params)) { @@ -76,6 +77,13 @@ static int rk_hdmi_analog_hw_params(struct snd_pcm_substream *substream, return ret; } + ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk, + SND_SOC_CLOCK_IN); + if (ret && ret != -ENOTSUPP) { + dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret); + return ret; + } + return 0; } -- 2.34.1