Commit f04cd9cb authored by Scott Jiang's avatar Scott Jiang Committed by Mark Brown

ASoC: Blackfin: add ad193x sysclk configuration

Signed-off-by: default avatarScott Jiang <scott.jiang@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 93547e89
...@@ -60,8 +60,16 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, ...@@ -60,8 +60,16 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai;
unsigned int clk = 0;
unsigned int channel_map[] = {0, 1, 2, 3, 4, 5, 6, 7}; unsigned int channel_map[] = {0, 1, 2, 3, 4, 5, 6, 7};
int ret = 0; int ret = 0;
switch (params_rate(params)) {
case 48000:
clk = 12288000;
break;
}
/* set cpu DAI configuration */ /* set cpu DAI configuration */
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM); SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
...@@ -74,6 +82,12 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, ...@@ -74,6 +82,12 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) if (ret < 0)
return ret; return ret;
/* set the codec system clock for DAC and ADC */
ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk,
SND_SOC_CLOCK_IN);
if (ret < 0)
return ret;
/* set codec DAI slots, 8 channels, all channels are enabled */ /* set codec DAI slots, 8 channels, all channels are enabled */
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 8, 32); ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 8, 32);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment