summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2008-04-28 22:15:52 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2008-04-28 22:15:52 +0000
commita6100fb5ee093ecc9b263c2c659c653d90eed585 (patch)
treedef6575245c3563eb9c4c07375acd91827856517 /firmware
parent9c0abbf838d1d88c406dbf80c3b3f36fb7b76c39 (diff)
downloadrockbox-a6100fb5ee093ecc9b263c2c659c653d90eed585.tar.gz
rockbox-a6100fb5ee093ecc9b263c2c659c653d90eed585.zip
undo some changes of my last patch... should fix wm8751 based targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17286 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/wm8751.c2
-rw-r--r--firmware/sound.c16
2 files changed, 15 insertions, 3 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 26123456b6..831f16ab17 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -79,7 +79,7 @@ static int tone_tenthdb2hw(int value)
/* -6.0db..+0db..+9.0db step 1.5db - translate -60..+0..+90 step 15
to 10..6..0 step -1.
*/
- value = (10 - (value + 60) / 15) / 10;
+ value = 10 - (value + 60) / 15;
if (value == 6)
value = 0xf; /* 0db -> off */
diff --git a/firmware/sound.c b/firmware/sound.c
index 325c42639a..97d4bc268c 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -35,6 +35,10 @@
#endif
#endif
+/* TODO
+ * find a nice way to handle 1.5db steps -> see wm8751 ifdef in sound_set_bass/treble
+*/
+
#if !defined(VOLUME_MIN) && !defined(VOLUME_MAX)
#warning define for VOLUME_MIN and VOLUME_MAX is missing
#define VOLUME_MIN -400
@@ -370,7 +374,11 @@ void sound_set_bass(int value)
#endif
#if (CONFIG_CODEC != MAS3587F) && (CONFIG_CODEC != MAS3539F)
- current_bass = value * 10;
+#if defined(HAVE_WM8751)
+ current_bass = value;
+#else
+ current_bass = value * 10;
+#endif
set_prescaled_volume();
#endif
}
@@ -387,7 +395,11 @@ void sound_set_treble(int value)
#endif
#if (CONFIG_CODEC != MAS3587F) && (CONFIG_CODEC != MAS3539F)
- current_treble = value * 10;
+#if defined(HAVE_WM8751)
+ current_treble = value;
+#else
+ current_treble = value * 10;
+#endif
set_prescaled_volume();
#endif
}