From 2190a31dac3ab2d1fe058b75e8b078a057e63b5e Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Tue, 29 Sep 2026 09:29:38 +0200 Subject: [PATCH] Samsung YP-CP3 define power hold pin Change-Id: I9fbfa00b37d3f2194df36f808fa01e2a2eab0e59 --- firmware/target/arm/rk27xx/ypcp3/power-ypcp3.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/firmware/target/arm/rk27xx/ypcp3/power-ypcp3.c b/firmware/target/arm/rk27xx/ypcp3/power-ypcp3.c index 12ad767a2d..f171f61069 100644 --- a/firmware/target/arm/rk27xx/ypcp3/power-ypcp3.c +++ b/firmware/target/arm/rk27xx/ypcp3/power-ypcp3.c @@ -23,18 +23,22 @@ #include "system.h" #include "usb.h" -/* TODO: the YP-CP3's power-hold line is not known yet. The rk27xx generic - * board holds power on PC0; driving a pin whose job on this board is unknown - * could do anything, so nothing is touched. Whatever the boot ROM or the - * original firmware left holding power stays holding it, and power_off() - * cannot switch the player off. */ +/* Power is held on by GPIO C0, active high - as on the rk27xx generic + * board. The original firmware raises it at boot and, to switch off, + * drives it low and waits for the supply to go. */ +#define POWER_HOLD_PIN (1 << 0) /* GPIO C0 */ + void power_init(void) { + GPIO_PCDR |= POWER_HOLD_PIN; + GPIO_PCCON |= POWER_HOLD_PIN; /* output */ } void power_off(void) { disable_irq(); + GPIO_PCCON |= POWER_HOLD_PIN; + GPIO_PCDR &= ~POWER_HOLD_PIN; while (1) { }