From 9f746c01c068b00ca889db440685e9d8300eb85e Mon Sep 17 00:00:00 2001 From: Marcin Rajwa Date: Thu, 25 Jul 2019 22:10:25 +0200 Subject: [PATCH] kpb: extend internal states This commit adds more detailed states into KPB Signed-off-by: Marcin Rajwa --- src/audio/kpb.c | 9 ++++++--- src/include/sof/audio/kpb.h | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/audio/kpb.c b/src/audio/kpb.c index d1a0efc2c..251405530 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -139,12 +139,15 @@ static struct comp_dev *kpb_new(struct sof_ipc_comp *comp) return NULL; } - dev->state = COMP_STATE_READY; - kpb->history_buffer = NULL; - /* Zero number of clients */ + /* Init basic component data */ + kpb->history_buffer = NULL; kpb->kpb_no_of_clients = 0; + /* Kpb has been created successfully */ + dev->state = COMP_STATE_READY; + kpb->state = KPB_STATE_CREATED; + return dev; } diff --git a/src/include/sof/audio/kpb.h b/src/include/sof/audio/kpb.h index acdbba18e..e6e286b9c 100644 --- a/src/include/sof/audio/kpb.h +++ b/src/include/sof/audio/kpb.h @@ -38,9 +38,15 @@ struct comp_buffer; KPB_NR_OF_CHANNELS)) enum kpb_state { - KPB_STATE_BUFFERING = 0, + KPB_STATE_DISABLED = 0, + KPB_STATE_RESET_FINISHING, + KPB_STATE_CREATED, + KPB_STATE_PREPARING, + KPB_STATE_RUN, + KPB_STATE_BUFFERING, KPB_STATE_DRAINING, KPB_STATE_HOST_COPY, + KPB_STATE_RESETTING, }; enum kpb_event {