Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126780
b: refs/heads/master
c: 05d5e99
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Mark Brown committed Jan 5, 2009
1 parent 7b85b03 commit 7841a2a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f185340da2594d65520b26f41e706a3ad0a368c
refs/heads/master: 05d5e991a7290807e7d62a7d272bb4f37c27c6ae
19 changes: 16 additions & 3 deletions trunk/sound/soc/davinci/davinci-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "davinci-pcm.h"
#include "davinci-i2s.h"

#define EVM_CODEC_CLOCK 22579200

#define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \
SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF)
Expand All @@ -37,6 +36,21 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
int ret = 0;
unsigned sysclk;

/* ASP1 on DM355 EVM is clocked by an external oscillator */
if (machine_is_davinci_dm355_evm())
sysclk = 27000000;

/* ASP0 in DM6446 EVM is clocked by U55, as configured by
* board-dm644x-evm.c using GPIOs from U18. There are six
* options; here we "know" we use a 48 KHz sample rate.
*/
else if (machine_is_davinci_evm())
sysclk = 12288000;

else
return -EINVAL;

/* set codec DAI configuration */
ret = snd_soc_dai_set_fmt(codec_dai, AUDIO_FORMAT);
Expand All @@ -49,8 +63,7 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
return ret;

/* set the codec system clock */
ret = snd_soc_dai_set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK,
SND_SOC_CLOCK_OUT);
ret = snd_soc_dai_set_sysclk(codec_dai, 0, sysclk, SND_SOC_CLOCK_OUT);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 7841a2a

Please sign in to comment.