diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-12-19 10:55:03 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-07 10:37:20 -0500 |
commit | f6c377520c26297cc870173df3cd0acdef08bc1c (patch) | |
tree | 8c53ce0a1d50f4e6bcfd33ceb246c46286e3bd1b /sound | |
parent | 609a3050b8a516d12cf6dc0e8beb5875ededad3d (diff) |
ASoC: ux500_pcm: Expect different saved DMA data when obtaining from DAI store
In preparation for full Device Tree enablement we must differentiate
between the two varying ways DMA data can be held in the DAI store. If
we're booting with Device Tree the provided 'snd_dmaengine_dai_dma_data'
data structure shall be used, whereas in order to avoid breaking legacy
platform data we also need to be able to translate DMA data stored using
the UX500 specific 'ux500_msp_dma_params' method.
Once we move over to solely use Device Tree, we can enforce the use of
'snd_dmaengine_dai_dma_data' and this code can be removed altogether.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/ux500/ux500_pcm.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index 32d457232110..8b53f22edcaf 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c | |||
@@ -108,10 +108,21 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, | |||
108 | struct dma_slave_config *slave_config) | 108 | struct dma_slave_config *slave_config) |
109 | { | 109 | { |
110 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 110 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
111 | struct ux500_msp_dma_params *dma_params; | 111 | struct msp_i2s_platform_data *pdata = rtd->cpu_dai->dev->platform_data; |
112 | struct snd_dmaengine_dai_dma_data *snd_dma_params; | ||
113 | struct ux500_msp_dma_params *ste_dma_params; | ||
114 | dma_addr_t dma_addr; | ||
112 | int ret; | 115 | int ret; |
113 | 116 | ||
114 | dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | 117 | if (pdata) { |
118 | ste_dma_params = | ||
119 | snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | ||
120 | dma_addr = ste_dma_params->tx_rx_addr; | ||
121 | } else { | ||
122 | snd_dma_params = | ||
123 | snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); | ||
124 | dma_addr = snd_dma_params->addr; | ||
125 | } | ||
115 | 126 | ||
116 | ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); | 127 | ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); |
117 | if (ret) | 128 | if (ret) |
@@ -124,9 +135,9 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, | |||
124 | slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; | 135 | slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; |
125 | 136 | ||
126 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | 137 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
127 | slave_config->dst_addr = dma_params->tx_rx_addr; | 138 | slave_config->dst_addr = dma_addr; |
128 | else | 139 | else |
129 | slave_config->src_addr = dma_params->tx_rx_addr; | 140 | slave_config->src_addr = dma_addr; |
130 | 141 | ||
131 | return 0; | 142 | return 0; |
132 | } | 143 | } |