diff options
Diffstat (limited to 'lib/rbcodec/dsp/dsp_core.c')
-rw-r--r-- | lib/rbcodec/dsp/dsp_core.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/lib/rbcodec/dsp/dsp_core.c b/lib/rbcodec/dsp/dsp_core.c index 871ccbfd23..b0e9c8a304 100644 --- a/lib/rbcodec/dsp/dsp_core.c +++ b/lib/rbcodec/dsp/dsp_core.c | |||
@@ -103,8 +103,21 @@ static intptr_t proc_broadcast(struct dsp_config *dsp, unsigned int setting, | |||
103 | intptr_t value) | 103 | intptr_t value) |
104 | { | 104 | { |
105 | bool multi = setting < DSP_PROC_SETTING; | 105 | bool multi = setting < DSP_PROC_SETTING; |
106 | struct dsp_proc_slot *s = multi ? dsp->proc_slots : | 106 | struct dsp_proc_slot *s; |
107 | find_proc_slot(dsp, setting - DSP_PROC_SETTING); | 107 | |
108 | if (multi) | ||
109 | { | ||
110 | /* Message to all enabled stages */ | ||
111 | if (dsp_sample_io_configure(&dsp->io_data, setting, &value)) | ||
112 | return value; /* To I/O only */ | ||
113 | |||
114 | s = dsp->proc_slots; | ||
115 | } | ||
116 | else | ||
117 | { | ||
118 | /* Message to a particular stage */ | ||
119 | s = find_proc_slot(dsp, setting - DSP_PROC_SETTING); | ||
120 | } | ||
108 | 121 | ||
109 | while (s != NULL) | 122 | while (s != NULL) |
110 | { | 123 | { |
@@ -117,7 +130,7 @@ static intptr_t proc_broadcast(struct dsp_config *dsp, unsigned int setting, | |||
117 | s = s->next; | 130 | s = s->next; |
118 | } | 131 | } |
119 | 132 | ||
120 | return multi ? 1 : 0; | 133 | return 0; |
121 | } | 134 | } |
122 | 135 | ||
123 | /* Add an item to the enabled list */ | 136 | /* Add an item to the enabled list */ |
@@ -244,6 +257,12 @@ void dsp_proc_enable(struct dsp_config *dsp, enum dsp_proc_ids id, | |||
244 | proc_db_entry(s)->configure(&s->proc_entry, dsp, DSP_PROC_CLOSE, 0); | 257 | proc_db_entry(s)->configure(&s->proc_entry, dsp, DSP_PROC_CLOSE, 0); |
245 | } | 258 | } |
246 | 259 | ||
260 | /* Is the stage specified by the id currently enabled? */ | ||
261 | bool dsp_proc_enabled(struct dsp_config *dsp, enum dsp_proc_ids id) | ||
262 | { | ||
263 | return (dsp->proc_mask_enabled & BIT_N(id)) != 0; | ||
264 | } | ||
265 | |||
247 | /* Activate or deactivate a stage */ | 266 | /* Activate or deactivate a stage */ |
248 | void dsp_proc_activate(struct dsp_config *dsp, enum dsp_proc_ids id, | 267 | void dsp_proc_activate(struct dsp_config *dsp, enum dsp_proc_ids id, |
249 | bool activate) | 268 | bool activate) |
@@ -454,7 +473,6 @@ void dsp_process(struct dsp_config *dsp, struct dsp_buffer *src, | |||
454 | intptr_t dsp_configure(struct dsp_config *dsp, unsigned int setting, | 473 | intptr_t dsp_configure(struct dsp_config *dsp, unsigned int setting, |
455 | intptr_t value) | 474 | intptr_t value) |
456 | { | 475 | { |
457 | dsp_sample_io_configure(&dsp->io_data, setting, value); | ||
458 | return proc_broadcast(dsp, setting, value); | 476 | return proc_broadcast(dsp, setting, value); |
459 | } | 477 | } |
460 | 478 | ||
@@ -497,7 +515,8 @@ void INIT_ATTR dsp_init(void) | |||
497 | count = slot_count[i]; | 515 | count = slot_count[i]; |
498 | dsp->slot_free_mask = MASK_N(uint32_t, count, shift); | 516 | dsp->slot_free_mask = MASK_N(uint32_t, count, shift); |
499 | 517 | ||
500 | dsp_sample_io_configure(&dsp->io_data, DSP_INIT, i); | 518 | intptr_t value = i; |
519 | dsp_sample_io_configure(&dsp->io_data, DSP_INIT, &value); | ||
501 | 520 | ||
502 | /* Notify each db entry of global init for each DSP */ | 521 | /* Notify each db entry of global init for each DSP */ |
503 | for (unsigned int j = 0; j < DSP_NUM_PROC_STAGES; j++) | 522 | for (unsigned int j = 0; j < DSP_NUM_PROC_STAGES; j++) |