1
0
Fork 0
forked from len0rd/rockbox

D2: Implement power-off by putting the PCF50606 to sleep (and reduce timeout to 10 ticks). Set PCF outputs on init as per OF. Fix erroneous BOOTDIR definition and make HW Info screen show some more useful info.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17039 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rob Purchase 2008-04-08 20:43:04 +00:00
parent de65d065ef
commit 2fee08aff3
4 changed files with 38 additions and 32 deletions

View file

@ -49,6 +49,6 @@ int button_read_device(void);
/* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER
#define POWEROFF_COUNT 40
#define POWEROFF_COUNT 10
#endif /* _BUTTON_TARGET_H_ */

View file

@ -20,33 +20,38 @@
#include "kernel.h"
#include "system.h"
#include "power.h"
#include "pcf50606.h"
#include "cpu.h"
#ifndef SIMULATOR
void power_init(void)
{
#warning function not implemented
/* Set outputs as per OF - further investigation required. */
pcf50606_write(PCF5060X_DCDEC1, 0xe4);
pcf50606_write(PCF5060X_IOREGC, 0xf5);
pcf50606_write(PCF5060X_D1REGC1, 0xf5);
pcf50606_write(PCF5060X_D2REGC1, 0xe9);
pcf50606_write(PCF5060X_D3REGC1, 0xf8); /* WM8985 3.3v */
pcf50606_write(PCF5060X_DCUDC1, 0xe7);
pcf50606_write(PCF5060X_LPREGC1, 0x0);
pcf50606_write(PCF5060X_LPREGC2, 0x2);
}
void ide_power_enable(bool on)
{
#warning function not implemented
(void)on;
}
bool ide_powered(void)
{
#warning function not implemented
return true;
}
void power_off(void)
{
/* Disable interrupts on this core */
disable_interrupt(IRQ_FIQ_STATUS);
/* Shutdown: stop XIN oscillator */
CLKCTRL &= ~(1 << 31);
/* Forcibly cut power to SoC & peripherals by putting the PCF to sleep */
pcf50606_write(PCF5060X_OOCC1, GOSTDBY | CHGWAK | EXTONWAK);
}
#else /* SIMULATOR */