ASoC: pxa: remove the dmaengine compat need
authorRobert Jarzmik <robert.jarzmik@free.fr>
Thu, 28 Jun 2018 20:08:37 +0000 (22:08 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 29 Jun 2018 11:04:28 +0000 (12:04 +0100)
As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/arm/pxa2xx-ac97.c
sound/arm/pxa2xx-pcm-lib.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c

index 4bc244c40f80b45c223b8f186c7e694030734650..236a63cdaf9f4d9f3bd7a8a08911dd55f6bd8745 100644 (file)
@@ -63,28 +63,18 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
        .reset  = pxa2xx_ac97_legacy_reset,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_out_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 12,
-};
-
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_out = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "pcm_pcm_stereo_out",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_ac97_pcm_out_req,
-};
-
-static struct pxad_param pxa2xx_ac97_pcm_in_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 11,
 };
 
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_in = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "pcm_pcm_stereo_in",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_ac97_pcm_in_req,
 };
 
 static struct snd_pcm *pxa2xx_ac97_pcm;
index e8da3b8ee7213352426023029fcff04e87659d50..dcbe7ecc1835bdd1a37a6f1df5ccd471bf67cab8 100644 (file)
@@ -125,9 +125,9 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
        if (ret < 0)
                return ret;
 
-       return snd_dmaengine_pcm_open_request_chan(substream,
-                                       pxad_filter_fn,
-                                       dma_params->filter_data);
+       return snd_dmaengine_pcm_open(
+               substream, dma_request_slave_channel(rtd->cpu_dai->dev,
+                                                    dma_params->chan_name));
 }
 EXPORT_SYMBOL(__pxa2xx_pcm_open);
 
index 5738a0abcd6a7201d3a4f66567d295b7db1979dc..c52b33802bf241f7c369cc9d0105a6b3db33d86b 100644 (file)
@@ -68,61 +68,39 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
        .reset  = pxa2xx_ac97_cold_reset,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_stereo_in_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 11,
-};
-
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "pcm_pcm_stereo_in",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_ac97_pcm_stereo_in_req,
-};
-
-static struct pxad_param pxa2xx_ac97_pcm_stereo_out_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 12,
 };
 
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
        .addr           = __PREG(PCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "pcm_pcm_stereo_out",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_ac97_pcm_stereo_out_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mono_out_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 10,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
        .addr           = __PREG(MODR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_2_BYTES,
+       .chan_name      = "pcm_aux_mono_out",
        .maxburst       = 16,
-       .filter_data    = &pxa2xx_ac97_pcm_aux_mono_out_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mono_in_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 9,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
        .addr           = __PREG(MODR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_2_BYTES,
+       .chan_name      = "pcm_aux_mono_in",
        .maxburst       = 16,
-       .filter_data    = &pxa2xx_ac97_pcm_aux_mono_in_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mic_mono_req = {
-       .prio = PXAD_PRIO_LOWEST,
-       .drcmr = 8,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
        .addr           = __PREG(MCDR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_2_BYTES,
+       .chan_name      = "pcm_aux_mic_mono",
        .maxburst       = 16,
-       .filter_data    = &pxa2xx_ac97_pcm_aux_mic_mono_req,
 };
 
 static int pxa2xx_ac97_hifi_startup(struct snd_pcm_substream *substream,
index 3fb60baf6eab0f53d8d524b880091e316607552c..e7184de0de042d00843e54aef56aff47f40fec18 100644 (file)
@@ -82,20 +82,18 @@ static struct pxa_i2s_port pxa_i2s;
 static struct clk *clk_i2s;
 static int clk_ena = 0;
 
-static unsigned long pxa2xx_i2s_pcm_stereo_out_req = 3;
 static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_out = {
        .addr           = __PREG(SADR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "tx",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_i2s_pcm_stereo_out_req,
 };
 
-static unsigned long pxa2xx_i2s_pcm_stereo_in_req = 2;
 static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = {
        .addr           = __PREG(SADR),
        .addr_width     = DMA_SLAVE_BUSWIDTH_4_BYTES,
+       .chan_name      = "rx",
        .maxburst       = 32,
-       .filter_data    = &pxa2xx_i2s_pcm_stereo_in_req,
 };
 
 static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,