diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-21 18:10:36 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-21 18:10:36 +0000 |
commit | 5667682dd204a07c52f057506fd2eef05bf63f2e (patch) | |
tree | a5f4f3cb22751362a9ed7774698ca55d27819d16 /firmware/target/arm/imx31/gigabeat-s/system-imx31.c | |
parent | c3c15cce88481a2504eb492ba06b6a691d8e998d (diff) | |
download | rockbox-5667682dd204a07c52f057506fd2eef05bf63f2e.tar.gz rockbox-5667682dd204a07c52f057506fd2eef05bf63f2e.zip |
Gigabeat S: Implement charging and power control to charge from AC or USB. Hold MENU while plugging USB cable to charge from USB without connecting. Under Windows, plugging USB for charging only but not connecting still needs to be properly handled (driver popup issue) but it will charge when connected normally-- no issue under Linux. Some accomodating changes made to powermgmt.c will soon be made nicer.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19547 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/system-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/system-imx31.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c index 6d4797e9df..7d778fb8fd 100644 --- a/firmware/target/arm/imx31/gigabeat-s/system-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/system-imx31.c | |||
@@ -32,6 +32,31 @@ | |||
32 | #include "clkctl-imx31.h" | 32 | #include "clkctl-imx31.h" |
33 | #include "mc13783.h" | 33 | #include "mc13783.h" |
34 | 34 | ||
35 | /* Initialize the watchdog timer */ | ||
36 | void watchdog_init(unsigned int half_seconds) | ||
37 | { | ||
38 | uint16_t wcr = WDOG_WCR_WTw(half_seconds) | /* Timeout */ | ||
39 | WDOG_WCR_WOE | /* WDOG output enabled */ | ||
40 | WDOG_WCR_WDA | /* WDOG assertion - no effect */ | ||
41 | WDOG_WCR_SRS | /* System reset - no effect */ | ||
42 | WDOG_WCR_WRE; /* Generate a WDOG signal */ | ||
43 | |||
44 | imx31_clkctl_module_clock_gating(CG_WDOG, CGM_ON_RUN_WAIT); | ||
45 | |||
46 | WDOG_WCR = wcr; | ||
47 | WDOG_WSR = 0x5555; | ||
48 | WDOG_WCR = wcr | WDOG_WCR_WDE; /* Enable timer - hardware does | ||
49 | not allow a disable now */ | ||
50 | WDOG_WSR = 0xaaaa; | ||
51 | } | ||
52 | |||
53 | /* Service the watchdog timer */ | ||
54 | void watchdog_service(void) | ||
55 | { | ||
56 | WDOG_WSR = 0x5555; | ||
57 | WDOG_WSR = 0xaaaa; | ||
58 | } | ||
59 | |||
35 | int system_memory_guard(int newmode) | 60 | int system_memory_guard(int newmode) |
36 | { | 61 | { |
37 | (void)newmode; | 62 | (void)newmode; |