mirror of https://github.com/thesofproject/sof.git
dai: only get dma channel at first config
For dais, we don't support change dma channel dynamically, so only get dma channel at first config, ignore that for latter dai_config invokings to avoid dma channel leaking. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
0a57440a35
commit
4cc0556ce3
|
@ -256,6 +256,7 @@ static struct comp_dev *dai_new(struct sof_ipc_comp *comp)
|
|||
dd->dai_pos_blks = 0;
|
||||
dd->xrun = 0;
|
||||
dd->pointer_init = 0;
|
||||
dd->chan = DMA_CHAN_INVALID;
|
||||
|
||||
dev->state = COMP_STATE_READY;
|
||||
return dev;
|
||||
|
@ -774,8 +775,10 @@ static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* channel is ignored by GP dma get function */
|
||||
if (dd->chan == DMA_CHAN_INVALID)
|
||||
/* get dma channel at first config only */
|
||||
dd->chan = dma_channel_get(dd->dma, channel);
|
||||
|
||||
if (dd->chan < 0) {
|
||||
trace_dai_error_with_ids(dev, "dai_config() error: "
|
||||
"dma_channel_get() failed");
|
||||
|
|
|
@ -89,6 +89,8 @@
|
|||
#define DMA_RELOAD_END 0
|
||||
#define DMA_RELOAD_LLI 0xFFFFFFFF
|
||||
|
||||
#define DMA_CHAN_INVALID 0xFFFFFFFF
|
||||
|
||||
struct dma;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue