diff options
Diffstat (limited to 'sound/soc/davinci/davinci-evm.c')
-rw-r--r-- | sound/soc/davinci/davinci-evm.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 01b948bb55a1..54851f318568 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "davinci-pcm.h" | 26 | #include "davinci-pcm.h" |
27 | #include "davinci-i2s.h" | 27 | #include "davinci-i2s.h" |
28 | 28 | ||
29 | #define EVM_CODEC_CLOCK 22579200 | ||
30 | 29 | ||
31 | #define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ | 30 | #define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ |
32 | SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF) | 31 | SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF) |
@@ -37,6 +36,21 @@ static int evm_hw_params(struct snd_pcm_substream *substream, | |||
37 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 36 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; |
38 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 37 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; |
39 | int ret = 0; | 38 | int ret = 0; |
39 | unsigned sysclk; | ||
40 | |||
41 | /* ASP1 on DM355 EVM is clocked by an external oscillator */ | ||
42 | if (machine_is_davinci_dm355_evm()) | ||
43 | sysclk = 27000000; | ||
44 | |||
45 | /* ASP0 in DM6446 EVM is clocked by U55, as configured by | ||
46 | * board-dm644x-evm.c using GPIOs from U18. There are six | ||
47 | * options; here we "know" we use a 48 KHz sample rate. | ||
48 | */ | ||
49 | else if (machine_is_davinci_evm()) | ||
50 | sysclk = 12288000; | ||
51 | |||
52 | else | ||
53 | return -EINVAL; | ||
40 | 54 | ||
41 | /* set codec DAI configuration */ | 55 | /* set codec DAI configuration */ |
42 | ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT); | 56 | ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT); |
@@ -49,8 +63,7 @@ static int evm_hw_params(struct snd_pcm_substream *substream, | |||
49 | return ret; | 63 | return ret; |
50 | 64 | ||
51 | /* set the codec system clock */ | 65 | /* set the codec system clock */ |
52 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK, | 66 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT); |
53 | SND_SOC_CLOCK_OUT); | ||
54 | if (ret < 0) | 67 | if (ret < 0) |
55 | return ret; | 68 | return ret; |
56 | 69 | ||