host: fix wrong usage of dma_channel_get

Need not to use stream tag for dw_dma as the comment said

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit is contained in:
Pan Xiuli 2018-11-22 18:25:25 +08:00
parent 44ea105c06
commit a9157a7d92
1 changed files with 11 additions and 5 deletions

View File

@ -514,10 +514,7 @@ static int host_params(struct comp_dev *dev)
config->dest_width = comp_sample_bytes(dev);
config->cyclic = 0;
#if !defined CONFIG_DMA_GW
host_elements_reset(dev);
#endif
#if defined CONFIG_DMA_GW
dev->params.stream_tag -= 1;
/* get DMA channel from DMAC
* note: stream_tag is ignored by dw-dma
@ -527,13 +524,22 @@ static int host_params(struct comp_dev *dev)
trace_host_error("eDC");
return -ENODEV;
}
#if defined CONFIG_DMA_GW
err = dma_set_config(hd->dma, hd->chan, &hd->config);
if (err < 0) {
trace_host_error("eDc");
dma_channel_put(hd->dma, hd->chan);
return err;
}
#else
host_elements_reset(dev);
/* get DMA channel from DMAC
* note: stream_tag is ignored by dw-dma
*/
hd->chan = dma_channel_get(hd->dma, 0);
if (hd->chan < 0) {
trace_host_error("eDC");
return -ENODEV;
}
#endif
/* set up callback */
dma_set_cb(hd->dma, hd->chan, DMA_IRQ_TYPE_LLIST,