summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp/dsp_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/dsp/dsp_misc.c')
-rw-r--r--lib/rbcodec/dsp/dsp_misc.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/lib/rbcodec/dsp/dsp_misc.c b/lib/rbcodec/dsp/dsp_misc.c
index a19ef52883..40d198ff50 100644
--- a/lib/rbcodec/dsp/dsp_misc.c
+++ b/lib/rbcodec/dsp/dsp_misc.c
@@ -116,7 +116,7 @@ static void dsp_pitch_update(struct dsp_config *dsp)
116 fp_div(pitch_ratio, PITCH_SPEED_100, 16)); 116 fp_div(pitch_ratio, PITCH_SPEED_100, 16));
117} 117}
118 118
119static void dsp_set_pitch(int32_t percent) 119void dsp_set_pitch(int32_t percent)
120{ 120{
121 if (percent <= 0) 121 if (percent <= 0)
122 percent = PITCH_SPEED_100; 122 percent = PITCH_SPEED_100;
@@ -128,50 +128,12 @@ static void dsp_set_pitch(int32_t percent)
128 128
129 dsp_pitch_update(dsp_get_config(CODEC_IDX_AUDIO)); 129 dsp_pitch_update(dsp_get_config(CODEC_IDX_AUDIO));
130} 130}
131#endif /* HAVE_PITCHCONTROL */
132
133
134/** Firmware callback interface **/
135 131
136/* Hook back from firmware/ part of audio, which can't/shouldn't call apps/ 132int32_t dsp_get_pitch(void)
137 * code directly. */
138int dsp_callback(int msg, intptr_t param)
139{ 133{
140 int retval = 0; 134 return pitch_ratio;
141
142 switch (msg)
143 {
144#ifdef HAVE_SW_TONE_CONTROLS
145 case DSP_CALLBACK_SET_PRESCALE:
146 tone_set_prescale(param);
147 break;
148 case DSP_CALLBACK_SET_BASS:
149 tone_set_bass(param);
150 break;
151 case DSP_CALLBACK_SET_TREBLE:
152 tone_set_treble(param);
153 break;
154#endif /* HAVE_SW_TONE_CONTROLS */
155 case DSP_CALLBACK_SET_CHANNEL_CONFIG:
156 channel_mode_set_config(param);
157 break;
158 case DSP_CALLBACK_SET_STEREO_WIDTH:
159 channel_mode_custom_set_width(param);
160 break;
161#ifdef HAVE_PITCHCONTROL
162 case DSP_CALLBACK_SET_PITCH:
163 dsp_set_pitch(param);
164 break;
165 case DSP_CALLBACK_GET_PITCH:
166 retval = pitch_ratio;
167 break;
168#endif /* HAVE_PITCHCONTROL */
169 default:
170 break;
171 }
172
173 return retval;
174} 135}
136#endif /* HAVE_PITCHCONTROL */
175 137
176static void INIT_ATTR misc_dsp_init(struct dsp_config *dsp, 138static void INIT_ATTR misc_dsp_init(struct dsp_config *dsp,
177 enum dsp_ids dsp_id) 139 enum dsp_ids dsp_id)