From: Mark Brown broonie@linaro.org
Currently the imx DMA code is one of the few users relying on the fact that the compat code uses the dma_data as the filter data for non-DT channel requests. Since the rest of the core expects this to be a struct snd_dmaengine_dai_data this isn't terribly helpful this will be changed to use the already existing filter data so avoid breaking imx by open coding the current behaviour.
Signed-off-by: Mark Brown broonie@linaro.org --- sound/soc/fsl/imx-pcm-dma.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index 4dc1296..318f1fc 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c @@ -35,6 +35,17 @@ static bool filter(struct dma_chan *chan, void *param) return true; }
+static struct dma_chan *imx_compat_request_channel( + struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_substream *substream) +{ + struct snd_dmaengine_dai_dma_data *dma_data; + + dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); + + return snd_dmaengine_pcm_request_channel(filter, dma_data); +} + static const struct snd_pcm_hardware imx_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -58,6 +69,7 @@ static const struct snd_dmaengine_pcm_config imx_dmaengine_pcm_config = { .pcm_hardware = &imx_pcm_hardware, .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, .compat_filter_fn = filter, + .compat_request_channel = imx_compat_request_channel, .prealloc_buffer_size = IMX_SSI_DMABUF_SIZE, };
On 10/19/2013 10:02 PM, Mark Brown wrote:
From: Mark Brown broonie@linaro.org
Currently the imx DMA code is one of the few users relying on the fact that the compat code uses the dma_data as the filter data for non-DT channel requests. Since the rest of the core expects this to be a struct snd_dmaengine_dai_data this isn't terribly helpful this will be changed to use the already existing filter data so avoid breaking imx by open coding the current behaviour.
Signed-off-by: Mark Brown broonie@linaro.org
Since the driver is already using the generic struct adding this to the other patch makes more sense to me:
--- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c @@ -25,12 +25,10 @@
static bool filter(struct dma_chan *chan, void *param) { - struct snd_dmaengine_dai_dma_data *dma_data = param; - if (!imx_dma_is_general_purpose(chan)) return false;
- chan->private = dma_data->filter_data; + chan->private = param;
return true; }
On Sat, Oct 19, 2013 at 10:27:51PM +0200, Lars-Peter Clausen wrote:
Since the driver is already using the generic struct adding this to the other patch makes more sense to me:
You're quite right, to be honest I didn't even look at what the data was - I was just doing a mechanical conversion to let me get on with the Samsung driver.
linaro-kernel@lists.linaro.org