host: ignore host_trigger() for one shot copy mode

Ignores host_trigger(), when host component is
configured in one shot copy mode. In such mode
the DMA is started every time in copy and stopped
automatically.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-06-27 14:22:30 +02:00 committed by Janusz Jankowski
parent eefe72c925
commit 4151d902b7
1 changed files with 7 additions and 2 deletions

View File

@ -294,6 +294,12 @@ static int host_trigger(struct comp_dev *dev, int cmd)
return ret;
}
/* we should ignore any trigger commands when doing one shot,
* because transfers will start in copy and stop automatically
*/
if (hd->copy_type == COMP_COPY_ONE_SHOT)
return ret;
if (hd->chan < 0) {
trace_host_error("host_trigger() error: no dma channel "
"configured");
@ -460,8 +466,7 @@ static void host_buffer_cb(void *data, uint32_t bytes)
if (hd->copy_type == COMP_COPY_BLOCKING)
flags |= DMA_COPY_BLOCKING;
if (!hd->config.cyclic)
else if (hd->copy_type == COMP_COPY_ONE_SHOT)
flags |= DMA_COPY_ONE_SHOT;
/* reconfigure transfer */