aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-15 06:13:53 -0400
committerMark Brown <broonie@linaro.org>2013-07-15 06:13:53 -0400
commit39c36ad00ba59eafa8115c797ace4f3dc7fdf7b0 (patch)
treedffcc4adbf21514f43f1ace39ea8a8e6735903d5 /sound/soc
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
parent9ab1fac4829b3da0ba4d3f44d95d3e8ad13e6629 (diff)
Merge remote-tracking branch 'asoc/fix/omap' into asoc-linus
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/mcbsp.c39
-rw-r--r--sound/soc/omap/omap-dmic.c11
-rw-r--r--sound/soc/omap/omap-mcpdm.c16
-rw-r--r--sound/soc/omap/omap-pcm.c17
4 files changed, 39 insertions, 44 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);
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index 2ad0370146fd..4db1f8e6e172 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
63static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val) 62static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val)
@@ -478,15 +477,7 @@ 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 if (!res) {
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index eb05c7ed6d05..a49dc52f8abc 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,19 +476,8 @@ 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) 483 if (res == NULL)
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
126static int omap_pcm_mmap(struct snd_pcm_substream *substream, 137static int omap_pcm_mmap(struct snd_pcm_substream *substream,