aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/spear/spdif_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/spear/spdif_out.c')
-rw-r--r--sound/soc/spear/spdif_out.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index b6ef6f78dc78..fe99f461aff0 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -18,10 +18,12 @@
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <sound/dmaengine_pcm.h>
21#include <sound/soc.h> 22#include <sound/soc.h>
22#include <sound/spear_dma.h> 23#include <sound/spear_dma.h>
23#include <sound/spear_spdif.h> 24#include <sound/spear_spdif.h>
24#include "spdif_out_regs.h" 25#include "spdif_out_regs.h"
26#include "spear_pcm.h"
25 27
26struct spdif_out_params { 28struct spdif_out_params {
27 u32 rate; 29 u32 rate;
@@ -35,6 +37,8 @@ struct spdif_out_dev {
35 struct spdif_out_params saved_params; 37 struct spdif_out_params saved_params;
36 u32 running; 38 u32 running;
37 void __iomem *io_base; 39 void __iomem *io_base;
40 struct snd_dmaengine_dai_dma_data dma_params_tx;
41 struct snd_dmaengine_pcm_config config;
38}; 42};
39 43
40static void spdif_out_configure(struct spdif_out_dev *host) 44static void spdif_out_configure(struct spdif_out_dev *host)
@@ -244,7 +248,8 @@ static int spdif_soc_dai_probe(struct snd_soc_dai *dai)
244{ 248{
245 struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); 249 struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai);
246 250
247 dai->playback_dma_data = &host->dma_params; 251 host->dma_params_tx.filter_data = &host->dma_params;
252 dai->playback_dma_data = &host->dma_params_tx;
248 253
249 return snd_soc_add_dai_controls(dai, spdif_out_controls, 254 return snd_soc_add_dai_controls(dai, spdif_out_controls,
250 ARRAY_SIZE(spdif_out_controls)); 255 ARRAY_SIZE(spdif_out_controls));
@@ -280,6 +285,7 @@ static int spdif_out_probe(struct platform_device *pdev)
280 struct spdif_out_dev *host; 285 struct spdif_out_dev *host;
281 struct spear_spdif_platform_data *pdata; 286 struct spear_spdif_platform_data *pdata;
282 struct resource *res; 287 struct resource *res;
288 int ret;
283 289
284 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); 290 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
285 if (!host) { 291 if (!host) {
@@ -302,12 +308,16 @@ static int spdif_out_probe(struct platform_device *pdev)
302 host->dma_params.addr = res->start + SPDIF_OUT_FIFO_DATA; 308 host->dma_params.addr = res->start + SPDIF_OUT_FIFO_DATA;
303 host->dma_params.max_burst = 16; 309 host->dma_params.max_burst = 16;
304 host->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 310 host->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
305 host->dma_params.filter = pdata->filter;
306 311
307 dev_set_drvdata(&pdev->dev, host); 312 dev_set_drvdata(&pdev->dev, host);
308 313
309 return devm_snd_soc_register_component(&pdev->dev, &spdif_out_component, 314 ret = devm_snd_soc_register_component(&pdev->dev, &spdif_out_component,
310 &spdif_out_dai, 1); 315 &spdif_out_dai, 1);
316 if (ret)
317 return ret;
318
319 return devm_spear_pcm_platform_register(&pdev->dev, &host->config,
320 pdata->filter);
311} 321}
312 322
313#ifdef CONFIG_PM 323#ifdef CONFIG_PM