From d793a971d8d0a0510c8e6da026ee3212ae4bf9ad Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Wed, 13 Oct 2010 20:35:58 +0000 Subject: [PATCH] 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 --- firmware/drivers/audio/wm8751.c | 19 +++++++++++++++++++ firmware/target/coldfire/crt0.S | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) 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) GPIOL_OUTPUT_VAL |= 0x10; /* disable */ #endif +#ifdef MPIO_HD200 + /* control headphone output + * disabled on startup + */ + and_l((1<<25),&GPIO1_OUT); + or_l((1<<25), &GPIO1_ENABLE); + or_l((1<<25), &GPIO1_FUNCTION); +#endif + /* * 1. Switch on power supplies. * By default the WM8751 is in Standby Mode, the DAC is @@ -274,6 +283,11 @@ void audiohw_postinit(void) GPIOL_OUTPUT_VAL &= ~0x10; GPIOL_OUTPUT_EN |= 0x10; #endif + +#ifdef MPIO_HD200 + /* enable headphone output */ + or_l((1<<25),&GPIO1_OUT); +#endif } void audiohw_set_master_vol(int vol_l, int vol_r) @@ -327,6 +341,11 @@ void audiohw_close(void) /* 1. Set DACMU = 1 to soft-mute the audio DACs. */ audiohw_mute(true); +#ifdef MPIO_HD200 + /* disable headphone out */ + and_l(~(1<<25), &GPIO1_OUT); +#endif + /* 2. Disable all output buffers. */ wmcodec_write(PWRMGMT2, 0x0); 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: #ifdef MPIO_HD200 /* Set KEEP_ACT */ - move.l #0x02200000,%d0 + move.l #0x00200000,%d0 or.l %d0,(0xb4,%a1) or.l %d0,(0xb8,%a1) or.l %d0,(0xbc,%a1)