Commit caa1d794 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: davinci-mcasp: Fix DIT only McASP instance support

One of the McASP instances in DM646x line of DMSoC only supports DIT mode.
This means that the given IP does not have support for rx and all the rx
related resources are missing, like irq and DMA request.
The driver should not fail if any or all  of the RX resource is missing
when the op_mode is set to DIT mode.
Since RX is not possible in DIT mode, we can just ignore the rx resources
when the McASP is used in DIT mode.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8f511ffb
...@@ -1327,6 +1327,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of( ...@@ -1327,6 +1327,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
pdata->tx_dma_channel = dma_spec.args[0]; pdata->tx_dma_channel = dma_spec.args[0];
/* RX is not valid in DIT mode */
if (pdata->op_mode != DAVINCI_MCASP_DIT_MODE) {
ret = of_property_match_string(np, "dma-names", "rx"); ret = of_property_match_string(np, "dma-names", "rx");
if (ret < 0) if (ret < 0)
goto nodata; goto nodata;
...@@ -1337,6 +1339,7 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of( ...@@ -1337,6 +1339,7 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
goto nodata; goto nodata;
pdata->rx_dma_channel = dma_spec.args[0]; pdata->rx_dma_channel = dma_spec.args[0];
}
ret = of_property_read_u32(np, "tx-num-evt", &val); ret = of_property_read_u32(np, "tx-num-evt", &val);
if (ret >= 0) if (ret >= 0)
...@@ -1532,6 +1535,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1532,6 +1535,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
else else
dma_data->filter_data = &dma_params->channel; dma_data->filter_data = &dma_params->channel;
/* RX is not valid in DIT mode */
if (mcasp->op_mode != DAVINCI_MCASP_DIT_MODE) {
dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_CAPTURE]; dma_params = &mcasp->dma_params[SNDRV_PCM_STREAM_CAPTURE];
dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE]; dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE];
dma_params->asp_chan_q = pdata->asp_chan_q; dma_params->asp_chan_q = pdata->asp_chan_q;
...@@ -1546,14 +1551,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1546,14 +1551,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
/* Unconditional dmaengine stuff */ /* Unconditional dmaengine stuff */
dma_data->addr = dma_params->dma_addr; dma_data->addr = dma_params->dma_addr;
if (mcasp->version < MCASP_VERSION_3) {
mcasp->fifo_base = DAVINCI_MCASP_V2_AFIFO_BASE;
/* dma_params->dma_addr is pointing to the data port address */
mcasp->dat_port = true;
} else {
mcasp->fifo_base = DAVINCI_MCASP_V3_AFIFO_BASE;
}
res = platform_get_resource(pdev, IORESOURCE_DMA, 1); res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (res) if (res)
dma_params->channel = res->start; dma_params->channel = res->start;
...@@ -1565,6 +1562,15 @@ static int davinci_mcasp_probe(struct platform_device *pdev) ...@@ -1565,6 +1562,15 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dma_data->filter_data = "rx"; dma_data->filter_data = "rx";
else else
dma_data->filter_data = &dma_params->channel; dma_data->filter_data = &dma_params->channel;
}
if (mcasp->version < MCASP_VERSION_3) {
mcasp->fifo_base = DAVINCI_MCASP_V2_AFIFO_BASE;
/* dma_params->dma_addr is pointing to the data port address */
mcasp->dat_port = true;
} else {
mcasp->fifo_base = DAVINCI_MCASP_V3_AFIFO_BASE;
}
dev_set_drvdata(&pdev->dev, mcasp); dev_set_drvdata(&pdev->dev, mcasp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment