summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/audiohw-swcodec.c29
-rw-r--r--firmware/export/audiohw.h5
2 files changed, 12 insertions, 22 deletions
diff --git a/firmware/drivers/audio/audiohw-swcodec.c b/firmware/drivers/audio/audiohw-swcodec.c
index 9cfc2ce413..6c86bdfaa4 100644
--- a/firmware/drivers/audio/audiohw-swcodec.c
+++ b/firmware/drivers/audio/audiohw-swcodec.c
@@ -21,56 +21,51 @@
21#include "config.h" 21#include "config.h"
22#include "system.h" 22#include "system.h"
23#include "sound.h" 23#include "sound.h"
24#ifdef HAVE_SW_TONE_CONTROLS
25#include "tone_controls.h"
26#endif
27#include "channel_mode.h"
24#include "dsp_misc.h" 28#include "dsp_misc.h"
25 29
26/* Linking audio hardware calls to SWCODEC DSP emulation */ 30/** Functions exported by audiohw.h but implemented in DSP **/
27
28static audiohw_swcodec_cb_type callback = NULL;
29
30void audiohw_swcodec_set_callback(audiohw_swcodec_cb_type func)
31{
32 callback = func;
33}
34
35/** Functions exported by audiohw.h **/
36 31
37void audiohw_set_channel(int value) 32void audiohw_set_channel(int value)
38{ 33{
39 callback(DSP_CALLBACK_SET_CHANNEL_CONFIG, value); 34 channel_mode_set_config(value);
40} 35}
41 36
42void audiohw_set_stereo_width(int value) 37void audiohw_set_stereo_width(int value)
43{ 38{
44 callback(DSP_CALLBACK_SET_STEREO_WIDTH, value); 39 channel_mode_custom_set_width(value);
45} 40}
46 41
47#ifdef HAVE_SW_TONE_CONTROLS 42#ifdef HAVE_SW_TONE_CONTROLS
48void audiohw_set_bass(int value) 43void audiohw_set_bass(int value)
49{ 44{
50 callback(DSP_CALLBACK_SET_BASS, value*10); 45 tone_set_bass(value*10);
51} 46}
52 47
53void audiohw_set_treble(int value) 48void audiohw_set_treble(int value)
54{ 49{
55 callback(DSP_CALLBACK_SET_TREBLE, value*10); 50 tone_set_treble(value*10);
56} 51}
57#endif /* HAVE_SW_TONE_CONTROLS */ 52#endif /* HAVE_SW_TONE_CONTROLS */
58 53
59#ifndef AUDIOHW_HAVE_PRESCALER 54#ifndef AUDIOHW_HAVE_PRESCALER
60void audiohw_set_prescaler(int value) 55void audiohw_set_prescaler(int value)
61{ 56{
62 callback(DSP_CALLBACK_SET_PRESCALE, value); 57 tone_set_prescale(value);
63} 58}
64#endif /* AUDIOHW_HAVE_PRESCALER */ 59#endif /* AUDIOHW_HAVE_PRESCALER */
65 60
66#ifdef HAVE_PITCHCONTROL 61#ifdef HAVE_PITCHCONTROL
67void audiohw_set_pitch(int32_t value) 62void audiohw_set_pitch(int32_t value)
68{ 63{
69 callback(DSP_CALLBACK_SET_PITCH, value); 64 dsp_set_pitch(value);
70} 65}
71 66
72int32_t audiohw_get_pitch(void) 67int32_t audiohw_get_pitch(void)
73{ 68{
74 return callback(DSP_CALLBACK_GET_PITCH, 0); 69 return dsp_get_pitch();
75} 70}
76#endif /* HAVE_PITCHCONTROL */ 71#endif /* HAVE_PITCHCONTROL */
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index 28fa1b08d6..d1579b5b93 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -529,11 +529,6 @@ void audiohw_set_stereo_width(int val);
529void audiohw_enable_speaker(bool on); 529void audiohw_enable_speaker(bool on);
530#endif /* HAVE_SPEAKER */ 530#endif /* HAVE_SPEAKER */
531 531
532#if CONFIG_CODEC == SWCODEC
533typedef int (*audiohw_swcodec_cb_type)(int msg, intptr_t param);
534void audiohw_swcodec_set_callback(audiohw_swcodec_cb_type func);
535#endif /* CONFIG_CODEC == SWCODEC */
536
537/** 532/**
538 * Some setting are the same for every codec and can be defined here. 533 * Some setting are the same for every codec and can be defined here.
539 */ 534 */