diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-08-23 08:12:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-08-23 08:12:22 -0400 |
commit | 68538bf2bce557c3b5fe8c59b034d45352500db1 (patch) | |
tree | a84b68990cadcbfc277acc7b7f2b75716750e203 /sound/soc/omap | |
parent | a8cc20999799a94929a56393ff39b32245e33d64 (diff) | |
parent | 43bcb402f84fe459102120b4e2d28d7117f16cd0 (diff) |
Merge tag 'asoc-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.12
- DAPM is now mandatory for CODEC drivers in order to avoid the repeated
regressions in the special cases for non-DAPM CODECs and make it
easier to integrate with other components on boards. All existing
drivers have had some level of DAPM support added.
- A lot of cleanups in DAPM plus support for maintaining controls in a
specific state while a DAPM widget all contributed by Lars-Peter Clausen.
- Core helpers for bitbanged AC'97 reset from Markus Pargmann.
- New drivers and support for Analog Devices ADAU1702 and ADAU1401(a),
Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based
machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung
Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson
Microelectronics WM8997.
- Support for building drivers that can support it cross-platform for
compile test.
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/Kconfig | 8 | ||||
-rw-r--r-- | sound/soc/omap/mcbsp.c | 39 | ||||
-rw-r--r-- | sound/soc/omap/omap-abe-twl6040.c | 133 | ||||
-rw-r--r-- | sound/soc/omap/omap-dmic.c | 20 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 5 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcpdm.c | 19 | ||||
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 17 |
7 files changed, 92 insertions, 149 deletions
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index 9f5d55e6b17a..daa78a0095fa 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | config SND_OMAP_SOC | 1 | config SND_OMAP_SOC |
2 | tristate "SoC Audio for the Texas Instruments OMAP chips" | 2 | tristate "SoC Audio for the Texas Instruments OMAP chips" |
3 | depends on ARCH_OMAP && DMA_OMAP | 3 | depends on (ARCH_OMAP && DMA_OMAP) || (ARCH_ARM && COMPILE_TEST) |
4 | select SND_SOC_DMAENGINE_PCM | 4 | select SND_DMAENGINE_PCM |
5 | 5 | ||
6 | config SND_OMAP_SOC_DMIC | 6 | config SND_OMAP_SOC_DMIC |
7 | tristate | 7 | tristate |
@@ -26,7 +26,7 @@ config SND_OMAP_SOC_N810 | |||
26 | 26 | ||
27 | config SND_OMAP_SOC_RX51 | 27 | config SND_OMAP_SOC_RX51 |
28 | tristate "SoC Audio support for Nokia RX-51" | 28 | tristate "SoC Audio support for Nokia RX-51" |
29 | depends on SND_OMAP_SOC && MACH_NOKIA_RX51 | 29 | depends on SND_OMAP_SOC && ARCH_ARM && (MACH_NOKIA_RX51 || COMPILE_TEST) |
30 | select SND_OMAP_SOC_MCBSP | 30 | select SND_OMAP_SOC_MCBSP |
31 | select SND_SOC_TLV320AIC3X | 31 | select SND_SOC_TLV320AIC3X |
32 | select SND_SOC_TPA6130A2 | 32 | select SND_SOC_TPA6130A2 |
@@ -87,7 +87,7 @@ config SND_OMAP_SOC_OMAP_TWL4030 | |||
87 | 87 | ||
88 | config SND_OMAP_SOC_OMAP_ABE_TWL6040 | 88 | config SND_OMAP_SOC_OMAP_ABE_TWL6040 |
89 | tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" | 89 | tristate "SoC Audio support for OMAP boards using ABE and twl6040 codec" |
90 | depends on TWL6040_CORE && SND_OMAP_SOC && ARCH_OMAP4 | 90 | depends on TWL6040_CORE && SND_OMAP_SOC && (ARCH_OMAP4 || COMPILE_TEST) |
91 | select SND_OMAP_SOC_DMIC | 91 | select SND_OMAP_SOC_DMIC |
92 | select SND_OMAP_SOC_MCPDM | 92 | select SND_OMAP_SOC_MCPDM |
93 | select SND_SOC_TWL6040 | 93 | select SND_SOC_TWL6040 |
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index e4980c5d7609..83433fdea32a 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c | |||
@@ -1012,28 +1012,33 @@ int omap_mcbsp_init(struct platform_device *pdev) | |||
1012 | } | 1012 | } |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); | 1015 | if (!pdev->dev.of_node) { |
1016 | if (!res) { | 1016 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); |
1017 | dev_err(&pdev->dev, "invalid rx DMA channel\n"); | 1017 | if (!res) { |
1018 | return -ENODEV; | 1018 | dev_err(&pdev->dev, "invalid tx DMA channel\n"); |
1019 | } | 1019 | return -ENODEV; |
1020 | /* RX DMA request number, and port address configuration */ | 1020 | } |
1021 | mcbsp->dma_req[1] = res->start; | 1021 | mcbsp->dma_req[0] = res->start; |
1022 | mcbsp->dma_data[1].filter_data = &mcbsp->dma_req[1]; | 1022 | mcbsp->dma_data[0].filter_data = &mcbsp->dma_req[0]; |
1023 | mcbsp->dma_data[1].addr = omap_mcbsp_dma_reg_params(mcbsp, 1); | ||
1024 | mcbsp->dma_data[1].maxburst = 4; | ||
1025 | 1023 | ||
1026 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); | 1024 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); |
1027 | if (!res) { | 1025 | if (!res) { |
1028 | dev_err(&pdev->dev, "invalid tx DMA channel\n"); | 1026 | dev_err(&pdev->dev, "invalid rx DMA channel\n"); |
1029 | return -ENODEV; | 1027 | return -ENODEV; |
1028 | } | ||
1029 | mcbsp->dma_req[1] = res->start; | ||
1030 | mcbsp->dma_data[1].filter_data = &mcbsp->dma_req[1]; | ||
1031 | } else { | ||
1032 | mcbsp->dma_data[0].filter_data = "tx"; | ||
1033 | mcbsp->dma_data[1].filter_data = "rx"; | ||
1030 | } | 1034 | } |
1031 | /* TX DMA request number, and port address configuration */ | 1035 | |
1032 | mcbsp->dma_req[0] = res->start; | ||
1033 | mcbsp->dma_data[0].filter_data = &mcbsp->dma_req[0]; | ||
1034 | mcbsp->dma_data[0].addr = omap_mcbsp_dma_reg_params(mcbsp, 0); | 1036 | mcbsp->dma_data[0].addr = omap_mcbsp_dma_reg_params(mcbsp, 0); |
1035 | mcbsp->dma_data[0].maxburst = 4; | 1037 | mcbsp->dma_data[0].maxburst = 4; |
1036 | 1038 | ||
1039 | mcbsp->dma_data[1].addr = omap_mcbsp_dma_reg_params(mcbsp, 1); | ||
1040 | mcbsp->dma_data[1].maxburst = 4; | ||
1041 | |||
1037 | mcbsp->fclk = clk_get(&pdev->dev, "fck"); | 1042 | mcbsp->fclk = clk_get(&pdev->dev, "fck"); |
1038 | if (IS_ERR(mcbsp->fclk)) { | 1043 | if (IS_ERR(mcbsp->fclk)) { |
1039 | ret = PTR_ERR(mcbsp->fclk); | 1044 | ret = PTR_ERR(mcbsp->fclk); |
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c index 70cd5c7b2e14..ebb13906b3a0 100644 --- a/sound/soc/omap/omap-abe-twl6040.c +++ b/sound/soc/omap/omap-abe-twl6040.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/mfd/twl6040.h> | 25 | #include <linux/mfd/twl6040.h> |
26 | #include <linux/platform_data/omap-abe-twl6040.h> | ||
27 | #include <linux/module.h> | 26 | #include <linux/module.h> |
28 | #include <linux/of.h> | 27 | #include <linux/of.h> |
29 | 28 | ||
@@ -166,19 +165,10 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
166 | {"AFMR", NULL, "Line In"}, | 165 | {"AFMR", NULL, "Line In"}, |
167 | }; | 166 | }; |
168 | 167 | ||
169 | static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm, | ||
170 | int connected, char *pin) | ||
171 | { | ||
172 | if (!connected) | ||
173 | snd_soc_dapm_disable_pin(dapm, pin); | ||
174 | } | ||
175 | |||
176 | static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd) | 168 | static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd) |
177 | { | 169 | { |
178 | struct snd_soc_codec *codec = rtd->codec; | 170 | struct snd_soc_codec *codec = rtd->codec; |
179 | struct snd_soc_card *card = codec->card; | 171 | struct snd_soc_card *card = codec->card; |
180 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
181 | struct omap_abe_twl6040_data *pdata = dev_get_platdata(card->dev); | ||
182 | struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card); | 172 | struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card); |
183 | int hs_trim; | 173 | int hs_trim; |
184 | int ret = 0; | 174 | int ret = 0; |
@@ -203,24 +193,6 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd) | |||
203 | twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET); | 193 | twl6040_hs_jack_detect(codec, &hs_jack, SND_JACK_HEADSET); |
204 | } | 194 | } |
205 | 195 | ||
206 | /* | ||
207 | * NULL pdata means we booted with DT. In this case the routing is | ||
208 | * provided and the card is fully routed, no need to mark pins. | ||
209 | */ | ||
210 | if (!pdata) | ||
211 | return ret; | ||
212 | |||
213 | /* Disable not connected paths if not used */ | ||
214 | twl6040_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone"); | ||
215 | twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk"); | ||
216 | twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk"); | ||
217 | twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out"); | ||
218 | twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vibrator"); | ||
219 | twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic"); | ||
220 | twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic"); | ||
221 | twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic"); | ||
222 | twl6040_disconnect_pin(dapm, pdata->has_afm, "Line In"); | ||
223 | |||
224 | return ret; | 196 | return ret; |
225 | } | 197 | } |
226 | 198 | ||
@@ -274,13 +246,18 @@ static struct snd_soc_card omap_abe_card = { | |||
274 | 246 | ||
275 | static int omap_abe_probe(struct platform_device *pdev) | 247 | static int omap_abe_probe(struct platform_device *pdev) |
276 | { | 248 | { |
277 | struct omap_abe_twl6040_data *pdata = dev_get_platdata(&pdev->dev); | ||
278 | struct device_node *node = pdev->dev.of_node; | 249 | struct device_node *node = pdev->dev.of_node; |
279 | struct snd_soc_card *card = &omap_abe_card; | 250 | struct snd_soc_card *card = &omap_abe_card; |
251 | struct device_node *dai_node; | ||
280 | struct abe_twl6040 *priv; | 252 | struct abe_twl6040 *priv; |
281 | int num_links = 0; | 253 | int num_links = 0; |
282 | int ret = 0; | 254 | int ret = 0; |
283 | 255 | ||
256 | if (!node) { | ||
257 | dev_err(&pdev->dev, "of node is missing.\n"); | ||
258 | return -ENODEV; | ||
259 | } | ||
260 | |||
284 | card->dev = &pdev->dev; | 261 | card->dev = &pdev->dev; |
285 | 262 | ||
286 | priv = devm_kzalloc(&pdev->dev, sizeof(struct abe_twl6040), GFP_KERNEL); | 263 | priv = devm_kzalloc(&pdev->dev, sizeof(struct abe_twl6040), GFP_KERNEL); |
@@ -289,78 +266,50 @@ static int omap_abe_probe(struct platform_device *pdev) | |||
289 | 266 | ||
290 | priv->dmic_codec_dev = ERR_PTR(-EINVAL); | 267 | priv->dmic_codec_dev = ERR_PTR(-EINVAL); |
291 | 268 | ||
292 | if (node) { | 269 | if (snd_soc_of_parse_card_name(card, "ti,model")) { |
293 | struct device_node *dai_node; | 270 | dev_err(&pdev->dev, "Card name is not provided\n"); |
294 | 271 | return -ENODEV; | |
295 | if (snd_soc_of_parse_card_name(card, "ti,model")) { | 272 | } |
296 | dev_err(&pdev->dev, "Card name is not provided\n"); | ||
297 | return -ENODEV; | ||
298 | } | ||
299 | 273 | ||
300 | ret = snd_soc_of_parse_audio_routing(card, | 274 | ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing"); |
301 | "ti,audio-routing"); | 275 | if (ret) { |
302 | if (ret) { | 276 | dev_err(&pdev->dev, "Error while parsing DAPM routing\n"); |
303 | dev_err(&pdev->dev, | 277 | return ret; |
304 | "Error while parsing DAPM routing\n"); | 278 | } |
305 | return ret; | ||
306 | } | ||
307 | 279 | ||
308 | dai_node = of_parse_phandle(node, "ti,mcpdm", 0); | 280 | dai_node = of_parse_phandle(node, "ti,mcpdm", 0); |
309 | if (!dai_node) { | 281 | if (!dai_node) { |
310 | dev_err(&pdev->dev, "McPDM node is not provided\n"); | 282 | dev_err(&pdev->dev, "McPDM node is not provided\n"); |
311 | return -EINVAL; | 283 | return -EINVAL; |
312 | } | 284 | } |
313 | abe_twl6040_dai_links[0].cpu_dai_name = NULL; | 285 | abe_twl6040_dai_links[0].cpu_dai_name = NULL; |
314 | abe_twl6040_dai_links[0].cpu_of_node = dai_node; | 286 | abe_twl6040_dai_links[0].cpu_of_node = dai_node; |
315 | 287 | ||
316 | dai_node = of_parse_phandle(node, "ti,dmic", 0); | 288 | dai_node = of_parse_phandle(node, "ti,dmic", 0); |
317 | if (dai_node) { | 289 | if (dai_node) { |
318 | num_links = 2; | 290 | num_links = 2; |
319 | abe_twl6040_dai_links[1].cpu_dai_name = NULL; | 291 | abe_twl6040_dai_links[1].cpu_dai_name = NULL; |
320 | abe_twl6040_dai_links[1].cpu_of_node = dai_node; | 292 | abe_twl6040_dai_links[1].cpu_of_node = dai_node; |
321 | 293 | ||
322 | priv->dmic_codec_dev = platform_device_register_simple( | 294 | priv->dmic_codec_dev = platform_device_register_simple( |
323 | "dmic-codec", -1, NULL, 0); | 295 | "dmic-codec", -1, NULL, 0); |
324 | if (IS_ERR(priv->dmic_codec_dev)) { | 296 | if (IS_ERR(priv->dmic_codec_dev)) { |
325 | dev_err(&pdev->dev, | 297 | dev_err(&pdev->dev, "Can't instantiate dmic-codec\n"); |
326 | "Can't instantiate dmic-codec\n"); | 298 | return PTR_ERR(priv->dmic_codec_dev); |
327 | return PTR_ERR(priv->dmic_codec_dev); | ||
328 | } | ||
329 | } else { | ||
330 | num_links = 1; | ||
331 | } | ||
332 | |||
333 | priv->jack_detection = of_property_read_bool(node, | ||
334 | "ti,jack-detection"); | ||
335 | of_property_read_u32(node, "ti,mclk-freq", | ||
336 | &priv->mclk_freq); | ||
337 | if (!priv->mclk_freq) { | ||
338 | dev_err(&pdev->dev, "MCLK frequency not provided\n"); | ||
339 | ret = -EINVAL; | ||
340 | goto err_unregister; | ||
341 | } | 299 | } |
342 | |||
343 | omap_abe_card.fully_routed = 1; | ||
344 | } else if (pdata) { | ||
345 | if (pdata->card_name) { | ||
346 | card->name = pdata->card_name; | ||
347 | } else { | ||
348 | dev_err(&pdev->dev, "Card name is not provided\n"); | ||
349 | return -ENODEV; | ||
350 | } | ||
351 | |||
352 | if (pdata->has_dmic) | ||
353 | num_links = 2; | ||
354 | else | ||
355 | num_links = 1; | ||
356 | |||
357 | priv->jack_detection = pdata->jack_detection; | ||
358 | priv->mclk_freq = pdata->mclk_freq; | ||
359 | } else { | 300 | } else { |
360 | dev_err(&pdev->dev, "Missing pdata\n"); | 301 | num_links = 1; |
361 | return -ENODEV; | 302 | } |
303 | |||
304 | priv->jack_detection = of_property_read_bool(node, "ti,jack-detection"); | ||
305 | of_property_read_u32(node, "ti,mclk-freq", &priv->mclk_freq); | ||
306 | if (!priv->mclk_freq) { | ||
307 | dev_err(&pdev->dev, "MCLK frequency not provided\n"); | ||
308 | ret = -EINVAL; | ||
309 | goto err_unregister; | ||
362 | } | 310 | } |
363 | 311 | ||
312 | card->fully_routed = 1; | ||
364 | 313 | ||
365 | if (!priv->mclk_freq) { | 314 | if (!priv->mclk_freq) { |
366 | dev_err(&pdev->dev, "MCLK frequency missing\n"); | 315 | dev_err(&pdev->dev, "MCLK frequency missing\n"); |
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index 2ad0370146fd..12e566be3793 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c | |||
@@ -57,7 +57,6 @@ struct omap_dmic { | |||
57 | struct mutex mutex; | 57 | struct mutex mutex; |
58 | 58 | ||
59 | struct snd_dmaengine_dai_dma_data dma_data; | 59 | struct snd_dmaengine_dai_dma_data dma_data; |
60 | unsigned int dma_req; | ||
61 | }; | 60 | }; |
62 | 61 | ||
63 | static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val) | 62 | static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val) |
@@ -478,26 +477,15 @@ static int asoc_dmic_probe(struct platform_device *pdev) | |||
478 | } | 477 | } |
479 | dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG; | 478 | dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG; |
480 | 479 | ||
481 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 480 | dmic->dma_data.filter_data = "up_link"; |
482 | if (!res) { | ||
483 | dev_err(dmic->dev, "invalid dma resource\n"); | ||
484 | ret = -ENODEV; | ||
485 | goto err_put_clk; | ||
486 | } | ||
487 | |||
488 | dmic->dma_req = res->start; | ||
489 | dmic->dma_data.filter_data = &dmic->dma_req; | ||
490 | 481 | ||
491 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); | 482 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); |
492 | if (!res) { | 483 | dmic->io_base = devm_ioremap_resource(&pdev->dev, res); |
493 | dev_err(dmic->dev, "invalid memory resource\n"); | 484 | if (IS_ERR(dmic->io_base)) { |
494 | ret = -ENODEV; | 485 | ret = PTR_ERR(dmic->io_base); |
495 | goto err_put_clk; | 486 | goto err_put_clk; |
496 | } | 487 | } |
497 | 488 | ||
498 | dmic->io_base = devm_ioremap_resource(&pdev->dev, res); | ||
499 | if (IS_ERR(dmic->io_base)) | ||
500 | return PTR_ERR(dmic->io_base); | ||
501 | 489 | ||
502 | ret = snd_soc_register_component(&pdev->dev, &omap_dmic_component, | 490 | ret = snd_soc_register_component(&pdev->dev, &omap_dmic_component, |
503 | &omap_dmic_dai, 1); | 491 | &omap_dmic_dai, 1); |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 7483efb6dc67..6c19bba23570 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -433,6 +433,11 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
433 | /* Sample rate generator drives the FS */ | 433 | /* Sample rate generator drives the FS */ |
434 | regs->srgr2 |= FSGM; | 434 | regs->srgr2 |= FSGM; |
435 | break; | 435 | break; |
436 | case SND_SOC_DAIFMT_CBM_CFS: | ||
437 | /* McBSP slave. FS clock as output */ | ||
438 | regs->srgr2 |= FSGM; | ||
439 | regs->pcr0 |= FSXM; | ||
440 | break; | ||
436 | case SND_SOC_DAIFMT_CBM_CFM: | 441 | case SND_SOC_DAIFMT_CBM_CFM: |
437 | /* McBSP slave */ | 442 | /* McBSP slave */ |
438 | break; | 443 | break; |
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index eb05c7ed6d05..90d2a7cd2563 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -66,7 +66,6 @@ struct omap_mcpdm { | |||
66 | bool restart; | 66 | bool restart; |
67 | 67 | ||
68 | struct snd_dmaengine_dai_dma_data dma_data[2]; | 68 | struct snd_dmaengine_dai_dma_data dma_data[2]; |
69 | unsigned int dma_req[2]; | ||
70 | }; | 69 | }; |
71 | 70 | ||
72 | /* | 71 | /* |
@@ -477,24 +476,10 @@ static int asoc_mcpdm_probe(struct platform_device *pdev) | |||
477 | mcpdm->dma_data[0].addr = res->start + MCPDM_REG_DN_DATA; | 476 | mcpdm->dma_data[0].addr = res->start + MCPDM_REG_DN_DATA; |
478 | mcpdm->dma_data[1].addr = res->start + MCPDM_REG_UP_DATA; | 477 | mcpdm->dma_data[1].addr = res->start + MCPDM_REG_UP_DATA; |
479 | 478 | ||
480 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "dn_link"); | 479 | mcpdm->dma_data[0].filter_data = "dn_link"; |
481 | if (!res) | 480 | mcpdm->dma_data[1].filter_data = "up_link"; |
482 | return -ENODEV; | ||
483 | |||
484 | mcpdm->dma_req[0] = res->start; | ||
485 | mcpdm->dma_data[0].filter_data = &mcpdm->dma_req[0]; | ||
486 | |||
487 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "up_link"); | ||
488 | if (!res) | ||
489 | return -ENODEV; | ||
490 | |||
491 | mcpdm->dma_req[1] = res->start; | ||
492 | mcpdm->dma_data[1].filter_data = &mcpdm->dma_req[1]; | ||
493 | 481 | ||
494 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); | 482 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); |
495 | if (res == NULL) | ||
496 | return -ENOMEM; | ||
497 | |||
498 | mcpdm->io_base = devm_ioremap_resource(&pdev->dev, res); | 483 | mcpdm->io_base = devm_ioremap_resource(&pdev->dev, res); |
499 | if (IS_ERR(mcpdm->io_base)) | 484 | if (IS_ERR(mcpdm->io_base)) |
500 | return PTR_ERR(mcpdm->io_base); | 485 | return PTR_ERR(mcpdm->io_base); |
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index c28e042f2208..a11405de86e8 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -113,14 +113,25 @@ static int omap_pcm_open(struct snd_pcm_substream *substream) | |||
113 | { | 113 | { |
114 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 114 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
115 | struct snd_dmaengine_dai_dma_data *dma_data; | 115 | struct snd_dmaengine_dai_dma_data *dma_data; |
116 | int ret; | ||
116 | 117 | ||
117 | snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware); | 118 | snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware); |
118 | 119 | ||
119 | dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 120 | dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); |
120 | 121 | ||
121 | return snd_dmaengine_pcm_open_request_chan(substream, | 122 | /* DT boot: filter_data is the DMA name */ |
122 | omap_dma_filter_fn, | 123 | if (rtd->cpu_dai->dev->of_node) { |
123 | dma_data->filter_data); | 124 | struct dma_chan *chan; |
125 | |||
126 | chan = dma_request_slave_channel(rtd->cpu_dai->dev, | ||
127 | dma_data->filter_data); | ||
128 | ret = snd_dmaengine_pcm_open(substream, chan); | ||
129 | } else { | ||
130 | ret = snd_dmaengine_pcm_open_request_chan(substream, | ||
131 | omap_dma_filter_fn, | ||
132 | dma_data->filter_data); | ||
133 | } | ||
134 | return ret; | ||
124 | } | 135 | } |
125 | 136 | ||
126 | static int omap_pcm_mmap(struct snd_pcm_substream *substream, | 137 | static int omap_pcm_mmap(struct snd_pcm_substream *substream, |