From: Sugar Zhang Date: Tue, 27 Jun 2017 01:38:46 +0000 (+0800) Subject: ASoC: rockchip: hdmi_analog: set sysclk for codec dai X-Git-Tag: release-20171130_firefly~4^2~304 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=50c2e3af27dbd6c77d448e464acdae9e9668503d;p=firefly-linux-kernel-4.4.55.git ASoC: rockchip: hdmi_analog: set sysclk for codec dai Change-Id: Ia9eabcc482451c64897b6d9d09d484da77624cbb Signed-off-by: Sugar Zhang --- 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; }