diff options
author | Chris Paulson-Ellis <chris@edesix.com> | 2010-11-16 07:27:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-17 13:36:40 -0500 |
commit | bedad0ca3fb2ba52c347b54a97b78d32e406dd96 (patch) | |
tree | d4c5bc3545b11a9c143ee8e0ab107fc71301c4dc /sound/soc/davinci/davinci-evm.c | |
parent | 11e713a07e0c03e2202ad1e87cd91d45842ce3da (diff) |
ASoC: davinci: fixes for multi-component
Multi-component commit f0fba2ad broke a few things which this patch should
fix. Tested on the DM355 EVM. I've been as careful as I can, but it would be
good if those with access to other Davinci boards could test.
--
The multi-component commit put the initialisation of
snd_soc_dai.[capture|playback]_dma_data into snd_soc_dai_ops.hw_params of the
McBSP, McASP & VCIF drivers (davinci-i2s.c, davinci-mcasp.c & davinci-vcif.c).
The initialisation had to be moved from the probe function in these drivers
because davinci_*_dai changed from snd_soc_dai to snd_soc_dai_driver.
Unfortunately, the DMA params pointer is needed by davinci_pcm_open (in
davinci-pcm.c) before hw_params is called. I have moved the initialisation to
a new snd_soc_dai_ops.startup function in each of these drivers. This fix
indicates that all platforms that use davinci-pcm must have been broken and
need to test with this fix.
--
The multi-component commit also changed the McBSP driver name from
"davinci-asp" to "davinci-i2s" in davinci-i2s.c without updating the board
level references to the driver name. This change is understandable, as there
is a similarly named "davinci-mcasp" driver in davinci-mcasp.c.
There is probably no 'correct' name for this driver. The DM6446 datasheet
calls it the "ASP" and describes it as a "specialised McBSP". The DM355
datasheet calls it the "ASP" and describes it as a "specialised ASP". The
DM365 datasheet calls it the "McBSP". Rather than fix this problem by
reverting to "davinci-asp", I've elected to avoid future confusion with the
"davinci-mcasp" driver by changing it to "davinci-mcbsp", which is also
consistent with the names of the functions in the driver. There are other
fixes required, so it was never going to be as simple as a revert anyway.
--
The DM365 only has one McBSP port (of the McBSP platforms, only the DM355 has
2 ports), so I've changed the the id of the platform_device from 0 to -1.
--
In davinci-evm.c, the DM6446 EVM can no longer share a snd_soc_dai_link
structure with the DM355 EVM as they use different cpu DAI names (the DM355
has 2 ports and the EVM uses the second port, but the DM6446 only has 1 port).
This also means that the 2 boards need different snd_soc_card structures.
--
The codec_name entries in davinci-evm.c didn't match the i2c ids in the board
files. I have only checked and fixed the details of the names used for the
McBSP based platforms. Someone with a McASP based platform (eg DA8xx) should
check the others.
Signed-off-by: Chris Paulson-Ellis <chris@edesix.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-evm.c')
-rw-r--r-- | sound/soc/davinci/davinci-evm.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index 2b07b17a6b2d..bc9e6b0b3f6f 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
@@ -157,12 +157,23 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) | |||
157 | } | 157 | } |
158 | 158 | ||
159 | /* davinci-evm digital audio interface glue - connects codec <--> CPU */ | 159 | /* davinci-evm digital audio interface glue - connects codec <--> CPU */ |
160 | static struct snd_soc_dai_link evm_dai = { | 160 | static struct snd_soc_dai_link dm6446_evm_dai = { |
161 | .name = "TLV320AIC3X", | 161 | .name = "TLV320AIC3X", |
162 | .stream_name = "AIC3X", | 162 | .stream_name = "AIC3X", |
163 | .cpu_dai_name = "davinci-mcasp.0", | 163 | .cpu_dai_name = "davinci-mcbsp", |
164 | .codec_dai_name = "tlv320aic3x-hifi", | 164 | .codec_dai_name = "tlv320aic3x-hifi", |
165 | .codec_name = "tlv320aic3x-codec.0-001a", | 165 | .codec_name = "tlv320aic3x-codec.1-001b", |
166 | .platform_name = "davinci-pcm-audio", | ||
167 | .init = evm_aic3x_init, | ||
168 | .ops = &evm_ops, | ||
169 | }; | ||
170 | |||
171 | static struct snd_soc_dai_link dm355_evm_dai = { | ||
172 | .name = "TLV320AIC3X", | ||
173 | .stream_name = "AIC3X", | ||
174 | .cpu_dai_name = "davinci-mcbsp.1", | ||
175 | .codec_dai_name = "tlv320aic3x-hifi", | ||
176 | .codec_name = "tlv320aic3x-codec.1-001b", | ||
166 | .platform_name = "davinci-pcm-audio", | 177 | .platform_name = "davinci-pcm-audio", |
167 | .init = evm_aic3x_init, | 178 | .init = evm_aic3x_init, |
168 | .ops = &evm_ops, | 179 | .ops = &evm_ops, |
@@ -172,10 +183,10 @@ static struct snd_soc_dai_link dm365_evm_dai = { | |||
172 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC | 183 | #ifdef CONFIG_SND_DM365_AIC3X_CODEC |
173 | .name = "TLV320AIC3X", | 184 | .name = "TLV320AIC3X", |
174 | .stream_name = "AIC3X", | 185 | .stream_name = "AIC3X", |
175 | .cpu_dai_name = "davinci-i2s", | 186 | .cpu_dai_name = "davinci-mcbsp", |
176 | .codec_dai_name = "tlv320aic3x-hifi", | 187 | .codec_dai_name = "tlv320aic3x-hifi", |
177 | .init = evm_aic3x_init, | 188 | .init = evm_aic3x_init, |
178 | .codec_name = "tlv320aic3x-codec.0-001a", | 189 | .codec_name = "tlv320aic3x-codec.1-0018", |
179 | .ops = &evm_ops, | 190 | .ops = &evm_ops, |
180 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) | 191 | #elif defined(CONFIG_SND_DM365_VOICE_CODEC) |
181 | .name = "Voice Codec - CQ93VC", | 192 | .name = "Voice Codec - CQ93VC", |
@@ -219,10 +230,17 @@ static struct snd_soc_dai_link da8xx_evm_dai = { | |||
219 | .ops = &evm_ops, | 230 | .ops = &evm_ops, |
220 | }; | 231 | }; |
221 | 232 | ||
222 | /* davinci dm6446, dm355 evm audio machine driver */ | 233 | /* davinci dm6446 evm audio machine driver */ |
223 | static struct snd_soc_card snd_soc_card_evm = { | 234 | static struct snd_soc_card dm6446_snd_soc_card_evm = { |
224 | .name = "DaVinci EVM", | 235 | .name = "DaVinci DM6446 EVM", |
225 | .dai_link = &evm_dai, | 236 | .dai_link = &dm6446_evm_dai, |
237 | .num_links = 1, | ||
238 | }; | ||
239 | |||
240 | /* davinci dm355 evm audio machine driver */ | ||
241 | static struct snd_soc_card dm355_snd_soc_card_evm = { | ||
242 | .name = "DaVinci DM355 EVM", | ||
243 | .dai_link = &dm355_evm_dai, | ||
226 | .num_links = 1, | 244 | .num_links = 1, |
227 | }; | 245 | }; |
228 | 246 | ||
@@ -261,10 +279,10 @@ static int __init evm_init(void) | |||
261 | int ret; | 279 | int ret; |
262 | 280 | ||
263 | if (machine_is_davinci_evm()) { | 281 | if (machine_is_davinci_evm()) { |
264 | evm_snd_dev_data = &snd_soc_card_evm; | 282 | evm_snd_dev_data = &dm6446_snd_soc_card_evm; |
265 | index = 0; | 283 | index = 0; |
266 | } else if (machine_is_davinci_dm355_evm()) { | 284 | } else if (machine_is_davinci_dm355_evm()) { |
267 | evm_snd_dev_data = &snd_soc_card_evm; | 285 | evm_snd_dev_data = &dm355_snd_soc_card_evm; |
268 | index = 1; | 286 | index = 1; |
269 | } else if (machine_is_davinci_dm365_evm()) { | 287 | } else if (machine_is_davinci_dm365_evm()) { |
270 | evm_snd_dev_data = &dm365_snd_soc_card_evm; | 288 | evm_snd_dev_data = &dm365_snd_soc_card_evm; |