Change-Id: Ia9eabcc482451c64897b6d9d09d484da77624cbb
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
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)) {
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;
}