ARM: pxa: change SSP DMA channels allocation
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sun, 17 Jun 2018 17:02:17 +0000 (19:02 +0200)
committerRobert Jarzmik <robert.jarzmik@free.fr>
Mon, 18 Jun 2018 19:32:41 +0000 (21:32 +0200)
Now the dma_slave_map is available for PXA architecture, switch the SSP
device to it.

This specifically means that :
- for platform data based machines, the DMA requestor channels are
  extracted from the slave map, where pxa-ssp-dai.<N> is a 1-1 match to
  ssp.<N>, and the channels are either "rx" or "tx".

- for device tree platforms, the dma node should be hooked into the
  pxa2xx-ac97 or pxa-ssp-dai node.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Daniel Mack <daniel@zonque.org>
arch/arm/plat-pxa/ssp.c
include/linux/pxa2xx_ssp.h
sound/soc/pxa/pxa-ssp.c

index ba13f793fbce45734b149e861481c0a33f996ac4..ed36dcab80f1e7fb1a89cb41bc05ed71a1afd66f 100644 (file)
@@ -127,53 +127,6 @@ static int pxa_ssp_probe(struct platform_device *pdev)
        if (IS_ERR(ssp->clk))
                return PTR_ERR(ssp->clk);
 
-       if (dev->of_node) {
-               struct of_phandle_args dma_spec;
-               struct device_node *np = dev->of_node;
-               int ret;
-
-               /*
-                * FIXME: we should allocate the DMA channel from this
-                * context and pass the channel down to the ssp users.
-                * For now, we lookup the rx and tx indices manually
-                */
-
-               /* rx */
-               ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
-                                                0, &dma_spec);
-
-               if (ret) {
-                       dev_err(dev, "Can't parse dmas property\n");
-                       return -ENODEV;
-               }
-               ssp->drcmr_rx = dma_spec.args[0];
-               of_node_put(dma_spec.np);
-
-               /* tx */
-               ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
-                                                1, &dma_spec);
-               if (ret) {
-                       dev_err(dev, "Can't parse dmas property\n");
-                       return -ENODEV;
-               }
-               ssp->drcmr_tx = dma_spec.args[0];
-               of_node_put(dma_spec.np);
-       } else {
-               res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-               if (res == NULL) {
-                       dev_err(dev, "no SSP RX DRCMR defined\n");
-                       return -ENODEV;
-               }
-               ssp->drcmr_rx = res->start;
-
-               res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-               if (res == NULL) {
-                       dev_err(dev, "no SSP TX DRCMR defined\n");
-                       return -ENODEV;
-               }
-               ssp->drcmr_tx = res->start;
-       }
-
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (res == NULL) {
                dev_err(dev, "no memory resource defined\n");
index 8461b18e4608f206b8982192e07760aadb739f42..03a7ca46735bb891b6e6daa3faf986e3f6dae66d 100644 (file)
@@ -212,8 +212,6 @@ struct ssp_device {
        int             type;
        int             use_count;
        int             irq;
-       int             drcmr_rx;
-       int             drcmr_tx;
 
        struct device_node      *of_node;
 };
index 6fc9860801309b9fc3427151ccd911dd648505e0..0b441338bdd46dc943df562596d3eb003cd30351 100644 (file)
@@ -105,9 +105,8 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
        dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL);
        if (!dma)
                return -ENOMEM;
-
-       dma->filter_data = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
-                               &ssp->drcmr_tx : &ssp->drcmr_rx;
+       dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
+               "tx" : "rx";
 
        snd_soc_dai_set_dma_data(cpu_dai, substream, dma);