diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-05-21 08:42:11 +0000 |
commit | a9c20f5789c13b486d217024a020f9d6163e2d51 (patch) | |
tree | 5da52ca9cc7a28ba21ced042cb739e6160d5f87b /firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |
parent | 5f796087b009fee1ae60904b0355cc7febe3330f (diff) | |
download | rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.tar.gz rockbox-a9c20f5789c13b486d217024a020f9d6163e2d51.zip |
Gigabeat S:
1) Rework event handling and static registration mechanism. No target-
specific code in mc13783 driver. GPIO event driver interfaces more
cleanly.
2) Somewhat related - enable thread priority for bootloader which is
desireable here (ffs is used for GPIO event enabling anyway and that
goes along with priority).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/power-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/power-imx31.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c index 53cdb7c315..8db59bdf0e 100644 --- a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |||
@@ -28,14 +28,11 @@ | |||
28 | 28 | ||
29 | static bool charger_detect = false; | 29 | static bool charger_detect = false; |
30 | 30 | ||
31 | void power_init(void) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | /* This is called from the mc13783 interrupt thread */ | 31 | /* This is called from the mc13783 interrupt thread */ |
36 | void set_charger_inserted(bool inserted) | 32 | void charger_detect_event(void) |
37 | { | 33 | { |
38 | charger_detect = inserted; | 34 | charger_detect = |
35 | mc13783_read(MC13783_INTERRUPT_SENSE0) & MC13783_CHGDETS; | ||
39 | } | 36 | } |
40 | 37 | ||
41 | bool charger_inserted(void) | 38 | bool charger_inserted(void) |
@@ -81,6 +78,15 @@ void power_off(void) | |||
81 | while (1); | 78 | while (1); |
82 | } | 79 | } |
83 | 80 | ||
81 | void power_init(void) | ||
82 | { | ||
83 | /* Poll initial state */ | ||
84 | charger_detect_event(); | ||
85 | |||
86 | /* Enable detect event */ | ||
87 | mc13783_enable_event(MC13783_CHGDET_EVENT); | ||
88 | } | ||
89 | |||
84 | #else /* SIMULATOR */ | 90 | #else /* SIMULATOR */ |
85 | 91 | ||
86 | bool charger_inserted(void) | 92 | bool charger_inserted(void) |