]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ASoC: fsl: assign dma peripheral type according to bus topology
authorShawn Guo <shawn.guo@linaro.org>
Wed, 28 Mar 2012 07:34:56 +0000 (15:34 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 1 Apr 2012 10:28:29 +0000 (11:28 +0100)
The dma peripheral_type for SSI should be IMX_DMATYPE_SSI_SP if the SSI
is on SPBA bus.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/imx-pcm-dma.c
sound/soc/fsl/imx-pcm.h

index 30ff605144c62c05b29f9325e39e8b1f648c78b8..4f76b5df0ce43bfb33adf6f700df3469b10b6a71 100644 (file)
@@ -746,6 +746,12 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
                }
                ssi_private->dma_params_tx.dma = dma_events[0];
                ssi_private->dma_params_rx.dma = dma_events[1];
+
+               ssi_private->dma_params_tx.shared_peripheral =
+                               of_device_is_compatible(of_get_parent(np),
+                                                       "fsl,spba-bus");
+               ssi_private->dma_params_rx.shared_peripheral =
+                               ssi_private->dma_params_tx.shared_peripheral;
        }
 
        /* Initialize the the device_attribute structure */
index 6b818de2fc03344e6c532067b252655b32c99819..f3c0a5ef35c8afc08a2fb8c48775285985ec421d 100644 (file)
@@ -109,7 +109,8 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
        dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
 
        dma_data = kzalloc(sizeof(*dma_data), GFP_KERNEL);
-       dma_data->peripheral_type = IMX_DMATYPE_SSI;
+       dma_data->peripheral_type = dma_params->shared_peripheral ?
+                                       IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI;
        dma_data->priority = DMA_PRIO_HIGH;
        dma_data->dma_request = dma_params->dma;
 
index b5f5c3acf34d30348342e4ebad2abc4cdf2e214e..83c0ed7d55c9a4710b75846bb0bd5569d257ed0f 100644 (file)
@@ -22,6 +22,7 @@ struct imx_pcm_dma_params {
        int dma;
        unsigned long dma_addr;
        int burstsize;
+       bool shared_peripheral; /* The peripheral is on SPBA bus */
 };
 
 int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,