aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2013-07-11 08:35:46 -0400
committerMark Brown <broonie@linaro.org>2013-07-11 12:38:03 -0400
commit9ab1fac4829b3da0ba4d3f44d95d3e8ad13e6629 (patch)
tree43600b1923025bddb9134694c501c1a8caf587d9 /sound/soc
parent2ebef44789223389708505e33c67d44e9f999d4a (diff)
ASoC: omap-mcbsp: Use different method for DMA request when booted with DT
The DMA resource no longer available via this API when booting with DT. When the board is booted with DT do not use platform_get_resource_byname(), instead set the dma_data.filter_data to the name of the DMA channel and omap-pcm can use this name to request the DMA channel. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/mcbsp.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index eb68c7db1cf3..361e4c03646e 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);