diff options
author | Scott Jiang <scott.jiang@analog.com> | 2011-03-27 05:33:04 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-03-29 18:17:39 -0400 |
commit | f04cd9cb11469a6a9cbfdad824254143250d78d2 (patch) | |
tree | 3e4c4faa6498a46c7fbab48625f09211bf23d74b /sound/soc/blackfin | |
parent | 93547e89b6d2adeec627d2a8d8fc4d4b40b0e2c4 (diff) |
ASoC: Blackfin: add ad193x sysclk configuration
Signed-off-by: Scott Jiang <scott.jiang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ad193x.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad193x.c b/sound/soc/blackfin/bf5xx-ad193x.c index d3ccb926b5e4..33678828d57e 100644 --- a/sound/soc/blackfin/bf5xx-ad193x.c +++ b/sound/soc/blackfin/bf5xx-ad193x.c | |||
@@ -60,8 +60,16 @@ static int bf5xx_ad193x_hw_params(struct snd_pcm_substream *substream, | |||
60 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 60 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
61 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 61 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
62 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | 62 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
63 | unsigned int clk = 0; | ||
63 | unsigned int channel_map[] = {0, 1, 2, 3, 4, 5, 6, 7}; | 64 | unsigned int channel_map[] = {0, 1, 2, 3, 4, 5, 6, 7}; |
64 | int ret = 0; | 65 | int ret = 0; |
66 | |||
67 | switch (params_rate(params)) { | ||
68 | case 48000: | ||
69 | clk = 12288000; | ||
70 | break; | ||
71 | } | ||
72 | |||
65 | /* set cpu DAI configuration */ | 73 | /* set cpu DAI configuration */ |
66 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A | | 74 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A | |
67 | SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM); | 75 | 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 | if (ret < 0) | 82 | if (ret < 0) |
75 | return ret; | 83 | return ret; |
76 | 84 | ||
85 | /* set the codec system clock for DAC and ADC */ | ||
86 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk, | ||
87 | SND_SOC_CLOCK_IN); | ||
88 | if (ret < 0) | ||
89 | return ret; | ||
90 | |||
77 | /* set codec DAI slots, 8 channels, all channels are enabled */ | 91 | /* set codec DAI slots, 8 channels, all channels are enabled */ |
78 | ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 8, 32); | 92 | ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 8, 32); |
79 | if (ret < 0) | 93 | if (ret < 0) |