summaryrefslogtreecommitdiff
path: root/firmware/drivers/audio
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-12-09 20:48:04 +0000
committerNils Wallménius <nils@rockbox.org>2008-12-09 20:48:04 +0000
commit65f61d6cce4a5d3b52860d38a922b01fcddc70cd (patch)
tree03f8167279828845dcd4923d8184bc58d0e165da /firmware/drivers/audio
parenta13c16271911be641539cace3ea5ea0c1440eeaf (diff)
FS#9609 FM radio support for the Gigabeat S, seeking/scanning is not yet
implemented but manual tuning works nicely. Thanks to Rafaël Carré, Bertrik Sikken and Robert Menes for suggestions and debugging help. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19372 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r--firmware/drivers/audio/wm8978.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/drivers/audio/wm8978.c b/firmware/drivers/audio/wm8978.c
index c2c19ca7be..6a7c974f43 100644
--- a/firmware/drivers/audio/wm8978.c
+++ b/firmware/drivers/audio/wm8978.c
@@ -144,12 +144,12 @@ static void wmc_write(unsigned int reg, unsigned int val)
wmcodec_write(reg, val);
}
-static void wmc_set(unsigned int reg, unsigned int bits)
+void wmc_set(unsigned int reg, unsigned int bits)
{
wmc_write(reg, wmc_regs[reg] | bits);
}
-static void wmc_clear(unsigned int reg, unsigned int bits)
+void wmc_clear(unsigned int reg, unsigned int bits)
{
wmc_write(reg, wmc_regs[reg] & ~bits);
}
@@ -226,6 +226,14 @@ void audiohw_postinit(void)
wmc_write(WMC_AUDIO_INTERFACE, WMC_WL_16 | WMC_FMT_I2S);
wmc_write(WMC_DAC_CONTROL, WMC_DACOSR_128 | WMC_AMUTE);
+ wmc_set(WMC_INPUT_CTRL, WMC_R2_2INPPGA | WMC_L2_2INPPGA);
+ wmc_set(WMC_LEFT_INP_PGA_GAIN_CTRL, 0x3f);
+ wmc_set(WMC_RIGHT_INP_PGA_GAIN_CTRL, 0x3f);
+ wmc_set(WMC_LEFT_INP_PGA_GAIN_CTRL, 1<<8);
+ wmc_set(WMC_RIGHT_INP_PGA_GAIN_CTRL, 1<<8);
+ wmc_set(WMC_LEFT_ADC_BOOST_CTRL, (7<<3));
+ wmc_set(WMC_RIGHT_ADC_BOOST_CTRL, (7<<3));
+
/* Specific to HW clocking */
wmc_write_masked(WMC_CLOCK_GEN_CTRL, WMC_BCLKDIV_4 | WMC_MS,
WMC_BCLKDIV | WMC_MS | WMC_CLKSEL);