summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-07-07 03:51:50 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-07-07 03:51:50 +0000
commit68f975be8524e89fe582b20f3231f161b6f85e26 (patch)
treed89470a8f426c81299ff77590b5cb7a139aeaf91
parent276ff3bceb6bb365029b870d994a928c0c314e72 (diff)
downloadrockbox-68f975be8524e89fe582b20f3231f161b6f85e26.tar.gz
rockbox-68f975be8524e89fe582b20f3231f161b6f85e26.zip
e200: Better power_off to lock the system down while waiting for PMU to cut power.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13809 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/power-e200.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/target/arm/sandisk/sansa-e200/power-e200.c b/firmware/target/arm/sandisk/sansa-e200/power-e200.c
index a01654fced..dfa4211a91 100644
--- a/firmware/target/arm/sandisk/sansa-e200/power-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/power-e200.c
@@ -18,6 +18,7 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <stdbool.h> 20#include <stdbool.h>
21#include "system.h"
21#include "cpu.h" 22#include "cpu.h"
22#include "i2c-pp.h" 23#include "i2c-pp.h"
23 24
@@ -28,11 +29,25 @@ void power_init(void)
28void power_off(void) 29void power_off(void)
29{ 30{
30 char byte; 31 char byte;
32
33 /* Disable interrupts on this core */
34 set_interrupt_status(IRQ_FIQ_DISABLED, IRQ_FIQ_STATUS);
35
36 /* Mask them on both cores */
37 CPU_INT_CLR = -1;
38 COP_INT_CLR = -1;
39
40 /* Send shutdown command to PMU */
31 byte = i2c_readbyte(0x46, 0x20); 41 byte = i2c_readbyte(0x46, 0x20);
32 byte &= ~0x1; 42 byte &= ~0x1;
33 pp_i2c_send(0x46, 0x20, byte); 43 pp_i2c_send(0x46, 0x20, byte);
34 44
35 while(1); /* Wait for device to power off */ 45 /* Halt everything and wait for device to power off */
46 while (1)
47 {
48 CPU_CTL = PROC_SLEEP;
49 COP_CTL = PROC_SLEEP;
50 }
36} 51}
37 52
38bool charger_inserted(void) 53bool charger_inserted(void)