mirror of https://github.com/thesofproject/sof.git
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:
parent
097a633995
commit
8f9b769af8
|
@ -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);
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue