@@ -136,7 +136,7 @@ static struct comp_dev *kpb_new(struct sof_ipc_comp *comp)
136136 return NULL ;
137137 }
138138
139- if (kpb -> config .channels > KPB_MAX_SUPPORTED_CHANNELS ) {
139+ if (kpb -> config .no_channels > KPB_MAX_SUPPORTED_CHANNELS ) {
140140 trace_kpb_error_with_ids (dev , "kpb_new() error: "
141141 "no of channels exceeded the limit" );
142142 return NULL ;
@@ -895,7 +895,7 @@ static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli)
895895 struct comp_data * kpb = comp_get_drvdata (dev );
896896 bool is_sink_ready = (kpb -> host_sink -> sink -> state == COMP_STATE_ACTIVE );
897897 size_t sample_width = kpb -> config .sampling_width ;
898- size_t history_depth = cli -> history_depth * kpb -> config .channels *
898+ size_t history_depth = cli -> history_depth * kpb -> config .no_channels *
899899 (kpb -> config .sampling_freq / 1000 ) *
900900 (KPB_SAMPLE_CONTAINER_SIZE (sample_width ) / 8 );
901901 struct hb * buff = kpb -> history_buffer ;
@@ -907,9 +907,9 @@ static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli)
907907 size_t host_period_size = kpb -> host_period_size ;
908908 size_t host_buffer_size = kpb -> host_buffer_size ;
909909 size_t ticks_per_ms = clock_ms_to_ticks (PLATFORM_DEFAULT_CLOCK , 1 );
910- size_t bytes_per_ms = KPB_SAMPLES_PER_MS *
910+ size_t bytes_per_ms = KPB_SAMPLING_WIDTH *
911911 (KPB_SAMPLE_CONTAINER_SIZE (sample_width ) / 8 ) *
912- kpb -> config .channels ;
912+ kpb -> config .no_channels ;
913913 size_t period_bytes_limit = 0 ;
914914
915915 trace_kpb_with_ids (dev , "kpb_init_draining(): requested draining "
@@ -1188,7 +1188,7 @@ static void kpb_drain_samples(void *source, struct comp_buffer *sink,
11881188 size_t frames = KPB_BYTES_TO_FRAMES (size , sample_width );
11891189
11901190 for (i = 0 ; i < frames ; i ++ ) {
1191- for (channel = 0 ; channel < KPB_NUM_OF_CHANNELS ; channel ++ ) {
1191+ for (channel = 0 ; channel < KPB_NR_OF_CHANNELS ; channel ++ ) {
11921192 switch (sample_width ) {
11931193#if CONFIG_FORMAT_S16LE
11941194 case 16 :
@@ -1235,7 +1235,7 @@ static void kpb_buffer_samples(struct comp_buffer *source, uint32_t start,
12351235 size_t frames = KPB_BYTES_TO_FRAMES (size , sample_width );
12361236
12371237 for (i = 0 ; i < frames ; i ++ ) {
1238- for (channel = 0 ; channel < KPB_NUM_OF_CHANNELS ; channel ++ ) {
1238+ for (channel = 0 ; channel < KPB_NR_OF_CHANNELS ; channel ++ ) {
12391239 switch (sample_width ) {
12401240 case 16 :
12411241 src = buffer_read_frag_s16 (source , j );
@@ -1332,7 +1332,7 @@ static void kpb_copy_samples(struct comp_buffer *sink,
13321332 size_t frames = KPB_BYTES_TO_FRAMES (size , sample_width );
13331333
13341334 for (i = 0 ; i < frames ; i ++ ) {
1335- for (channel = 0 ; channel < KPB_NUM_OF_CHANNELS ; channel ++ ) {
1335+ for (channel = 0 ; channel < KPB_NR_OF_CHANNELS ; channel ++ ) {
13361336 switch (sample_width ) {
13371337#if CONFIG_FORMAT_S16LE
13381338 case 16 :
0 commit comments