aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-01-04 05:50:10 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-05 12:47:17 -0500
commit05d5e991a7290807e7d62a7d272bb4f37c27c6ae (patch)
tree9582b65c14b39f28b1862db0afe6414d4531fbb7
parent7f185340da2594d65520b26f41e706a3ad0a368c (diff)
ASoC: Clocking fixes for davinci-evm.c
Let's have audio playback not sound like chipmunks, 'k? :) ASP1 on the DM355 EVM uses a 27 MHz external audio clock, not the slower clock used with ASP0 on the DM6446 EVM. Also, that slower ASP0 clock on the DM6446 is 12.288 MHz, not 22.5792 MHz ... 48 KHz sample rate (x256), not a double speed 44.1 KHz sample rate (which could be done, but isn't what the board init code now sets up). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/davinci/davinci-evm.c19
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