Skip to content

Commit

Permalink
ASoC: samsung: Add hookup of WM0010 on Speyside
Browse files Browse the repository at this point in the history
The Speyside platform by default has a WM0010 fitted.  Now that we have
a public driver hook it up in the machine integration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Aug 25, 2012
1 parent 1549c34 commit f9372c9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
1 change: 1 addition & 0 deletions sound/soc/samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ config SND_SOC_SPEYSIDE
select SND_SAMSUNG_I2S
select SND_SOC_WM8996
select SND_SOC_WM9081
select SND_SOC_WM0010
select SND_SOC_WM1250_EV1

config SND_SOC_TOBERMORY
Expand Down
42 changes: 37 additions & 5 deletions sound/soc/samsung/speyside.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static int speyside_set_bias_level(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level)
{
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
struct snd_soc_dai *codec_dai = card->rtd[1].codec_dai;
int ret;

if (dapm->dev != codec_dai->dev)
Expand Down Expand Up @@ -57,7 +57,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level)
{
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
struct snd_soc_dai *codec_dai = card->rtd[1].codec_dai;
int ret;

if (dapm->dev != codec_dai->dev)
Expand Down Expand Up @@ -126,6 +126,18 @@ static void speyside_set_polarity(struct snd_soc_codec *codec,
snd_soc_dapm_sync(&codec->dapm);
}

static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *dai = rtd->codec_dai;
int ret;

ret = snd_soc_dai_set_sysclk(dai, 0, MCLK_AUDIO_RATE, 0);
if (ret < 0)
return ret;

return 0;
}

static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *dai = rtd->codec_dai;
Expand Down Expand Up @@ -172,17 +184,37 @@ static int speyside_late_probe(struct snd_soc_card *card)
return 0;
}

static const struct snd_soc_pcm_stream dsp_codec_params = {
.formats = SNDRV_PCM_FMTBIT_S32_LE,
.rate_min = 48000,
.rate_max = 48000,
.channels_min = 2,
.channels_max = 2,
};

static struct snd_soc_dai_link speyside_dai[] = {
{
.name = "CPU",
.stream_name = "CPU",
.name = "CPU-DSP",
.stream_name = "CPU-DSP",
.cpu_dai_name = "samsung-i2s.0",
.codec_dai_name = "wm8996-aif1",
.codec_dai_name = "wm0010-sdi1",
.platform_name = "samsung-audio",
.codec_name = "spi0.0",
.init = speyside_wm0010_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
},
{
.name = "DSP-CODEC",
.stream_name = "DSP-CODEC",
.cpu_dai_name = "wm0010-sdi2",
.codec_dai_name = "wm8996-aif1",
.codec_name = "wm8996.1-001a",
.init = speyside_wm8996_init,
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
.params = &dsp_codec_params,
.ignore_suspend = 1,
},
{
.name = "Baseband",
Expand Down

0 comments on commit f9372c9

Please sign in to comment.