diff options
Diffstat (limited to 'firmware/drivers/audio/dummy_codec.c')
-rw-r--r-- | firmware/drivers/audio/dummy_codec.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/drivers/audio/dummy_codec.c b/firmware/drivers/audio/dummy_codec.c index ca51d95265..94ba04b56a 100644 --- a/firmware/drivers/audio/dummy_codec.c +++ b/firmware/drivers/audio/dummy_codec.c | |||
@@ -23,9 +23,11 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "audio.h" | 24 | #include "audio.h" |
25 | #include "audiohw.h" | 25 | #include "audiohw.h" |
26 | #include "system.h" | ||
27 | #include "pcm_sw_volume.h" | ||
26 | 28 | ||
27 | const struct sound_settings_info audiohw_settings[] = { | 29 | const struct sound_settings_info audiohw_settings[] = { |
28 | [SOUND_VOLUME] = {"dB", 0, 1, -1, 0, 0}, | 30 | [SOUND_VOLUME] = {"dB", 0, 1, VOLUME_MIN/10, VOLUME_MAX/10, 0}, |
29 | /* HAVE_SW_TONE_CONTROLS */ | 31 | /* HAVE_SW_TONE_CONTROLS */ |
30 | [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, | 32 | [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, |
31 | [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, | 33 | [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, |
@@ -44,3 +46,13 @@ void audiohw_set_frequency(int fsel) | |||
44 | { | 46 | { |
45 | (void)fsel; | 47 | (void)fsel; |
46 | } | 48 | } |
49 | |||
50 | #ifdef HAVE_SW_VOLUME_CONTROL | ||
51 | void audiohw_set_master_vol(int vol_l, int vol_r) | ||
52 | { | ||
53 | /* SW volume for <= 1.0 gain, HW at unity, < VOLUME_MIN == MUTE */ | ||
54 | int sw_volume_l = vol_l < VOLUME_MIN ? PCM_MUTE_LEVEL : MIN(vol_l, 0); | ||
55 | int sw_volume_r = vol_r < VOLUME_MIN ? PCM_MUTE_LEVEL : MIN(vol_r, 0); | ||
56 | pcm_set_master_volume(sw_volume_l, sw_volume_r); | ||
57 | } | ||
58 | #endif /* HAVE_SW_VOLUME_CONTROL */ | ||