summaryrefslogtreecommitdiffstats
path: root/firmware/sound.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-08-01 21:38:18 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-08-01 21:38:18 +0000
commit3c7c79189e2912ac179deab21c92ffb3448b128b (patch)
treedce0b4d5b3f49965172c896e72cd5e40264d1606 /firmware/sound.c
parent1ace06a67d5ec4df3a0295a341124677782baf70 (diff)
downloadrockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.gz
rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.bz2
rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.zip
* Move DSP_CALLBACK_* enum to sound.h
* Add software based volume control for a certain range (SW_VOLUME_MIN -> SW_VOLUME_MAX) * Make Onda VX747 use it * Don't change volume or frequency in Ingenic Jz4740 codec driver when they're already set git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22106 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/sound.c')
-rw-r--r--firmware/sound.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/firmware/sound.c b/firmware/sound.c
index 84ccd2b1bd..b327e3839c 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -158,16 +158,6 @@ sound_set_type* sound_get_fn(int setting)
}
#if CONFIG_CODEC == SWCODEC
-/* Copied from dsp.h, nasty nasty, but we don't want to include dsp.h */
-
-enum {
- DSP_CALLBACK_SET_PRESCALE = 0,
- DSP_CALLBACK_SET_BASS,
- DSP_CALLBACK_SET_TREBLE,
- DSP_CALLBACK_SET_CHANNEL_CONFIG,
- DSP_CALLBACK_SET_STEREO_WIDTH
-};
-
static int (*dsp_callback)(int, intptr_t) = NULL;
void sound_set_dsp_callback(int (*func)(int, intptr_t))
@@ -251,6 +241,10 @@ static void set_prescaled_volume(void)
r += ((r - (VOLUME_MIN - ONE_DB)) * current_balance) / VOLUME_RANGE;
}
+#ifdef HAVE_SW_VOLUME_CONTROL
+ dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0);
+#endif
+
#if CONFIG_CODEC == MAS3507D
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \