diff options
Diffstat (limited to 'sound/soc/davinci/davinci-evm.c')
-rw-r--r-- | sound/soc/davinci/davinci-evm.c | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 7ccbe6684fc2..97f74d6a33e6 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -28,10 +28,12 @@ | |||
28 | #include <mach/mux.h> | 28 | #include <mach/mux.h> |
29 | 29 | ||
30 | #include "../codecs/tlv320aic3x.h" | 30 | #include "../codecs/tlv320aic3x.h" |
31 | #include "../codecs/cq93vc.h" | ||
31 | #include "../codecs/spdif_transciever.h" | 32 | #include "../codecs/spdif_transciever.h" |
32 | #include "davinci-pcm.h" | 33 | #include "davinci-pcm.h" |
33 | #include "davinci-i2s.h" | 34 | #include "davinci-i2s.h" |
34 | #include "davinci-mcasp.h" | 35 | #include "davinci-mcasp.h" |
36 | #include "davinci-vcif.h" | ||
35 | 37 | ||
36 | #define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ | 38 | #define AUDIO_FORMAT (SND_SOC_DAIFMT_DSP_B | \ |
37 | SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF) | 39 | SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF) |
@@ -81,10 +83,24 @@ static int evm_hw_params(struct snd_pcm_substream *substream, | |||
81 | return 0; | 83 | return 0; |
82 | } | 84 | } |
83 | 85 | ||
86 | static int evm_spdif_hw_params(struct snd_pcm_substream *substream, | ||
87 | struct snd_pcm_hw_params *params) | ||
88 | { | ||
89 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
90 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | ||
91 | |||
92 | /* set cpu DAI configuration */ | ||
93 | return snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT); | ||
94 | } | ||
95 | |||
84 | static struct snd_soc_ops evm_ops = { | 96 | static struct snd_soc_ops evm_ops = { |
85 | .hw_params = evm_hw_params, | 97 | .hw_params = evm_hw_params, |
86 | }; | 98 | }; |
87 | 99 | ||
100 | static struct snd_soc_ops evm_spdif_ops = { | ||
101 | .hw_params = evm_spdif_hw_params, | ||
102 | }; | ||
103 | |||
88 | /* davinci-evm machine dapm widgets */ | 104 | /* davinci-evm machine dapm widgets */ |
89 | static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { | 105 | static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { |
90 | SND_SOC_DAPM_HP("Headphone Jack", NULL), | 106 | SND_SOC_DAPM_HP("Headphone Jack", NULL), |
@@ -151,6 +167,22 @@ static struct snd_soc_dai_link evm_dai = { | |||
151 | .ops = &evm_ops, | 167 | .ops = &evm_ops, |
152 | }; | 168 | }; |
153 | 169 | ||
170 | static struct snd_soc_dai_link dm365_evm_dai = { | ||
171 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC | ||
172 | .name = "TLV320AIC3X", | ||
173 | .stream_name = "AIC3X", | ||
174 | .cpu_dai = &davinci_i2s_dai, | ||
175 | .codec_dai = &aic3x_dai, | ||
176 | .init = evm_aic3x_init, | ||
177 | .ops = &evm_ops, | ||
178 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) | ||
179 | .name = "Voice Codec - CQ93VC", | ||
180 | .stream_name = "CQ93", | ||
181 | .cpu_dai = &davinci_vcif_dai, | ||
182 | .codec_dai = &cq93vc_dai, | ||
183 | #endif | ||
184 | }; | ||
185 | |||
154 | static struct snd_soc_dai_link dm6467_evm_dai[] = { | 186 | static struct snd_soc_dai_link dm6467_evm_dai[] = { |
155 | { | 187 | { |
156 | .name = "TLV320AIC3X", | 188 | .name = "TLV320AIC3X", |
@@ -165,7 +197,7 @@ static struct snd_soc_dai_link dm6467_evm_dai[] = { | |||
165 | .stream_name = "spdif", | 197 | .stream_name = "spdif", |
166 | .cpu_dai = &davinci_mcasp_dai[DAVINCI_MCASP_DIT_DAI], | 198 | .cpu_dai = &davinci_mcasp_dai[DAVINCI_MCASP_DIT_DAI], |
167 | .codec_dai = &dit_stub_dai, | 199 | .codec_dai = &dit_stub_dai, |
168 | .ops = &evm_ops, | 200 | .ops = &evm_spdif_ops, |
169 | }, | 201 | }, |
170 | }; | 202 | }; |
171 | static struct snd_soc_dai_link da8xx_evm_dai = { | 203 | static struct snd_soc_dai_link da8xx_evm_dai = { |
@@ -177,7 +209,7 @@ static struct snd_soc_dai_link da8xx_evm_dai = { | |||
177 | .ops = &evm_ops, | 209 | .ops = &evm_ops, |
178 | }; | 210 | }; |
179 | 211 | ||
180 | /* davinci dm6446, dm355 or dm365 evm audio machine driver */ | 212 | /* davinci dm6446, dm355 evm audio machine driver */ |
181 | static struct snd_soc_card snd_soc_card_evm = { | 213 | static struct snd_soc_card snd_soc_card_evm = { |
182 | .name = "DaVinci EVM", | 214 | .name = "DaVinci EVM", |
183 | .platform = &davinci_soc_platform, | 215 | .platform = &davinci_soc_platform, |
@@ -185,6 +217,15 @@ static struct snd_soc_card snd_soc_card_evm = { | |||
185 | .num_links = 1, | 217 | .num_links = 1, |
186 | }; | 218 | }; |
187 | 219 | ||
220 | /* davinci dm365 evm audio machine driver */ | ||
221 | static struct snd_soc_card dm365_snd_soc_card_evm = { | ||
222 | .name = "DaVinci DM365 EVM", | ||
223 | .platform = &davinci_soc_platform, | ||
224 | .dai_link = &dm365_evm_dai, | ||
225 | .num_links = 1, | ||
226 | }; | ||
227 | |||
228 | |||
188 | /* davinci dm6467 evm audio machine driver */ | 229 | /* davinci dm6467 evm audio machine driver */ |
189 | static struct snd_soc_card dm6467_snd_soc_card_evm = { | 230 | static struct snd_soc_card dm6467_snd_soc_card_evm = { |
190 | .name = "DaVinci DM6467 EVM", | 231 | .name = "DaVinci DM6467 EVM", |
@@ -217,6 +258,17 @@ static struct snd_soc_device evm_snd_devdata = { | |||
217 | }; | 258 | }; |
218 | 259 | ||
219 | /* evm audio subsystem */ | 260 | /* evm audio subsystem */ |
261 | static struct snd_soc_device dm365_evm_snd_devdata = { | ||
262 | .card = &dm365_snd_soc_card_evm, | ||
263 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC | ||
264 | .codec_dev = &soc_codec_dev_aic3x, | ||
265 | .codec_data = &aic3x_setup, | ||
266 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) | ||
267 | .codec_dev = &soc_codec_dev_cq93vc, | ||
268 | #endif | ||
269 | }; | ||
270 | |||
271 | /* evm audio subsystem */ | ||
220 | static struct snd_soc_device dm6467_evm_snd_devdata = { | 272 | static struct snd_soc_device dm6467_evm_snd_devdata = { |
221 | .card = &dm6467_snd_soc_card_evm, | 273 | .card = &dm6467_snd_soc_card_evm, |
222 | .codec_dev = &soc_codec_dev_aic3x, | 274 | .codec_dev = &soc_codec_dev_aic3x, |
@@ -244,12 +296,15 @@ static int __init evm_init(void) | |||
244 | int index; | 296 | int index; |
245 | int ret; | 297 | int ret; |
246 | 298 | ||
247 | if (machine_is_davinci_evm() || machine_is_davinci_dm365_evm()) { | 299 | if (machine_is_davinci_evm()) { |
248 | evm_snd_dev_data = &evm_snd_devdata; | 300 | evm_snd_dev_data = &evm_snd_devdata; |
249 | index = 0; | 301 | index = 0; |
250 | } else if (machine_is_davinci_dm355_evm()) { | 302 | } else if (machine_is_davinci_dm355_evm()) { |
251 | evm_snd_dev_data = &evm_snd_devdata; | 303 | evm_snd_dev_data = &evm_snd_devdata; |
252 | index = 1; | 304 | index = 1; |
305 | } else if (machine_is_davinci_dm365_evm()) { | ||
306 | evm_snd_dev_data = &dm365_evm_snd_devdata; | ||
307 | index = 0; | ||
253 | } else if (machine_is_davinci_dm6467_evm()) { | 308 | } else if (machine_is_davinci_dm6467_evm()) { |
254 | evm_snd_dev_data = &dm6467_evm_snd_devdata; | 309 | evm_snd_dev_data = &dm6467_evm_snd_devdata; |
255 | index = 0; | 310 | index = 0; |