diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-08-14 20:18:41 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-08-14 20:18:41 +0000 |
commit | 89f8f2e9355adf41fb960ce55d460bdf2de9e10a (patch) | |
tree | 846078179b7b20d0bf79909434afaf166879adf9 | |
parent | db405e19db9d62414666b298036719e41b753387 (diff) | |
download | rockbox-89f8f2e9355adf41fb960ce55d460bdf2de9e10a.tar.gz rockbox-89f8f2e9355adf41fb960ce55d460bdf2de9e10a.zip |
Ondios with backlight mod: * Make the backlight stay off in plain SVN builds (was always on before). * Switch off the light at the very end of shutdown to fake poweroff (the Ondio hardware stays powered until the user releases the button, or the hardware poweroff kicks in).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14342 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/power.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index aa76c2ecb6..17a3fecea1 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "power.h" | 25 | #include "power.h" |
26 | #include "logf.h" | 26 | #include "logf.h" |
27 | #include "usb.h" | 27 | #include "usb.h" |
28 | #include "backlight-target.h" | ||
28 | 29 | ||
29 | #if CONFIG_CHARGING == CHARGING_CONTROL | 30 | #if CONFIG_CHARGING == CHARGING_CONTROL |
30 | bool charger_enabled; | 31 | bool charger_enabled; |
@@ -66,6 +67,13 @@ void power_init(void) | |||
66 | PBCR2 &= ~0x0c00; /* GPIO for PB5 */ | 67 | PBCR2 &= ~0x0c00; /* GPIO for PB5 */ |
67 | or_b(0x20, &PBIORL); | 68 | or_b(0x20, &PBIORL); |
68 | or_b(0x20, &PBDRL); /* hold power */ | 69 | or_b(0x20, &PBDRL); /* hold power */ |
70 | #if defined(HAVE_MMC) && !defined(HAVE_BACKLIGHT) | ||
71 | /* Disable backlight on backlight-modded Ondios when running | ||
72 | * a standard build (always on otherwise). */ | ||
73 | PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ | ||
74 | and_b(~0x40, &PADRH); /* drive it low */ | ||
75 | or_b(0x40, &PAIORH); /* ..and output */ | ||
76 | #endif | ||
69 | #endif | 77 | #endif |
70 | #if CONFIG_CHARGING == CHARGING_CONTROL | 78 | #if CONFIG_CHARGING == CHARGING_CONTROL |
71 | PBCR2 &= ~0x0c00; /* GPIO for PB5 */ | 79 | PBCR2 &= ~0x0c00; /* GPIO for PB5 */ |
@@ -200,6 +208,10 @@ void power_off(void) | |||
200 | and_b(~0x10, &PBDRL); | 208 | and_b(~0x10, &PBDRL); |
201 | or_b(0x10, &PBIORL); | 209 | or_b(0x10, &PBIORL); |
202 | #elif defined(HAVE_POWEROFF_ON_PB5) | 210 | #elif defined(HAVE_POWEROFF_ON_PB5) |
211 | #if defined(HAVE_MMC) && defined(HAVE_BACKLIGHT) | ||
212 | /* Switch off the light on backlight-modded Ondios */ | ||
213 | __backlight_off(); | ||
214 | #endif | ||
203 | and_b(~0x20, &PBDRL); | 215 | and_b(~0x20, &PBDRL); |
204 | or_b(0x20, &PBIORL); | 216 | or_b(0x20, &PBIORL); |
205 | #else /* player */ | 217 | #else /* player */ |