summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-03-21 00:13:20 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-03-21 00:13:20 +0000
commit1a6bcfa2c1545fc66aac40c88dba3a6f804d6227 (patch)
tree11069b2e03848d5e928fa98d7201fb64f75ef389 /firmware/drivers
parentd63a8fcb7b0f4835a5acdb6c0dcb0783b6d3bba7 (diff)
downloadrockbox-1a6bcfa2c1545fc66aac40c88dba3a6f804d6227.zip
rockbox-1a6bcfa2c1545fc66aac40c88dba3a6f804d6227.tar.gz
rockbox-1a6bcfa2c1545fc66aac40c88dba3a6f804d6227.tar.bz2
rockbox-1a6bcfa2c1545fc66aac40c88dba3a6f804d6227.tar.xz
D2: Enable FM radio (based on FS#10035 by Michael Burtin with some changes by myself). Also updates the LV24020 driver to add optional logf debugging.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20420 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/wm8985.c7
-rw-r--r--firmware/drivers/tuner/lv24020lp.c17
2 files changed, 19 insertions, 5 deletions
diff --git a/firmware/drivers/audio/wm8985.c b/firmware/drivers/audio/wm8985.c
index f7b2e51..d59d2d3 100644
--- a/firmware/drivers/audio/wm8985.c
+++ b/firmware/drivers/audio/wm8985.c
@@ -186,6 +186,13 @@ void audiohw_set_lineout_vol(int vol_l, int vol_r)
wmcodec_write(ROUT2VOL, 0x100 | vol_r);
}
+void audiohw_set_aux_vol(int vol_l, int vol_r)
+{
+ /* OUTMIX */
+ wmcodec_write(LOUTMIX, 0x111 | (vol_l << 5) );
+ wmcodec_write(ROUTMIX, 0x111 | (vol_r << 5) );
+}
+
void audiohw_set_bass(int value)
{
eq1_reg = (eq1_reg & ~EQ_GAIN_MASK) | EQ_GAIN_VALUE(value);
diff --git a/firmware/drivers/tuner/lv24020lp.c b/firmware/drivers/tuner/lv24020lp.c
index 769be8a..c6d396a 100644
--- a/firmware/drivers/tuner/lv24020lp.c
+++ b/firmware/drivers/tuner/lv24020lp.c
@@ -29,19 +29,17 @@
#include "power.h"
#include "fmradio.h" /* physical interface driver */
#include "sound.h"
-#include "pp5024.h"
#include "system.h"
#ifndef BOOTLOADER
static struct mutex tuner_mtx;
-#if 0
/* define to enable tuner logging */
-#define SANYO_TUNER_LOG
-#endif
+#undef SANYO_TUNER_LOG_FILE
+#undef SANYO_TUNER_LOGF
-#ifdef SANYO_TUNER_LOG
+#ifdef SANYO_TUNER_LOG_FILE
#include "sprintf.h"
#include "file.h"
@@ -52,6 +50,15 @@ static int fd_log = -1;
/* syncing required because close() is never called */
#define TUNER_LOG_SYNC() fsync(fd_log)
#define TUNER_LOG(s...) fdprintf(fd_log, s)
+
+#elif defined(SANYO_TUNER_LOGF)
+#define LOGF_ENABLE
+#include "logf.h"
+
+#define TUNER_LOG_OPEN()
+#define TUNER_LOG_SYNC()
+#define TUNER_LOG(s...) logf(s)
+
#else
#define TUNER_LOG_OPEN()
#define TUNER_LOG_SYNC()