aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/Kconfig2
-rw-r--r--sound/soc/pxa/brownstone.c1
-rw-r--r--sound/soc/pxa/mioa701_wm9713.c7
-rw-r--r--sound/soc/pxa/mmp-pcm.c7
-rw-r--r--sound/soc/pxa/mmp-sspa.c15
-rw-r--r--sound/soc/pxa/pxa-ssp.c76
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c67
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c28
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c21
-rw-r--r--sound/soc/pxa/ttc-dkb.c1
10 files changed, 128 insertions, 97 deletions
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index b35809467547..4db74a083db1 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -11,7 +11,7 @@ config SND_PXA2XX_SOC
11config SND_MMP_SOC 11config SND_MMP_SOC
12 bool "Soc Audio for Marvell MMP chips" 12 bool "Soc Audio for Marvell MMP chips"
13 depends on ARCH_MMP 13 depends on ARCH_MMP
14 select SND_SOC_DMAENGINE_PCM 14 select SND_DMAENGINE_PCM
15 select SND_ARM 15 select SND_ARM
16 help 16 help
17 Say Y if you want to add support for codecs attached to 17 Say Y if you want to add support for codecs attached to
diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 4ad76099dd43..5b7d969f89a9 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -129,6 +129,7 @@ static struct snd_soc_dai_link brownstone_wm8994_dai[] = {
129/* audio machine driver */ 129/* audio machine driver */
130static struct snd_soc_card brownstone = { 130static struct snd_soc_card brownstone = {
131 .name = "brownstone", 131 .name = "brownstone",
132 .owner = THIS_MODULE,
132 .dai_link = brownstone_wm8994_dai, 133 .dai_link = brownstone_wm8994_dai,
133 .num_links = ARRAY_SIZE(brownstone_wm8994_dai), 134 .num_links = ARRAY_SIZE(brownstone_wm8994_dai),
134 135
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c
index 97b711e12821..bbea7780eac6 100644
--- a/sound/soc/pxa/mioa701_wm9713.c
+++ b/sound/soc/pxa/mioa701_wm9713.c
@@ -56,8 +56,6 @@
56#include "pxa2xx-ac97.h" 56#include "pxa2xx-ac97.h"
57#include "../codecs/wm9713.h" 57#include "../codecs/wm9713.h"
58 58
59#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
60
61#define AC97_GPIO_PULL 0x58 59#define AC97_GPIO_PULL 0x58
62 60
63/* Use GPIO8 for rear speaker amplifier */ 61/* Use GPIO8 for rear speaker amplifier */
@@ -133,10 +131,11 @@ static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd)
133 unsigned short reg; 131 unsigned short reg;
134 132
135 /* Add mioa701 specific widgets */ 133 /* Add mioa701 specific widgets */
136 snd_soc_dapm_new_controls(dapm, ARRAY_AND_SIZE(mioa701_dapm_widgets)); 134 snd_soc_dapm_new_controls(dapm, mioa701_dapm_widgets,
135 ARRAY_SIZE(mioa701_dapm_widgets));
137 136
138 /* Set up mioa701 specific audio path audio_mapnects */ 137 /* Set up mioa701 specific audio path audio_mapnects */
139 snd_soc_dapm_add_routes(dapm, ARRAY_AND_SIZE(audio_map)); 138 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
140 139
141 /* Prepare GPIO8 for rear speaker amplifier */ 140 /* Prepare GPIO8 for rear speaker amplifier */
142 reg = codec->driver->read(codec, AC97_GPIO_CFG); 141 reg = codec->driver->read(codec, AC97_GPIO_CFG);
diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c
index 5d57e071cdf5..8235e231d89c 100644
--- a/sound/soc/pxa/mmp-pcm.c
+++ b/sound/soc/pxa/mmp-pcm.c
@@ -17,6 +17,7 @@
17#include <linux/dmaengine.h> 17#include <linux/dmaengine.h>
18#include <linux/platform_data/dma-mmp_tdma.h> 18#include <linux/platform_data/dma-mmp_tdma.h>
19#include <linux/platform_data/mmp_audio.h> 19#include <linux/platform_data/mmp_audio.h>
20
20#include <sound/pxa2xx-lib.h> 21#include <sound/pxa2xx-lib.h>
21#include <sound/core.h> 22#include <sound/core.h>
22#include <sound/pcm.h> 23#include <sound/pcm.h>
@@ -67,7 +68,7 @@ static int mmp_pcm_hw_params(struct snd_pcm_substream *substream,
67{ 68{
68 struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); 69 struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
69 struct snd_soc_pcm_runtime *rtd = substream->private_data; 70 struct snd_soc_pcm_runtime *rtd = substream->private_data;
70 struct pxa2xx_pcm_dma_params *dma_params; 71 struct snd_dmaengine_dai_dma_data *dma_params;
71 struct dma_slave_config slave_config; 72 struct dma_slave_config slave_config;
72 int ret; 73 int ret;
73 74
@@ -80,10 +81,10 @@ static int mmp_pcm_hw_params(struct snd_pcm_substream *substream,
80 return ret; 81 return ret;
81 82
82 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 83 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
83 slave_config.dst_addr = dma_params->dev_addr; 84 slave_config.dst_addr = dma_params->addr;
84 slave_config.dst_maxburst = 4; 85 slave_config.dst_maxburst = 4;
85 } else { 86 } else {
86 slave_config.src_addr = dma_params->dev_addr; 87 slave_config.src_addr = dma_params->addr;
87 slave_config.src_maxburst = 4; 88 slave_config.src_maxburst = 4;
88 } 89 }
89 90
diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index 62142ce367c7..41752a5fe3b0 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -27,12 +27,15 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/pxa2xx_ssp.h> 28#include <linux/pxa2xx_ssp.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/dmaengine.h>
31
30#include <sound/core.h> 32#include <sound/core.h>
31#include <sound/pcm.h> 33#include <sound/pcm.h>
32#include <sound/initval.h> 34#include <sound/initval.h>
33#include <sound/pcm_params.h> 35#include <sound/pcm_params.h>
34#include <sound/soc.h> 36#include <sound/soc.h>
35#include <sound/pxa2xx-lib.h> 37#include <sound/pxa2xx-lib.h>
38#include <sound/dmaengine_pcm.h>
36#include "mmp-sspa.h" 39#include "mmp-sspa.h"
37 40
38/* 41/*
@@ -40,7 +43,7 @@
40 */ 43 */
41struct sspa_priv { 44struct sspa_priv {
42 struct ssp_device *sspa; 45 struct ssp_device *sspa;
43 struct pxa2xx_pcm_dma_params *dma_params; 46 struct snd_dmaengine_dai_dma_data *dma_params;
44 struct clk *audio_clk; 47 struct clk *audio_clk;
45 struct clk *sysclk; 48 struct clk *sysclk;
46 int dai_fmt; 49 int dai_fmt;
@@ -266,7 +269,7 @@ static int mmp_sspa_hw_params(struct snd_pcm_substream *substream,
266 struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 269 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
267 struct sspa_priv *sspa_priv = snd_soc_dai_get_drvdata(dai); 270 struct sspa_priv *sspa_priv = snd_soc_dai_get_drvdata(dai);
268 struct ssp_device *sspa = sspa_priv->sspa; 271 struct ssp_device *sspa = sspa_priv->sspa;
269 struct pxa2xx_pcm_dma_params *dma_params; 272 struct snd_dmaengine_dai_dma_data *dma_params;
270 u32 sspa_ctrl; 273 u32 sspa_ctrl;
271 274
272 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 275 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -309,7 +312,7 @@ static int mmp_sspa_hw_params(struct snd_pcm_substream *substream,
309 } 312 }
310 313
311 dma_params = &sspa_priv->dma_params[substream->stream]; 314 dma_params = &sspa_priv->dma_params[substream->stream];
312 dma_params->dev_addr = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 315 dma_params->addr = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
313 (sspa->phys_base + SSPA_TXD) : 316 (sspa->phys_base + SSPA_TXD) :
314 (sspa->phys_base + SSPA_RXD); 317 (sspa->phys_base + SSPA_RXD);
315 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_params); 318 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_params);
@@ -425,14 +428,12 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
425 return -ENOMEM; 428 return -ENOMEM;
426 429
427 priv->dma_params = devm_kzalloc(&pdev->dev, 430 priv->dma_params = devm_kzalloc(&pdev->dev,
428 2 * sizeof(struct pxa2xx_pcm_dma_params), GFP_KERNEL); 431 2 * sizeof(struct snd_dmaengine_dai_dma_data),
432 GFP_KERNEL);
429 if (priv->dma_params == NULL) 433 if (priv->dma_params == NULL)
430 return -ENOMEM; 434 return -ENOMEM;
431 435
432 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 436 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
433 if (res == NULL)
434 return -ENOMEM;
435
436 priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res); 437 priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res);
437 if (IS_ERR(priv->sspa->mmio_base)) 438 if (IS_ERR(priv->sspa->mmio_base))
438 return PTR_ERR(priv->sspa->mmio_base); 439 return PTR_ERR(priv->sspa->mmio_base);
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 6f4dd7543e82..a3119a00d8fa 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -21,6 +21,8 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/pxa2xx_ssp.h> 23#include <linux/pxa2xx_ssp.h>
24#include <linux/of.h>
25#include <linux/dmaengine.h>
24 26
25#include <asm/irq.h> 27#include <asm/irq.h>
26 28
@@ -30,9 +32,9 @@
30#include <sound/pcm_params.h> 32#include <sound/pcm_params.h>
31#include <sound/soc.h> 33#include <sound/soc.h>
32#include <sound/pxa2xx-lib.h> 34#include <sound/pxa2xx-lib.h>
35#include <sound/dmaengine_pcm.h>
33 36
34#include <mach/hardware.h> 37#include <mach/hardware.h>
35#include <mach/dma.h>
36 38
37#include "../../arm/pxa2xx-pcm.h" 39#include "../../arm/pxa2xx-pcm.h"
38#include "pxa-ssp.h" 40#include "pxa-ssp.h"
@@ -79,27 +81,13 @@ static void pxa_ssp_disable(struct ssp_device *ssp)
79 __raw_writel(sscr0, ssp->mmio_base + SSCR0); 81 __raw_writel(sscr0, ssp->mmio_base + SSCR0);
80} 82}
81 83
82struct pxa2xx_pcm_dma_data {
83 struct pxa2xx_pcm_dma_params params;
84 char name[20];
85};
86
87static void pxa_ssp_set_dma_params(struct ssp_device *ssp, int width4, 84static void pxa_ssp_set_dma_params(struct ssp_device *ssp, int width4,
88 int out, struct pxa2xx_pcm_dma_params *dma_data) 85 int out, struct snd_dmaengine_dai_dma_data *dma)
89{ 86{
90 struct pxa2xx_pcm_dma_data *dma; 87 dma->addr_width = width4 ? DMA_SLAVE_BUSWIDTH_4_BYTES :
91 88 DMA_SLAVE_BUSWIDTH_2_BYTES;
92 dma = container_of(dma_data, struct pxa2xx_pcm_dma_data, params); 89 dma->maxburst = 16;
93 90 dma->addr = ssp->phys_base + SSDR;
94 snprintf(dma->name, 20, "SSP%d PCM %s %s", ssp->port_id,
95 width4 ? "32-bit" : "16-bit", out ? "out" : "in");
96
97 dma->params.name = dma->name;
98 dma->params.drcmr = &DRCMR(out ? ssp->drcmr_tx : ssp->drcmr_rx);
99 dma->params.dcmd = (out ? (DCMD_INCSRCADDR | DCMD_FLOWTRG) :
100 (DCMD_INCTRGADDR | DCMD_FLOWSRC)) |
101 (width4 ? DCMD_WIDTH4 : DCMD_WIDTH2) | DCMD_BURST16;
102 dma->params.dev_addr = ssp->phys_base + SSDR;
103} 91}
104 92
105static int pxa_ssp_startup(struct snd_pcm_substream *substream, 93static int pxa_ssp_startup(struct snd_pcm_substream *substream,
@@ -107,7 +95,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
107{ 95{
108 struct ssp_priv *priv = snd_soc_dai_get_drvdata(cpu_dai); 96 struct ssp_priv *priv = snd_soc_dai_get_drvdata(cpu_dai);
109 struct ssp_device *ssp = priv->ssp; 97 struct ssp_device *ssp = priv->ssp;
110 struct pxa2xx_pcm_dma_data *dma; 98 struct snd_dmaengine_dai_dma_data *dma;
111 int ret = 0; 99 int ret = 0;
112 100
113 if (!cpu_dai->active) { 101 if (!cpu_dai->active) {
@@ -115,10 +103,14 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
115 pxa_ssp_disable(ssp); 103 pxa_ssp_disable(ssp);
116 } 104 }
117 105
118 dma = kzalloc(sizeof(struct pxa2xx_pcm_dma_data), GFP_KERNEL); 106 dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL);
119 if (!dma) 107 if (!dma)
120 return -ENOMEM; 108 return -ENOMEM;
121 snd_soc_dai_set_dma_data(cpu_dai, substream, &dma->params); 109
110 dma->filter_data = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
111 &ssp->drcmr_tx : &ssp->drcmr_rx;
112
113 snd_soc_dai_set_dma_data(cpu_dai, substream, dma);
122 114
123 return ret; 115 return ret;
124} 116}
@@ -559,7 +551,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
559 u32 sspsp; 551 u32 sspsp;
560 int width = snd_pcm_format_physical_width(params_format(params)); 552 int width = snd_pcm_format_physical_width(params_format(params));
561 int ttsa = pxa_ssp_read_reg(ssp, SSTSA) & 0xf; 553 int ttsa = pxa_ssp_read_reg(ssp, SSTSA) & 0xf;
562 struct pxa2xx_pcm_dma_params *dma_data; 554 struct snd_dmaengine_dai_dma_data *dma_data;
563 555
564 dma_data = snd_soc_dai_get_dma_data(cpu_dai, substream); 556 dma_data = snd_soc_dai_get_dma_data(cpu_dai, substream);
565 557
@@ -719,6 +711,7 @@ static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
719 711
720static int pxa_ssp_probe(struct snd_soc_dai *dai) 712static int pxa_ssp_probe(struct snd_soc_dai *dai)
721{ 713{
714 struct device *dev = dai->dev;
722 struct ssp_priv *priv; 715 struct ssp_priv *priv;
723 int ret; 716 int ret;
724 717
@@ -726,10 +719,26 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai)
726 if (!priv) 719 if (!priv)
727 return -ENOMEM; 720 return -ENOMEM;
728 721
729 priv->ssp = pxa_ssp_request(dai->id + 1, "SoC audio"); 722 if (dev->of_node) {
730 if (priv->ssp == NULL) { 723 struct device_node *ssp_handle;
731 ret = -ENODEV; 724
732 goto err_priv; 725 ssp_handle = of_parse_phandle(dev->of_node, "port", 0);
726 if (!ssp_handle) {
727 dev_err(dev, "unable to get 'port' phandle\n");
728 return -ENODEV;
729 }
730
731 priv->ssp = pxa_ssp_request_of(ssp_handle, "SoC audio");
732 if (priv->ssp == NULL) {
733 ret = -ENODEV;
734 goto err_priv;
735 }
736 } else {
737 priv->ssp = pxa_ssp_request(dai->id + 1, "SoC audio");
738 if (priv->ssp == NULL) {
739 ret = -ENODEV;
740 goto err_priv;
741 }
733 } 742 }
734 743
735 priv->dai_fmt = (unsigned int) -1; 744 priv->dai_fmt = (unsigned int) -1;
@@ -798,6 +807,12 @@ static const struct snd_soc_component_driver pxa_ssp_component = {
798 .name = "pxa-ssp", 807 .name = "pxa-ssp",
799}; 808};
800 809
810#ifdef CONFIG_OF
811static const struct of_device_id pxa_ssp_of_ids[] = {
812 { .compatible = "mrvl,pxa-ssp-dai" },
813};
814#endif
815
801static int asoc_ssp_probe(struct platform_device *pdev) 816static int asoc_ssp_probe(struct platform_device *pdev)
802{ 817{
803 return snd_soc_register_component(&pdev->dev, &pxa_ssp_component, 818 return snd_soc_register_component(&pdev->dev, &pxa_ssp_component,
@@ -812,8 +827,9 @@ static int asoc_ssp_remove(struct platform_device *pdev)
812 827
813static struct platform_driver asoc_ssp_driver = { 828static struct platform_driver asoc_ssp_driver = {
814 .driver = { 829 .driver = {
815 .name = "pxa-ssp-dai", 830 .name = "pxa-ssp-dai",
816 .owner = THIS_MODULE, 831 .owner = THIS_MODULE,
832 .of_match_table = of_match_ptr(pxa_ssp_of_ids),
817 }, 833 },
818 834
819 .probe = asoc_ssp_probe, 835 .probe = asoc_ssp_probe,
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 1475515712e6..f1059d999de6 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -14,15 +14,16 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/dmaengine.h>
17 18
18#include <sound/core.h> 19#include <sound/core.h>
19#include <sound/ac97_codec.h> 20#include <sound/ac97_codec.h>
20#include <sound/soc.h> 21#include <sound/soc.h>
21#include <sound/pxa2xx-lib.h> 22#include <sound/pxa2xx-lib.h>
23#include <sound/dmaengine_pcm.h>
22 24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24#include <mach/regs-ac97.h> 26#include <mach/regs-ac97.h>
25#include <mach/dma.h>
26#include <mach/audio.h> 27#include <mach/audio.h>
27 28
28#include "pxa2xx-ac97.h" 29#include "pxa2xx-ac97.h"
@@ -48,44 +49,44 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
48 .reset = pxa2xx_ac97_cold_reset, 49 .reset = pxa2xx_ac97_cold_reset,
49}; 50};
50 51
51static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { 52static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12;
52 .name = "AC97 PCM Stereo out", 53static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
53 .dev_addr = __PREG(PCDR), 54 .addr = __PREG(PCDR),
54 .drcmr = &DRCMR(12), 55 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
55 .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | 56 .maxburst = 32,
56 DCMD_BURST32 | DCMD_WIDTH4, 57 .filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
57}; 58};
58 59
59static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_in = { 60static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11;
60 .name = "AC97 PCM Stereo in", 61static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
61 .dev_addr = __PREG(PCDR), 62 .addr = __PREG(PCDR),
62 .drcmr = &DRCMR(11), 63 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
63 .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | 64 .maxburst = 32,
64 DCMD_BURST32 | DCMD_WIDTH4, 65 .filter_data = &pxa2xx_ac97_pcm_stereo_out_req,
65}; 66};
66 67
67static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_out = { 68static unsigned long pxa2xx_ac97_pcm_aux_mono_out_req = 10;
68 .name = "AC97 Aux PCM (Slot 5) Mono out", 69static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
69 .dev_addr = __PREG(MODR), 70 .addr = __PREG(MODR),
70 .drcmr = &DRCMR(10), 71 .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
71 .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | 72 .maxburst = 16,
72 DCMD_BURST16 | DCMD_WIDTH2, 73 .filter_data = &pxa2xx_ac97_pcm_aux_mono_out_req,
73}; 74};
74 75
75static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_aux_mono_in = { 76static unsigned long pxa2xx_ac97_pcm_aux_mono_in_req = 9;
76 .name = "AC97 Aux PCM (Slot 5) Mono in", 77static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
77 .dev_addr = __PREG(MODR), 78 .addr = __PREG(MODR),
78 .drcmr = &DRCMR(9), 79 .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
79 .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | 80 .maxburst = 16,
80 DCMD_BURST16 | DCMD_WIDTH2, 81 .filter_data = &pxa2xx_ac97_pcm_aux_mono_in_req,
81}; 82};
82 83
83static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = { 84static unsigned long pxa2xx_ac97_pcm_aux_mic_mono_req = 8;
84 .name = "AC97 Mic PCM (Slot 6) Mono in", 85static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
85 .dev_addr = __PREG(MCDR), 86 .addr = __PREG(MCDR),
86 .drcmr = &DRCMR(8), 87 .addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
87 .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | 88 .maxburst = 16,
88 DCMD_BURST16 | DCMD_WIDTH2, 89 .filter_data = &pxa2xx_ac97_pcm_aux_mic_mono_req,
89}; 90};
90 91
91#ifdef CONFIG_PM 92#ifdef CONFIG_PM
@@ -119,7 +120,7 @@ static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
119 struct snd_pcm_hw_params *params, 120 struct snd_pcm_hw_params *params,
120 struct snd_soc_dai *cpu_dai) 121 struct snd_soc_dai *cpu_dai)
121{ 122{
122 struct pxa2xx_pcm_dma_params *dma_data; 123 struct snd_dmaengine_dai_dma_data *dma_data;
123 124
124 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 125 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
125 dma_data = &pxa2xx_ac97_pcm_stereo_out; 126 dma_data = &pxa2xx_ac97_pcm_stereo_out;
@@ -135,7 +136,7 @@ static int pxa2xx_ac97_hw_aux_params(struct snd_pcm_substream *substream,
135 struct snd_pcm_hw_params *params, 136 struct snd_pcm_hw_params *params,
136 struct snd_soc_dai *cpu_dai) 137 struct snd_soc_dai *cpu_dai)
137{ 138{
138 struct pxa2xx_pcm_dma_params *dma_data; 139 struct snd_dmaengine_dai_dma_data *dma_data;
139 140
140 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 141 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
141 dma_data = &pxa2xx_ac97_pcm_aux_mono_out; 142 dma_data = &pxa2xx_ac97_pcm_aux_mono_out;
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index f7ca71664112..d5340a088858 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -23,9 +23,9 @@
23#include <sound/initval.h> 23#include <sound/initval.h>
24#include <sound/soc.h> 24#include <sound/soc.h>
25#include <sound/pxa2xx-lib.h> 25#include <sound/pxa2xx-lib.h>
26#include <sound/dmaengine_pcm.h>
26 27
27#include <mach/hardware.h> 28#include <mach/hardware.h>
28#include <mach/dma.h>
29#include <mach/audio.h> 29#include <mach/audio.h>
30 30
31#include "pxa2xx-i2s.h" 31#include "pxa2xx-i2s.h"
@@ -82,20 +82,20 @@ static struct pxa_i2s_port pxa_i2s;
82static struct clk *clk_i2s; 82static struct clk *clk_i2s;
83static int clk_ena = 0; 83static int clk_ena = 0;
84 84
85static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_out = { 85static unsigned long pxa2xx_i2s_pcm_stereo_out_req = 3;
86 .name = "I2S PCM Stereo out", 86static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_out = {
87 .dev_addr = __PREG(SADR), 87 .addr = __PREG(SADR),
88 .drcmr = &DRCMR(3), 88 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
89 .dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG | 89 .maxburst = 32,
90 DCMD_BURST32 | DCMD_WIDTH4, 90 .filter_data = &pxa2xx_i2s_pcm_stereo_out_req,
91}; 91};
92 92
93static struct pxa2xx_pcm_dma_params pxa2xx_i2s_pcm_stereo_in = { 93static unsigned long pxa2xx_i2s_pcm_stereo_in_req = 2;
94 .name = "I2S PCM Stereo in", 94static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = {
95 .dev_addr = __PREG(SADR), 95 .addr = __PREG(SADR),
96 .drcmr = &DRCMR(2), 96 .addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
97 .dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC | 97 .maxburst = 32,
98 DCMD_BURST32 | DCMD_WIDTH4, 98 .filter_data = &pxa2xx_i2s_pcm_stereo_in_req,
99}; 99};
100 100
101static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream, 101static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,
@@ -163,7 +163,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
163 struct snd_pcm_hw_params *params, 163 struct snd_pcm_hw_params *params,
164 struct snd_soc_dai *dai) 164 struct snd_soc_dai *dai)
165{ 165{
166 struct pxa2xx_pcm_dma_params *dma_data; 166 struct snd_dmaengine_dai_dma_data *dma_data;
167 167
168 BUG_ON(IS_ERR(clk_i2s)); 168 BUG_ON(IS_ERR(clk_i2s));
169 clk_prepare_enable(clk_i2s); 169 clk_prepare_enable(clk_i2s);
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index ecff116cb7b0..806da27b8b67 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -12,10 +12,13 @@
12 12
13#include <linux/dma-mapping.h> 13#include <linux/dma-mapping.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/dmaengine.h>
16#include <linux/of.h>
15 17
16#include <sound/core.h> 18#include <sound/core.h>
17#include <sound/soc.h> 19#include <sound/soc.h>
18#include <sound/pxa2xx-lib.h> 20#include <sound/pxa2xx-lib.h>
21#include <sound/dmaengine_pcm.h>
19 22
20#include "../../arm/pxa2xx-pcm.h" 23#include "../../arm/pxa2xx-pcm.h"
21 24
@@ -25,7 +28,7 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
25 struct snd_pcm_runtime *runtime = substream->runtime; 28 struct snd_pcm_runtime *runtime = substream->runtime;
26 struct pxa2xx_runtime_data *prtd = runtime->private_data; 29 struct pxa2xx_runtime_data *prtd = runtime->private_data;
27 struct snd_soc_pcm_runtime *rtd = substream->private_data; 30 struct snd_soc_pcm_runtime *rtd = substream->private_data;
28 struct pxa2xx_pcm_dma_params *dma; 31 struct snd_dmaengine_dai_dma_data *dma;
29 int ret; 32 int ret;
30 33
31 dma = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 34 dma = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
@@ -39,7 +42,7 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
39 * with different params */ 42 * with different params */
40 if (prtd->params == NULL) { 43 if (prtd->params == NULL) {
41 prtd->params = dma; 44 prtd->params = dma;
42 ret = pxa_request_dma(prtd->params->name, DMA_PRIO_LOW, 45 ret = pxa_request_dma("name", DMA_PRIO_LOW,
43 pxa2xx_pcm_dma_irq, substream); 46 pxa2xx_pcm_dma_irq, substream);
44 if (ret < 0) 47 if (ret < 0)
45 return ret; 48 return ret;
@@ -47,7 +50,7 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
47 } else if (prtd->params != dma) { 50 } else if (prtd->params != dma) {
48 pxa_free_dma(prtd->dma_ch); 51 pxa_free_dma(prtd->dma_ch);
49 prtd->params = dma; 52 prtd->params = dma;
50 ret = pxa_request_dma(prtd->params->name, DMA_PRIO_LOW, 53 ret = pxa_request_dma("name", DMA_PRIO_LOW,
51 pxa2xx_pcm_dma_irq, substream); 54 pxa2xx_pcm_dma_irq, substream);
52 if (ret < 0) 55 if (ret < 0)
53 return ret; 56 return ret;
@@ -131,10 +134,18 @@ static int pxa2xx_soc_platform_remove(struct platform_device *pdev)
131 return 0; 134 return 0;
132} 135}
133 136
137#ifdef CONFIG_OF
138static const struct of_device_id snd_soc_pxa_audio_match[] = {
139 { .compatible = "mrvl,pxa-pcm-audio" },
140 { }
141};
142#endif
143
134static struct platform_driver pxa_pcm_driver = { 144static struct platform_driver pxa_pcm_driver = {
135 .driver = { 145 .driver = {
136 .name = "pxa-pcm-audio", 146 .name = "pxa-pcm-audio",
137 .owner = THIS_MODULE, 147 .owner = THIS_MODULE,
148 .of_match_table = of_match_ptr(snd_soc_pxa_audio_match),
138 }, 149 },
139 150
140 .probe = pxa2xx_soc_platform_probe, 151 .probe = pxa2xx_soc_platform_probe,
diff --git a/sound/soc/pxa/ttc-dkb.c b/sound/soc/pxa/ttc-dkb.c
index f4ea4f6663a2..13c9ee0cb83b 100644
--- a/sound/soc/pxa/ttc-dkb.c
+++ b/sound/soc/pxa/ttc-dkb.c
@@ -122,6 +122,7 @@ static struct snd_soc_dai_link ttc_pm860x_hifi_dai[] = {
122/* ttc/td audio machine driver */ 122/* ttc/td audio machine driver */
123static struct snd_soc_card ttc_dkb_card = { 123static struct snd_soc_card ttc_dkb_card = {
124 .name = "ttc-dkb-hifi", 124 .name = "ttc-dkb-hifi",
125 .owner = THIS_MODULE,
125 .dai_link = ttc_pm860x_hifi_dai, 126 .dai_link = ttc_pm860x_hifi_dai,
126 .num_links = ARRAY_SIZE(ttc_pm860x_hifi_dai), 127 .num_links = ARRAY_SIZE(ttc_pm860x_hifi_dai),
127 128