summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2010-10-24 09:24:35 +0000
committerBertrik Sikken <bertrik@sikken.nl>2010-10-24 09:24:35 +0000
commit097d7fb689cc29bb58d13aec94e38b0b08fffb0e (patch)
treefdcf8fa138327fba859d1528d08bb87c8dba4c46 /firmware
parentf444b0ad32317f00636c15891eb8c251875679b5 (diff)
downloadrockbox-097d7fb689cc29bb58d13aec94e38b0b08fffb0e.tar.gz
rockbox-097d7fb689cc29bb58d13aec94e38b0b08fffb0e.tar.bz2
rockbox-097d7fb689cc29bb58d13aec94e38b0b08fffb0e.zip
Fix FS#11559 - no sound from ipod fm remote on ipod nano 1g.
This fix implements audiohw_set_monitor for the wm8975 codec (used in ipod nano 1g, nano 2g, color, 4g) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28341 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/wm8975.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/firmware/drivers/audio/wm8975.c b/firmware/drivers/audio/wm8975.c
index 3fcb01e728..45fa3ffdd6 100644
--- a/firmware/drivers/audio/wm8975.c
+++ b/firmware/drivers/audio/wm8975.c
@@ -319,6 +319,22 @@ void audiohw_set_recvol(int left, int right, int type)
void audiohw_set_monitor(bool enable)
{
- (void)enable;
+ if (enable) {
+ // set volume to 0 dB
+ wm8975_regs[LOUTMIX1] &= ~LOUTMIX1_LI2LOVOL_MASK;
+ wm8975_regs[LOUTMIX1] |= LOUTMIX1_LI2LOVOL(2);
+ wm8975_regs[ROUTMIX2] &= ~ROUTMIX2_RI2ROVOL_MASK;
+ wm8975_regs[ROUTMIX2] |= ROUTMIX2_RI2ROVOL(2);
+ // set mux to line input
+ wm8975_write_and(LOUTMIX1, ~7);
+ wm8975_write_and(ROUTMIX1, ~7);
+ // enable bypass
+ wm8975_write_or(LOUTMIX1, LOUTMIX1_LI2LO);
+ wm8975_write_or(ROUTMIX2, ROUTMIX2_RI2RO);
+ } else {
+ // disable bypass
+ wm8975_write_and(LOUTMIX1, ~LOUTMIX1_LI2LO);
+ wm8975_write_and(ROUTMIX2, ~ROUTMIX2_RI2RO);
+ }
}
#endif /* HAVE_RECORDING */