KPB: update kpb reset function

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This commit is contained in:
Marcin Rajwa 2019-04-09 13:22:19 +02:00 committed by Tomasz Lauda
parent 23d4d12598
commit 6a3526ec68
1 changed files with 16 additions and 2 deletions

View File

@ -398,10 +398,24 @@ static void kpb_cache(struct comp_dev *dev, int cmd)
/* TODO: writeback history buffer */
}
/**
* \brief Resets KPB component.
* \param[in,out] dev KPB base component device.
* \return Error code.
*/
static int kpb_reset(struct comp_dev *dev)
{
/* TODO: what data of KPB should we reset here? */
return 0;
struct comp_data *kpb = comp_get_drvdata(dev);
trace_kpb("kpb_reset()");
/* Reset history buffer */
kpb->is_internal_buffer_full = false;
kpb_clear_history_buffer(kpb->history_buffer);
/* Reset amount of buffered data */
kpb->buffered_data = 0;
return comp_set_state(dev, COMP_TRIGGER_RESET);
}
/**