提交 caa1d794 编写于 作者: P Peter Ujfalusi 提交者: 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: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 8f511ffb
......@@ -1327,6 +1327,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
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");
if (ret < 0)
goto nodata;
......@@ -1337,6 +1339,7 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
goto nodata;
pdata->rx_dma_channel = dma_spec.args[0];
}
ret = of_property_read_u32(np, "tx-num-evt", &val);
if (ret >= 0)
......@@ -1532,6 +1535,8 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
else
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_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE];
dma_params->asp_chan_q = pdata->asp_chan_q;
......@@ -1546,14 +1551,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
/* Unconditional dmaengine stuff */
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);
if (res)
dma_params->channel = res->start;
......@@ -1565,6 +1562,15 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
dma_data->filter_data = "rx";
else
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册