summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-04-12 10:08:37 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-04-12 10:11:54 +0400
commit6be80976517709e16d587e3e30f020e41610be42 (patch)
tree0b4794ff23e06ba9df7bf701935adbdcba0efcd4 /firmware/drivers/audio
parent2dd1f37a109792b262a4000c050f7a48a145f1c4 (diff)
downloadrockbox-6be80976517709e16d587e3e30f020e41610be42.tar.gz
rockbox-6be80976517709e16d587e3e30f020e41610be42.zip
hm60x/hm801: Fix balance by enabling sw volume control.
Change-Id: I8760b58d5b801409f35370d812d72f8d578d2889
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r--firmware/drivers/audio/dummy_codec.c14
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
27const struct sound_settings_info audiohw_settings[] = { 29const 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
51void 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 */