summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-10-13 20:35:58 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-10-13 20:35:58 +0000
commitd793a971d8d0a0510c8e6da026ee3212ae4bf9ad (patch)
treef41501f6efa3b6701ee03fdfbfe6aa4b9a242aa8
parent29503eea8631348530a22c2e6ef452758821d81e (diff)
downloadrockbox-d793a971d8d0a0510c8e6da026ee3212ae4bf9ad.tar.gz
rockbox-d793a971d8d0a0510c8e6da026ee3212ae4bf9ad.zip
HD200 - GPIO57 is headphone output enable. Proper handling of this line fixes hissing noise after startup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28270 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/audio/wm8751.c19
-rw-r--r--firmware/target/coldfire/crt0.S2
2 files changed, 20 insertions, 1 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 5eb90b0178..1f2213c9a3 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -190,6 +190,15 @@ void audiohw_preinit(void)
190 GPIOL_OUTPUT_VAL |= 0x10; /* disable */ 190 GPIOL_OUTPUT_VAL |= 0x10; /* disable */
191#endif 191#endif
192 192
193#ifdef MPIO_HD200
194 /* control headphone output
195 * disabled on startup
196 */
197 and_l((1<<25),&GPIO1_OUT);
198 or_l((1<<25), &GPIO1_ENABLE);
199 or_l((1<<25), &GPIO1_FUNCTION);
200#endif
201
193 /* 202 /*
194 * 1. Switch on power supplies. 203 * 1. Switch on power supplies.
195 * By default the WM8751 is in Standby Mode, the DAC is 204 * By default the WM8751 is in Standby Mode, the DAC is
@@ -274,6 +283,11 @@ void audiohw_postinit(void)
274 GPIOL_OUTPUT_VAL &= ~0x10; 283 GPIOL_OUTPUT_VAL &= ~0x10;
275 GPIOL_OUTPUT_EN |= 0x10; 284 GPIOL_OUTPUT_EN |= 0x10;
276#endif 285#endif
286
287#ifdef MPIO_HD200
288 /* enable headphone output */
289 or_l((1<<25),&GPIO1_OUT);
290#endif
277} 291}
278 292
279void audiohw_set_master_vol(int vol_l, int vol_r) 293void audiohw_set_master_vol(int vol_l, int vol_r)
@@ -327,6 +341,11 @@ void audiohw_close(void)
327 /* 1. Set DACMU = 1 to soft-mute the audio DACs. */ 341 /* 1. Set DACMU = 1 to soft-mute the audio DACs. */
328 audiohw_mute(true); 342 audiohw_mute(true);
329 343
344#ifdef MPIO_HD200
345 /* disable headphone out */
346 and_l(~(1<<25), &GPIO1_OUT);
347#endif
348
330 /* 2. Disable all output buffers. */ 349 /* 2. Disable all output buffers. */
331 wmcodec_write(PWRMGMT2, 0x0); 350 wmcodec_write(PWRMGMT2, 0x0);
332 351
diff --git a/firmware/target/coldfire/crt0.S b/firmware/target/coldfire/crt0.S
index 38365c7d71..a6ef3beea3 100644
--- a/firmware/target/coldfire/crt0.S
+++ b/firmware/target/coldfire/crt0.S
@@ -278,7 +278,7 @@ start:
278 278
279#ifdef MPIO_HD200 279#ifdef MPIO_HD200
280 /* Set KEEP_ACT */ 280 /* Set KEEP_ACT */
281 move.l #0x02200000,%d0 281 move.l #0x00200000,%d0
282 or.l %d0,(0xb4,%a1) 282 or.l %d0,(0xb4,%a1)
283 or.l %d0,(0xb8,%a1) 283 or.l %d0,(0xb8,%a1)
284 or.l %d0,(0xbc,%a1) 284 or.l %d0,(0xbc,%a1)