summaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500/ux500_pcm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-04 18:30:01 +0100
committerMark Brown <broonie@linaro.org>2013-07-04 18:30:01 +0100
commit986a622df307644af14618bee54c901aa74816da (patch)
tree6da87812b9120634381e3e3987e115f90bd562e0 /sound/soc/ux500/ux500_pcm.c
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376 (diff)
parent28e5ca73ef9072ed58dbb81cfff6f908be8e3cd4 (diff)
downloadblackbird-op-linux-986a622df307644af14618bee54c901aa74816da.tar.gz
blackbird-op-linux-986a622df307644af14618bee54c901aa74816da.zip
Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linus
Diffstat (limited to 'sound/soc/ux500/ux500_pcm.c')
-rw-r--r--sound/soc/ux500/ux500_pcm.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index b6e5ae277299..5f01c19776bf 100644
--- a/sound/soc/ux500/ux500_pcm.c
+++ b/sound/soc/ux500/ux500_pcm.c
@@ -103,10 +103,40 @@ static struct dma_chan *ux500_pcm_request_chan(struct snd_soc_pcm_runtime *rtd,
return snd_dmaengine_pcm_request_channel(stedma40_filter, dma_cfg);
}
+static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params,
+ struct dma_slave_config *slave_config)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct ux500_msp_dma_params *dma_params;
+ struct stedma40_chan_cfg *dma_cfg;
+ int ret;
+
+ dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
+ dma_cfg = dma_params->dma_cfg;
+
+ ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config);
+ if (ret)
+ return ret;
+
+ slave_config->dst_maxburst = 4;
+ slave_config->dst_addr_width = dma_cfg->dst_info.data_width;
+ slave_config->src_maxburst = 4;
+ slave_config->src_addr_width = dma_cfg->src_info.data_width;
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ slave_config->dst_addr = dma_params->tx_rx_addr;
+ else
+ slave_config->src_addr = dma_params->tx_rx_addr;
+
+ return 0;
+}
+
static const struct snd_dmaengine_pcm_config ux500_dmaengine_pcm_config = {
.pcm_hardware = &ux500_pcm_hw,
.compat_request_channel = ux500_pcm_request_chan,
.prealloc_buffer_size = 128 * 1024,
+ .prepare_slave_config = ux500_pcm_prepare_slave_config,
};
int ux500_pcm_register_platform(struct platform_device *pdev)
OpenPOWER on IntegriCloud