Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305656
b: refs/heads/master
c: d9ca8e7
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Apr 25, 2012
1 parent 207e643 commit 68c5753
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 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: e05854ddaa012f3369884acf61ec9953285404b4
refs/heads/master: d9ca8e76f3cdbd86032808aa1af237b8a3d99eac
37 changes: 4 additions & 33 deletions trunk/sound/soc/blackfin/bf5xx-ssm2602.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,19 @@

static struct snd_soc_card bf5xx_ssm2602;

static int bf5xx_ssm2602_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
static int bf5xx_ssm2602_dai_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *codec_dai = rtd->codec_dai;
unsigned int clk = 0;
int ret = 0;

pr_debug("%s rate %d format %x\n", __func__, params_rate(params),
params_format(params));
/*
* If you are using a crystal source which frequency is not 12MHz
* then modify the below case statement with frequency of the crystal.
*
* If you are using the SPORT to generate clocking then this is
* where to do it.
*/

switch (params_rate(params)) {
case 8000:
case 16000:
case 48000:
case 96000:
case 11025:
case 22050:
case 44100:
clk = 12000000;
break;
}

ret = snd_soc_dai_set_sysclk(codec_dai, SSM2602_SYSCLK, clk,
return snd_soc_dai_set_sysclk(rtd->codec_dai, SSM2602_SYSCLK, 12000000,
SND_SOC_CLOCK_IN);
if (ret < 0)
return ret;

return 0;
}

static struct snd_soc_ops bf5xx_ssm2602_ops = {
.hw_params = bf5xx_ssm2602_hw_params,
};

/* CODEC is master for BCLK and LRC in this configuration. */
#define BF5XX_SSM2602_DAIFMT (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \
SND_SOC_DAIFMT_CBM_CFM)
Expand All @@ -98,7 +69,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
.codec_dai_name = "ssm2602-hifi",
.platform_name = "bfin-i2s-pcm-audio",
.codec_name = "ssm2602.0-001b",
.ops = &bf5xx_ssm2602_ops,
.init = bf5xx_ssm2602_dai_init,
},
{
.name = "ssm2602",
Expand All @@ -107,7 +78,7 @@ static struct snd_soc_dai_link bf5xx_ssm2602_dai[] = {
.codec_dai_name = "ssm2602-hifi",
.platform_name = "bfin-i2s-pcm-audio",
.codec_name = "ssm2602.0-001b",
.ops = &bf5xx_ssm2602_ops,
.init = bf5xx_ssm2602_dai_init,
},
};

Expand Down

0 comments on commit 68c5753

Please sign in to comment.