aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2014-03-14 10:42:46 -0400
committerMark Brown <broonie@linaro.org>2014-03-17 12:21:36 -0400
commit8de131f2e6de83f23059527fc4732c1efe27f93d (patch)
tree5289b1dae89ef167bb811e468109d32db666fa46 /sound/soc/davinci
parent58726f58a6432495bd71d1fc7c9454cbc85f5a5c (diff)
ASoC: davinci-mcasp: Provide correct filter_data for dmaengine for non-DT boot
When we boot with non-DT mode the damengine will need the channel number and a filter function in order to get the channel. The filter_data is filled in the DAI driver while the filter_function will be provided by the edma-pcm driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index b0ae0677f023..a01ae97c90aa 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1026,6 +1026,7 @@ nodata:
1026static int davinci_mcasp_probe(struct platform_device *pdev) 1026static int davinci_mcasp_probe(struct platform_device *pdev)
1027{ 1027{
1028 struct davinci_pcm_dma_params *dma_params; 1028 struct davinci_pcm_dma_params *dma_params;
1029 struct snd_dmaengine_dai_dma_data *dma_data;
1029 struct resource *mem, *ioarea, *res, *dat; 1030 struct resource *mem, *ioarea, *res, *dat;
1030 struct davinci_mcasp_pdata *pdata; 1031 struct davinci_mcasp_pdata *pdata;
1031 struct davinci_mcasp *mcasp; 1032 struct davinci_mcasp *mcasp;
@@ -1095,6 +1096,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1095 mcasp->dat_port = true; 1096 mcasp->dat_port = true;
1096 1097
1097 dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_PLAYBACK]; 1098 dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_PLAYBACK];
1099 dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
1098 dma_params->asp_chan_q = pdata->asp_chan_q; 1100 dma_params->asp_chan_q = pdata->asp_chan_q;
1099 dma_params->ram_chan_q = pdata->ram_chan_q; 1101 dma_params->ram_chan_q = pdata->ram_chan_q;
1100 dma_params->sram_pool = pdata->sram_pool; 1102 dma_params->sram_pool = pdata->sram_pool;
@@ -1105,7 +1107,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1105 dma_params->dma_addr = mem->start + pdata->tx_dma_offset; 1107 dma_params->dma_addr = mem->start + pdata->tx_dma_offset;
1106 1108
1107 /* Unconditional dmaengine stuff */ 1109 /* Unconditional dmaengine stuff */
1108 mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr = dma_params->dma_addr; 1110 dma_data->addr = dma_params->dma_addr;
1109 1111
1110 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 1112 res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
1111 if (res) 1113 if (res)
@@ -1113,7 +1115,14 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1113 else 1115 else
1114 dma_params->channel = pdata->tx_dma_channel; 1116 dma_params->channel = pdata->tx_dma_channel;
1115 1117
1118 /* dmaengine filter data for DT and non-DT boot */
1119 if (pdev->dev.of_node)
1120 dma_data->filter_data = "tx";
1121 else
1122 dma_data->filter_data = &dma_params->channel;
1123
1116 dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_CAPTURE]; 1124 dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_CAPTURE];
1125 dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE];
1117 dma_params->asp_chan_q = pdata->asp_chan_q; 1126 dma_params->asp_chan_q = pdata->asp_chan_q;
1118 dma_params->ram_chan_q = pdata->ram_chan_q; 1127 dma_params->ram_chan_q = pdata->ram_chan_q;
1119 dma_params->sram_pool = pdata->sram_pool; 1128 dma_params->sram_pool = pdata->sram_pool;
@@ -1124,7 +1133,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1124 dma_params->dma_addr = mem->start + pdata->rx_dma_offset; 1133 dma_params->dma_addr = mem->start + pdata->rx_dma_offset;
1125 1134
1126 /* Unconditional dmaengine stuff */ 1135 /* Unconditional dmaengine stuff */
1127 mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE].addr = dma_params->dma_addr; 1136 dma_data->addr = dma_params->dma_addr;
1128 1137
1129 if (mcasp->version < MCASP_VERSION_3) { 1138 if (mcasp->version < MCASP_VERSION_3) {
1130 mcasp->fifo_base = DAVINCI_MCASP_V2_AFIFO_BASE; 1139 mcasp->fifo_base = DAVINCI_MCASP_V2_AFIFO_BASE;
@@ -1140,9 +1149,11 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1140 else 1149 else
1141 dma_params->channel = pdata->rx_dma_channel; 1150 dma_params->channel = pdata->rx_dma_channel;
1142 1151
1143 /* Unconditional dmaengine stuff */ 1152 /* dmaengine filter data for DT and non-DT boot */
1144 mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data = "tx"; 1153 if (pdev->dev.of_node)
1145 mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE].filter_data = "rx"; 1154 dma_data->filter_data = "rx";
1155 else
1156 dma_data->filter_data = &dma_params->channel;
1146 1157
1147 dev_set_drvdata(&pdev->dev, mcasp); 1158 dev_set_drvdata(&pdev->dev, mcasp);
1148 1159