aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-evm.c40
-rw-r--r--sound/soc/davinci/davinci-i2s.c15
-rw-r--r--sound/soc/davinci/davinci-mcasp.c13
-rw-r--r--sound/soc/davinci/davinci-sffsdr.c2
-rw-r--r--sound/soc/davinci/davinci-vcif.c13
5 files changed, 61 insertions, 22 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index a2cf64b221e..fd969057344 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -158,12 +158,23 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
158} 158}
159 159
160/* davinci-evm digital audio interface glue - connects codec <--> CPU */ 160/* davinci-evm digital audio interface glue - connects codec <--> CPU */
161static struct snd_soc_dai_link evm_dai = { 161static struct snd_soc_dai_link dm6446_evm_dai = {
162 .name = "TLV320AIC3X", 162 .name = "TLV320AIC3X",
163 .stream_name = "AIC3X", 163 .stream_name = "AIC3X",
164 .cpu_dai_name = "davinci-mcasp.0", 164 .cpu_dai_name = "davinci-mcbsp",
165 .codec_dai_name = "tlv320aic3x-hifi", 165 .codec_dai_name = "tlv320aic3x-hifi",
166 .codec_name = "tlv320aic3x-codec.0-001a", 166 .codec_name = "tlv320aic3x-codec.1-001b",
167 .platform_name = "davinci-pcm-audio",
168 .init = evm_aic3x_init,
169 .ops = &evm_ops,
170};
171
172static struct snd_soc_dai_link dm355_evm_dai = {
173 .name = "TLV320AIC3X",
174 .stream_name = "AIC3X",
175 .cpu_dai_name = "davinci-mcbsp.1",
176 .codec_dai_name = "tlv320aic3x-hifi",
177 .codec_name = "tlv320aic3x-codec.1-001b",
167 .platform_name = "davinci-pcm-audio", 178 .platform_name = "davinci-pcm-audio",
168 .init = evm_aic3x_init, 179 .init = evm_aic3x_init,
169 .ops = &evm_ops, 180 .ops = &evm_ops,
@@ -173,10 +184,10 @@ static struct snd_soc_dai_link dm365_evm_dai = {
173#ifdef CONFIG_SND_DM365_AIC3X_CODEC 184#ifdef CONFIG_SND_DM365_AIC3X_CODEC
174 .name = "TLV320AIC3X", 185 .name = "TLV320AIC3X",
175 .stream_name = "AIC3X", 186 .stream_name = "AIC3X",
176 .cpu_dai_name = "davinci-i2s", 187 .cpu_dai_name = "davinci-mcbsp",
177 .codec_dai_name = "tlv320aic3x-hifi", 188 .codec_dai_name = "tlv320aic3x-hifi",
178 .init = evm_aic3x_init, 189 .init = evm_aic3x_init,
179 .codec_name = "tlv320aic3x-codec.0-001a", 190 .codec_name = "tlv320aic3x-codec.1-0018",
180 .ops = &evm_ops, 191 .ops = &evm_ops,
181#elif defined(CONFIG_SND_DM365_VOICE_CODEC) 192#elif defined(CONFIG_SND_DM365_VOICE_CODEC)
182 .name = "Voice Codec - CQ93VC", 193 .name = "Voice Codec - CQ93VC",
@@ -220,10 +231,17 @@ static struct snd_soc_dai_link da8xx_evm_dai = {
220 .ops = &evm_ops, 231 .ops = &evm_ops,
221}; 232};
222 233
223/* davinci dm6446, dm355 evm audio machine driver */ 234/* davinci dm6446 evm audio machine driver */
224static struct snd_soc_card snd_soc_card_evm = { 235static struct snd_soc_card dm6446_snd_soc_card_evm = {
225 .name = "DaVinci EVM", 236 .name = "DaVinci DM6446 EVM",
226 .dai_link = &evm_dai, 237 .dai_link = &dm6446_evm_dai,
238 .num_links = 1,
239};
240
241/* davinci dm355 evm audio machine driver */
242static struct snd_soc_card dm355_snd_soc_card_evm = {
243 .name = "DaVinci DM355 EVM",
244 .dai_link = &dm355_evm_dai,
227 .num_links = 1, 245 .num_links = 1,
228}; 246};
229 247
@@ -262,10 +280,10 @@ static int __init evm_init(void)
262 int ret; 280 int ret;
263 281
264 if (machine_is_davinci_evm()) { 282 if (machine_is_davinci_evm()) {
265 evm_snd_dev_data = &snd_soc_card_evm; 283 evm_snd_dev_data = &dm6446_snd_soc_card_evm;
266 index = 0; 284 index = 0;
267 } else if (machine_is_davinci_dm355_evm()) { 285 } else if (machine_is_davinci_dm355_evm()) {
268 evm_snd_dev_data = &snd_soc_card_evm; 286 evm_snd_dev_data = &dm355_snd_soc_card_evm;
269 index = 1; 287 index = 1;
270 } else if (machine_is_davinci_dm365_evm()) { 288 } else if (machine_is_davinci_dm365_evm()) {
271 evm_snd_dev_data = &dm365_snd_soc_card_evm; 289 evm_snd_dev_data = &dm365_snd_soc_card_evm;
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index d46b545d41f..9e0e565e6ed 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -426,9 +426,6 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
426 snd_pcm_format_t fmt; 426 snd_pcm_format_t fmt;
427 unsigned element_cnt = 1; 427 unsigned element_cnt = 1;
428 428
429 dai->capture_dma_data = dev->dma_params;
430 dai->playback_dma_data = dev->dma_params;
431
432 /* general line settings */ 429 /* general line settings */
433 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); 430 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
434 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { 431 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
@@ -601,6 +598,15 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
601 return ret; 598 return ret;
602} 599}
603 600
601static int davinci_i2s_startup(struct snd_pcm_substream *substream,
602 struct snd_soc_dai *dai)
603{
604 struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai);
605
606 snd_soc_dai_set_dma_data(dai, substream, dev->dma_params);
607 return 0;
608}
609
604static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, 610static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,
605 struct snd_soc_dai *dai) 611 struct snd_soc_dai *dai)
606{ 612{
@@ -612,6 +618,7 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,
612#define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 618#define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000
613 619
614static struct snd_soc_dai_ops davinci_i2s_dai_ops = { 620static struct snd_soc_dai_ops davinci_i2s_dai_ops = {
621 .startup = davinci_i2s_startup,
615 .shutdown = davinci_i2s_shutdown, 622 .shutdown = davinci_i2s_shutdown,
616 .prepare = davinci_i2s_prepare, 623 .prepare = davinci_i2s_prepare,
617 .trigger = davinci_i2s_trigger, 624 .trigger = davinci_i2s_trigger,
@@ -749,7 +756,7 @@ static struct platform_driver davinci_mcbsp_driver = {
749 .probe = davinci_i2s_probe, 756 .probe = davinci_i2s_probe,
750 .remove = davinci_i2s_remove, 757 .remove = davinci_i2s_remove,
751 .driver = { 758 .driver = {
752 .name = "davinci-i2s", 759 .name = "davinci-mcbsp",
753 .owner = THIS_MODULE, 760 .owner = THIS_MODULE,
754 }, 761 },
755}; 762};
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 86918ee1241..fb55d2c5d70 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -715,9 +715,6 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
715 int word_length; 715 int word_length;
716 u8 fifo_level; 716 u8 fifo_level;
717 717
718 cpu_dai->capture_dma_data = dev->dma_params;
719 cpu_dai->playback_dma_data = dev->dma_params;
720
721 davinci_hw_common_param(dev, substream->stream); 718 davinci_hw_common_param(dev, substream->stream);
722 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 719 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
723 fifo_level = dev->txnumevt; 720 fifo_level = dev->txnumevt;
@@ -799,7 +796,17 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
799 return ret; 796 return ret;
800} 797}
801 798
799static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
800 struct snd_soc_dai *dai)
801{
802 struct davinci_audio_dev *dev = snd_soc_dai_get_drvdata(dai);
803
804 snd_soc_dai_set_dma_data(dai, substream, dev->dma_params);
805 return 0;
806}
807
802static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { 808static struct snd_soc_dai_ops davinci_mcasp_dai_ops = {
809 .startup = davinci_mcasp_startup,
803 .trigger = davinci_mcasp_trigger, 810 .trigger = davinci_mcasp_trigger,
804 .hw_params = davinci_mcasp_hw_params, 811 .hw_params = davinci_mcasp_hw_params,
805 .set_fmt = davinci_mcasp_set_dai_fmt, 812 .set_fmt = davinci_mcasp_set_dai_fmt,
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 009b6521a1b..6c6666a1f94 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -84,7 +84,7 @@ static struct snd_soc_ops sffsdr_ops = {
84static struct snd_soc_dai_link sffsdr_dai = { 84static struct snd_soc_dai_link sffsdr_dai = {
85 .name = "PCM3008", /* Codec name */ 85 .name = "PCM3008", /* Codec name */
86 .stream_name = "PCM3008 HiFi", 86 .stream_name = "PCM3008 HiFi",
87 .cpu_dai_name = "davinci-asp.0", 87 .cpu_dai_name = "davinci-mcbsp",
88 .codec_dai_name = "pcm3008-hifi", 88 .codec_dai_name = "pcm3008-hifi",
89 .codec_name = "pcm3008-codec", 89 .codec_name = "pcm3008-codec",
90 .platform_name = "davinci-pcm-audio", 90 .platform_name = "davinci-pcm-audio",
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index ea232f6a2c2..fb4cc1edf33 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -97,9 +97,6 @@ static int davinci_vcif_hw_params(struct snd_pcm_substream *substream,
97 &davinci_vcif_dev->dma_params[substream->stream]; 97 &davinci_vcif_dev->dma_params[substream->stream];
98 u32 w; 98 u32 w;
99 99
100 dai->capture_dma_data = davinci_vcif_dev->dma_params;
101 dai->playback_dma_data = davinci_vcif_dev->dma_params;
102
103 /* Restart the codec before setup */ 100 /* Restart the codec before setup */
104 davinci_vcif_stop(substream); 101 davinci_vcif_stop(substream);
105 davinci_vcif_start(substream); 102 davinci_vcif_start(substream);
@@ -174,9 +171,19 @@ static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
174 return ret; 171 return ret;
175} 172}
176 173
174static int davinci_vcif_startup(struct snd_pcm_substream *substream,
175 struct snd_soc_dai *dai)
176{
177 struct davinci_vcif_dev *dev = snd_soc_dai_get_drvdata(dai);
178
179 snd_soc_dai_set_dma_data(dai, substream, dev->dma_params);
180 return 0;
181}
182
177#define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000 183#define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000
178 184
179static struct snd_soc_dai_ops davinci_vcif_dai_ops = { 185static struct snd_soc_dai_ops davinci_vcif_dai_ops = {
186 .startup = davinci_vcif_startup,
180 .trigger = davinci_vcif_trigger, 187 .trigger = davinci_vcif_trigger,
181 .hw_params = davinci_vcif_hw_params, 188 .hw_params = davinci_vcif_hw_params,
182}; 189};