dai: add a DAI operations copy method

Add a DAI copy method to be called before dma_copy().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-05-24 12:03:59 +02:00 committed by Liam Girdwood
parent 097a633995
commit 8f9b769af8
3 changed files with 7 additions and 0 deletions

View File

@ -1000,6 +1000,9 @@ static int dai_copy(struct comp_dev *dev)
return 0;
}
if (dd->dai->drv->ops.copy)
dd->dai->drv->ops.copy(dd->dai);
ret = dma_copy_legacy(dd->chan, copy_bytes, 0);
if (ret < 0) {
dai_report_xrun(dev, copy_bytes);

View File

@ -1107,6 +1107,9 @@ static int dai_copy(struct comp_dev *dev)
return 0;
}
if (dd->dai->drv->ops.copy)
dd->dai->drv->ops.copy(dd->dai);
struct dma_cb_data next = {
.channel = dd->chan,
.elem = { .size = copy_bytes },

View File

@ -86,6 +86,7 @@ struct dai_ops {
int (*remove)(struct dai *dai);
uint32_t (*get_init_delay_ms)(struct dai *dai);
int (*get_fifo_depth)(struct dai *dai, int direction);
void (*copy)(struct dai *dai); /* Can be used by DAIs to prepare for data copying */
};
struct timestamp_cfg {