diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-23 12:05:48 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-25 08:53:15 -0400 |
commit | f9372c9c06166dc24a17cf25d325d83a9a06a02d (patch) | |
tree | 26f9600b4134ae6c52b0431d6f54e673b665e4fc /sound/soc/samsung/speyside.c | |
parent | 1549c34bfdf3dc29b769c803f6cfdc53dfc67f93 (diff) |
ASoC: samsung: Add hookup of WM0010 on Speyside
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>
Diffstat (limited to 'sound/soc/samsung/speyside.c')
-rw-r--r-- | sound/soc/samsung/speyside.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index a4a9fc7e8c76..c7e1c28528a4 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c | |||
@@ -25,7 +25,7 @@ static int speyside_set_bias_level(struct snd_soc_card *card, | |||
25 | struct snd_soc_dapm_context *dapm, | 25 | struct snd_soc_dapm_context *dapm, |
26 | enum snd_soc_bias_level level) | 26 | enum snd_soc_bias_level level) |
27 | { | 27 | { |
28 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; | 28 | struct snd_soc_dai *codec_dai = card->rtd[1].codec_dai; |
29 | int ret; | 29 | int ret; |
30 | 30 | ||
31 | if (dapm->dev != codec_dai->dev) | 31 | if (dapm->dev != codec_dai->dev) |
@@ -57,7 +57,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card, | |||
57 | struct snd_soc_dapm_context *dapm, | 57 | struct snd_soc_dapm_context *dapm, |
58 | enum snd_soc_bias_level level) | 58 | enum snd_soc_bias_level level) |
59 | { | 59 | { |
60 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; | 60 | struct snd_soc_dai *codec_dai = card->rtd[1].codec_dai; |
61 | int ret; | 61 | int ret; |
62 | 62 | ||
63 | if (dapm->dev != codec_dai->dev) | 63 | if (dapm->dev != codec_dai->dev) |
@@ -126,6 +126,18 @@ static void speyside_set_polarity(struct snd_soc_codec *codec, | |||
126 | snd_soc_dapm_sync(&codec->dapm); | 126 | snd_soc_dapm_sync(&codec->dapm); |
127 | } | 127 | } |
128 | 128 | ||
129 | static int speyside_wm0010_init(struct snd_soc_pcm_runtime *rtd) | ||
130 | { | ||
131 | struct snd_soc_dai *dai = rtd->codec_dai; | ||
132 | int ret; | ||
133 | |||
134 | ret = snd_soc_dai_set_sysclk(dai, 0, MCLK_AUDIO_RATE, 0); | ||
135 | if (ret < 0) | ||
136 | return ret; | ||
137 | |||
138 | return 0; | ||
139 | } | ||
140 | |||
129 | static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd) | 141 | static int speyside_wm8996_init(struct snd_soc_pcm_runtime *rtd) |
130 | { | 142 | { |
131 | struct snd_soc_dai *dai = rtd->codec_dai; | 143 | struct snd_soc_dai *dai = rtd->codec_dai; |
@@ -172,17 +184,37 @@ static int speyside_late_probe(struct snd_soc_card *card) | |||
172 | return 0; | 184 | return 0; |
173 | } | 185 | } |
174 | 186 | ||
187 | static const struct snd_soc_pcm_stream dsp_codec_params = { | ||
188 | .formats = SNDRV_PCM_FMTBIT_S32_LE, | ||
189 | .rate_min = 48000, | ||
190 | .rate_max = 48000, | ||
191 | .channels_min = 2, | ||
192 | .channels_max = 2, | ||
193 | }; | ||
194 | |||
175 | static struct snd_soc_dai_link speyside_dai[] = { | 195 | static struct snd_soc_dai_link speyside_dai[] = { |
176 | { | 196 | { |
177 | .name = "CPU", | 197 | .name = "CPU-DSP", |
178 | .stream_name = "CPU", | 198 | .stream_name = "CPU-DSP", |
179 | .cpu_dai_name = "samsung-i2s.0", | 199 | .cpu_dai_name = "samsung-i2s.0", |
180 | .codec_dai_name = "wm8996-aif1", | 200 | .codec_dai_name = "wm0010-sdi1", |
181 | .platform_name = "samsung-audio", | 201 | .platform_name = "samsung-audio", |
202 | .codec_name = "spi0.0", | ||
203 | .init = speyside_wm0010_init, | ||
204 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ||
205 | | SND_SOC_DAIFMT_CBM_CFM, | ||
206 | }, | ||
207 | { | ||
208 | .name = "DSP-CODEC", | ||
209 | .stream_name = "DSP-CODEC", | ||
210 | .cpu_dai_name = "wm0010-sdi2", | ||
211 | .codec_dai_name = "wm8996-aif1", | ||
182 | .codec_name = "wm8996.1-001a", | 212 | .codec_name = "wm8996.1-001a", |
183 | .init = speyside_wm8996_init, | 213 | .init = speyside_wm8996_init, |
184 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | 214 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
185 | | SND_SOC_DAIFMT_CBM_CFM, | 215 | | SND_SOC_DAIFMT_CBM_CFM, |
216 | .params = &dsp_codec_params, | ||
217 | .ignore_suspend = 1, | ||
186 | }, | 218 | }, |
187 | { | 219 | { |
188 | .name = "Baseband", | 220 | .name = "Baseband", |