rbcodec dsp: Refactor DSP init routines, restore INIT_ATTR

Refactor DSP init routines so there is a dedicated init function
for the stages that need it. Remove the DSP_INIT configure message.
This allows the init code to be safely marked INIT_ATTR, saving a
bit of code size, and allowing the linker to verify that there are
no unsafe references to the init routines.

Change-Id: I1702f0f579bbb300a6fe7d0e67b13aa2e9dd7f8a
This commit is contained in:
Aidan MacDonald 2022-12-03 15:33:15 +00:00
parent 34a092a997
commit 6e794c9a2d
10 changed files with 62 additions and 35 deletions

View file

@ -521,8 +521,12 @@ static intptr_t tdspeed_new_format(struct dsp_proc_entry *this,
(void)this;
}
static void tdspeed_dsp_init(struct tdspeed_state_s *st, unsigned int dsp_id)
void dsp_timestretch_init(struct dsp_config *dsp, unsigned int dsp_id)
{
(void)dsp;
struct tdspeed_state_s *st = &tdspeed_state;
/* everything is at 100% until dsp_set_timestretch is called with
some other value and timestretch is enabled at the time */
if (dsp_id == CODEC_IDX_AUDIO)
@ -541,10 +545,6 @@ static intptr_t tdspeed_configure(struct dsp_proc_entry *this,
switch (setting)
{
case DSP_INIT:
tdspeed_dsp_init(st, value);
break;
case DSP_FLUSH:
tdspeed_flush();
break;