aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-dmic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap-dmic.c')
-rw-r--r--sound/soc/omap/omap-dmic.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index 8ebaf117d81f..a2597fab33a3 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -39,8 +39,8 @@
39#include <sound/pcm_params.h> 39#include <sound/pcm_params.h>
40#include <sound/initval.h> 40#include <sound/initval.h>
41#include <sound/soc.h> 41#include <sound/soc.h>
42#include <sound/dmaengine_pcm.h>
42 43
43#include "omap-pcm.h"
44#include "omap-dmic.h" 44#include "omap-dmic.h"
45 45
46struct omap_dmic { 46struct omap_dmic {
@@ -55,13 +55,9 @@ struct omap_dmic {
55 u32 ch_enabled; 55 u32 ch_enabled;
56 bool active; 56 bool active;
57 struct mutex mutex; 57 struct mutex mutex;
58};
59 58
60/* 59 struct snd_dmaengine_dai_dma_data dma_data;
61 * Stream DMA parameters 60 unsigned int dma_req;
62 */
63static struct omap_pcm_dma_data omap_dmic_dai_dma_params = {
64 .name = "DMIC capture",
65}; 61};
66 62
67static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val) 63static inline void omap_dmic_write(struct omap_dmic *dmic, u16 reg, u32 val)
@@ -118,7 +114,7 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
118 114
119 mutex_unlock(&dmic->mutex); 115 mutex_unlock(&dmic->mutex);
120 116
121 snd_soc_dai_set_dma_data(dai, substream, &omap_dmic_dai_dma_params); 117 snd_soc_dai_set_dma_data(dai, substream, &dmic->dma_data);
122 return ret; 118 return ret;
123} 119}
124 120
@@ -203,7 +199,7 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream,
203 struct snd_soc_dai *dai) 199 struct snd_soc_dai *dai)
204{ 200{
205 struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai); 201 struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
206 struct omap_pcm_dma_data *dma_data; 202 struct snd_dmaengine_dai_dma_data *dma_data;
207 int channels; 203 int channels;
208 204
209 dmic->clk_div = omap_dmic_select_divider(dmic, params_rate(params)); 205 dmic->clk_div = omap_dmic_select_divider(dmic, params_rate(params));
@@ -230,7 +226,7 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream,
230 226
231 /* packet size is threshold * channels */ 227 /* packet size is threshold * channels */
232 dma_data = snd_soc_dai_get_dma_data(dai, substream); 228 dma_data = snd_soc_dai_get_dma_data(dai, substream);
233 dma_data->packet_size = dmic->threshold * channels; 229 dma_data->maxburst = dmic->threshold * channels;
234 230
235 return 0; 231 return 0;
236} 232}
@@ -476,7 +472,7 @@ static int asoc_dmic_probe(struct platform_device *pdev)
476 ret = -ENODEV; 472 ret = -ENODEV;
477 goto err_put_clk; 473 goto err_put_clk;
478 } 474 }
479 omap_dmic_dai_dma_params.port_addr = res->start + OMAP_DMIC_DATA_REG; 475 dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG;
480 476
481 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 477 res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
482 if (!res) { 478 if (!res) {
@@ -484,7 +480,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
484 ret = -ENODEV; 480 ret = -ENODEV;
485 goto err_put_clk; 481 goto err_put_clk;
486 } 482 }
487 omap_dmic_dai_dma_params.dma_req = res->start; 483
484 dmic->dma_req = res->start;
485 dmic->dma_data.filter_data = &dmic->dma_req;
488 486
489 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); 487 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
490 if (!res) { 488 if (!res) {