]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ASoC: pxa: pxa-ssp: set dma filter data from startup hook
authorDaniel Mack <zonque@gmail.com>
Mon, 12 Aug 2013 08:42:40 +0000 (10:42 +0200)
committerMark Brown <broonie@linaro.org>
Thu, 15 Aug 2013 10:29:07 +0000 (11:29 +0100)
With the new dmaengine implementation, the filter_data parameter has
to be set earlier, from pxa_ssp_startup().

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/pxa/pxa-ssp.c

index c0dcc3538e35d8e44cc549b6a157bf224ee589f9..a3119a00d8fac8ef8295ef3593f16a60c2603aab 100644 (file)
@@ -84,7 +84,6 @@ static void pxa_ssp_disable(struct ssp_device *ssp)
 static void pxa_ssp_set_dma_params(struct ssp_device *ssp, int width4,
                        int out, struct snd_dmaengine_dai_dma_data *dma)
 {
-       dma->filter_data = out ? &ssp->drcmr_tx : &ssp->drcmr_rx;
        dma->addr_width = width4 ? DMA_SLAVE_BUSWIDTH_4_BYTES :
                                   DMA_SLAVE_BUSWIDTH_2_BYTES;
        dma->maxburst = 16;
@@ -107,6 +106,10 @@ 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;
+
        snd_soc_dai_set_dma_data(cpu_dai, substream, dma);
 
        return ret;