diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-03 15:33:15 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-23 12:47:10 -0500 |
commit | 6e794c9a2d9e91a926f70d0fcc66e255b0bdc221 (patch) | |
tree | 3a0d1371a0a259f2ed761e5db871064867b2a7ce /lib/rbcodec/dsp/dsp_misc.c | |
parent | 34a092a99729dd4de014aa1f76c48660f28a9c97 (diff) | |
download | rockbox-6e794c9a2d9e91a926f70d0fcc66e255b0bdc221.tar.gz rockbox-6e794c9a2d9e91a926f70d0fcc66e255b0bdc221.zip |
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
Diffstat (limited to 'lib/rbcodec/dsp/dsp_misc.c')
-rw-r--r-- | lib/rbcodec/dsp/dsp_misc.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/rbcodec/dsp/dsp_misc.c b/lib/rbcodec/dsp/dsp_misc.c index 8687abc06a..24ec857e3a 100644 --- a/lib/rbcodec/dsp/dsp_misc.c +++ b/lib/rbcodec/dsp/dsp_misc.c | |||
@@ -149,13 +149,6 @@ unsigned int dsp_get_output_frequency(struct dsp_config *dsp) | |||
149 | return dsp_configure(dsp, DSP_GET_OUT_FREQUENCY, 0); | 149 | return dsp_configure(dsp, DSP_GET_OUT_FREQUENCY, 0); |
150 | } | 150 | } |
151 | 151 | ||
152 | static void misc_dsp_init(struct dsp_config *dsp, unsigned int dsp_id) | ||
153 | { | ||
154 | /* Enable us for the audio DSP at startup */ | ||
155 | if (dsp_id == CODEC_IDX_AUDIO) | ||
156 | dsp_proc_enable(dsp, DSP_PROC_MISC_HANDLER, true); | ||
157 | } | ||
158 | |||
159 | /* This is a null-processing stage that monitors as an enabled stage but never | 152 | /* This is a null-processing stage that monitors as an enabled stage but never |
160 | * becomes active in processing samples. It only hooks messages. */ | 153 | * becomes active in processing samples. It only hooks messages. */ |
161 | 154 | ||
@@ -167,10 +160,6 @@ static intptr_t misc_handler_configure(struct dsp_proc_entry *this, | |||
167 | { | 160 | { |
168 | switch (setting) | 161 | switch (setting) |
169 | { | 162 | { |
170 | case DSP_INIT: | ||
171 | misc_dsp_init(dsp, value); | ||
172 | break; | ||
173 | |||
174 | case DSP_PROC_CLOSE: | 163 | case DSP_PROC_CLOSE: |
175 | /* This stage should be enabled at all times */ | 164 | /* This stage should be enabled at all times */ |
176 | DEBUGF("DSP_PROC_MISC_HANDLER - Error: Closing!\n"); | 165 | DEBUGF("DSP_PROC_MISC_HANDLER - Error: Closing!\n"); |