From aba3fe1d57f44c26b7508b2e9298a4990b5dcc6a Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Thu, 8 Oct 2026 10:26:40 +0200 Subject: [PATCH] YP-CP3: switch the headphone amplifier pin to GPIO The headphone amplifier enable, GPIO F2, shares its pin with SDRAM address line A12 and is A12 until switched in IOMUXB. Rockbox never switched it, so driving F2 never reached the amplifier: started from the Rockbox bootloader, playback and the FM radio were near silent and distorted. They only worked when the original firmware had run first, as it switches the pin. The 16 MB of SDRAM does not use A12. Tested on a YP-CP3 booted from the Rockbox bootloader. Co-Authored-By: Claude Opus 5.5 Change-Id: I40610aaf88f06fd4831d07174b0f66a4ba32204d --- firmware/drivers/audio/wm8751.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c index 2f6da1f4e0..006e9d8b78 100644 --- a/firmware/drivers/audio/wm8751.c +++ b/firmware/drivers/audio/wm8751.c @@ -188,7 +188,10 @@ void audiohw_preinit(void) or_l((1<<5), &GPIO1_ENABLE); or_l((1<<5), &GPIO1_FUNCTION); #elif defined(SAMSUNG_YPCP3) - /* headphone amplifier enable, GPIO F2 active high: off for now */ + /* headphone amplifier enable, GPIO F2 active high: off for now. The + * pin is SDRAM A12 until switched to GPIO, which the 16 MB of SDRAM + * does not need; the original firmware switches it. */ + SCU_IOMUXB_CON |= IOMUX_GPIO_F2; GPIO_PFDR &= ~(1<<2); GPIO_PFCON |= (1<<2); #endif