diff options
| author | Mark Arigo <markarigo@gmail.com> | 2008-02-06 05:15:06 +0000 |
|---|---|---|
| committer | Mark Arigo <markarigo@gmail.com> | 2008-02-06 05:15:06 +0000 |
| commit | 8a7e626ec2f8cda5da8d66df9b92746c7a51d72e (patch) | |
| tree | 3fc6be8b5c88e2cd7a5a824048a5acda3badc0d7 | |
| parent | 9e8045cc802760f9ceb2a289323cb28e06c65c52 (diff) | |
| download | rockbox-8a7e626ec2f8cda5da8d66df9b92746c7a51d72e.zip rockbox-8a7e626ec2f8cda5da8d66df9b92746c7a51d72e.tar.gz rockbox-8a7e626ec2f8cda5da8d66df9b92746c7a51d72e.tar.bz2 rockbox-8a7e626ec2f8cda5da8d66df9b92746c7a51d72e.tar.xz | |
mrobe 100: (1) fix the sound volume by properly enabling headphone output, (2) disable line-out since there's no connector.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16230 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/audio/wm8751.c | 21 | ||||
| -rw-r--r-- | firmware/sound.c | 3 |
2 files changed, 23 insertions, 1 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c index c4e1a62..f228c17 100644 --- a/firmware/drivers/audio/wm8751.c +++ b/firmware/drivers/audio/wm8751.c @@ -28,6 +28,7 @@ #include "i2s.h" #include "audio.h" #include "audiohw.h" +#include "system.h" const struct sound_settings_info audiohw_settings[] = { [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25}, @@ -100,6 +101,13 @@ static int adaptivebass2hw(int value) /* Reset and power up the WM8751 */ void audiohw_preinit(void) { +#ifdef MROBE_100 + /* controls headphone ouput */ + GPIOL_ENABLE |= 0x10; + GPIOL_OUTPUT_EN |= 0x10; + GPIOL_OUTPUT_VAL |= 0x10; /* disable */ +#endif + #ifdef CPU_PP502x i2s_reset(); #endif @@ -132,9 +140,14 @@ void audiohw_postinit(void) wmcodec_write(PWRMGMT2, PWRMGMT2_DACL | PWRMGMT2_DACR); /* 4. Enable line and / or headphone output buffers as required. */ +#ifdef MROBE_100 + wmcodec_write(PWRMGMT2, PWRMGMT2_DACL | PWRMGMT2_DACR | + PWRMGMT2_LOUT1 | PWRMGMT2_ROUT1); +#else wmcodec_write(PWRMGMT2, PWRMGMT2_DACL | PWRMGMT2_DACR | PWRMGMT2_LOUT1 | PWRMGMT2_ROUT1 | PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2); +#endif wmcodec_write(ADDITIONAL1, ADDITIONAL1_TSDEN | ADDITIONAL1_TOEN | ADDITIONAL1_DMONOMIX_LLRR | ADDITIONAL1_VSEL_DEFAULT); @@ -143,6 +156,12 @@ void audiohw_postinit(void) wmcodec_write(RIGHTMIX2, RIGHTMIX2_RD2RO | RIGHTMIX2_RI2RO_DEFAULT); audiohw_mute(false); + +#ifdef MROBE_100 + /* enable headphone output */ + GPIOL_OUTPUT_VAL &= ~0x10; + GPIOL_OUTPUT_EN |= 0x10; +#endif } int audiohw_set_master_vol(int vol_l, int vol_r) @@ -158,12 +177,14 @@ int audiohw_set_master_vol(int vol_l, int vol_r) return 0; } +#ifndef MROBE_100 int audiohw_set_lineout_vol(int vol_l, int vol_r) { wmcodec_write(LOUT2, LOUT2_BITS | LOUT2_LOUT2VOL(vol_l)); wmcodec_write(ROUT2, ROUT2_BITS | ROUT2_ROUT2VOL(vol_r)); return 0; } +#endif void audiohw_set_bass(int value) { diff --git a/firmware/sound.c b/firmware/sound.c index 5a1a1e9..b4d1059 100644 --- a/firmware/sound.c +++ b/firmware/sound.c @@ -290,7 +290,8 @@ static void set_prescaled_volume(void) || defined(HAVE_WM8731) || defined(HAVE_WM8721) || defined(HAVE_WM8751) \ || defined(HAVE_AS3514) audiohw_set_master_vol(tenthdb2master(l), tenthdb2master(r)); -#if defined(HAVE_WM8975) || defined(HAVE_WM8758) || defined(HAVE_WM8751) +#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \ + || (defined(HAVE_WM8751) && !defined(MROBE_100)) audiohw_set_lineout_vol(tenthdb2master(0), tenthdb2master(0)); #endif |