Samsung YP-CP3 define power hold pin

Change-Id: I9fbfa00b37d3f2194df36f808fa01e2a2eab0e59
This commit is contained in:
Marcin Bukat 2026-09-29 09:29:38 +02:00
parent 0dc08e53a9
commit 2190a31dac

View file

@ -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)
{
}