diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.c | 3 | ||||
-rw-r--r-- | firmware/drivers/power.c | 25 |
2 files changed, 14 insertions, 14 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index ad9c8ca677..e430583d2d 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -197,10 +197,12 @@ void backlight_set_timeout(int index) | |||
197 | backlight_on(); | 197 | backlight_on(); |
198 | } | 198 | } |
199 | 199 | ||
200 | #ifdef HAVE_CHARGE_CTRL | ||
200 | bool backlight_get_on_when_charging(void) | 201 | bool backlight_get_on_when_charging(void) |
201 | { | 202 | { |
202 | return backlight_on_when_charging; | 203 | return backlight_on_when_charging; |
203 | } | 204 | } |
205 | #endif | ||
204 | 206 | ||
205 | void backlight_set_on_when_charging(bool yesno) | 207 | void backlight_set_on_when_charging(bool yesno) |
206 | { | 208 | { |
@@ -267,7 +269,6 @@ void backlight_off(void) {} | |||
267 | void backlight_tick(void) {} | 269 | void backlight_tick(void) {} |
268 | int backlight_get_timeout(void) {return 0;} | 270 | int backlight_get_timeout(void) {return 0;} |
269 | void backlight_set_timeout(int index) {(void)index;} | 271 | void backlight_set_timeout(int index) {(void)index;} |
270 | bool backlight_get_on_when_charging(void) {return 0;} | ||
271 | void backlight_set_on_when_charging(bool yesno) {(void)yesno;} | 272 | void backlight_set_on_when_charging(bool yesno) {(void)yesno;} |
272 | #ifdef HAVE_REMOTE_LCD | 273 | #ifdef HAVE_REMOTE_LCD |
273 | void remote_backlight_on(void) {} | 274 | void remote_backlight_on(void) {} |
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index 2d6c1c815c..66e479e1ce 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c | |||
@@ -120,11 +120,10 @@ bool charger_inserted(void) | |||
120 | #endif | 120 | #endif |
121 | } | 121 | } |
122 | 122 | ||
123 | #ifdef HAVE_CHARGE_CTRL | ||
123 | void charger_enable(bool on) | 124 | void charger_enable(bool on) |
124 | { | 125 | { |
125 | (void)on; | 126 | if(on) |
126 | #ifdef HAVE_CHARGE_CTRL | ||
127 | if(on) | ||
128 | { | 127 | { |
129 | and_b(~0x20, &PBDRL); | 128 | and_b(~0x20, &PBDRL); |
130 | charger_enabled = 1; | 129 | charger_enabled = 1; |
@@ -134,8 +133,8 @@ void charger_enable(bool on) | |||
134 | or_b(0x20, &PBDRL); | 133 | or_b(0x20, &PBDRL); |
135 | charger_enabled = 0; | 134 | charger_enabled = 0; |
136 | } | 135 | } |
137 | #endif | ||
138 | } | 136 | } |
137 | #endif | ||
139 | 138 | ||
140 | #ifdef HAVE_SPDIF_POWER | 139 | #ifdef HAVE_SPDIF_POWER |
141 | void spdif_power_enable(bool on) | 140 | void spdif_power_enable(bool on) |
@@ -165,7 +164,7 @@ void ide_power_enable(bool on) | |||
165 | P1 |= 0x08; | 164 | P1 |= 0x08; |
166 | else | 165 | else |
167 | P1 &= ~0x08; | 166 | P1 &= ~0x08; |
168 | #else | 167 | #else /* SH1 based archos */ |
169 | bool touched = false; | 168 | bool touched = false; |
170 | #ifdef NEEDS_ATA_POWER_ON | 169 | #ifdef NEEDS_ATA_POWER_ON |
171 | if(on) | 170 | if(on) |
@@ -177,7 +176,7 @@ void ide_power_enable(bool on) | |||
177 | #endif | 176 | #endif |
178 | touched = true; | 177 | touched = true; |
179 | } | 178 | } |
180 | #endif | 179 | #endif /* NEEDS_ATA_POWER_ON */ |
181 | #ifdef HAVE_ATA_POWER_OFF | 180 | #ifdef HAVE_ATA_POWER_OFF |
182 | if(!on) | 181 | if(!on) |
183 | { | 182 | { |
@@ -188,7 +187,7 @@ void ide_power_enable(bool on) | |||
188 | #endif | 187 | #endif |
189 | touched = true; | 188 | touched = true; |
190 | } | 189 | } |
191 | #endif | 190 | #endif /* HAVE_ATA_POWER_OFF */ |
192 | 191 | ||
193 | /* late port preparation, else problems with read/modify/write | 192 | /* late port preparation, else problems with read/modify/write |
194 | of other bits on same port, while input and floating high */ | 193 | of other bits on same port, while input and floating high */ |
@@ -202,9 +201,8 @@ void ide_power_enable(bool on) | |||
202 | PACR2 &= 0xFBFF; /* GPIO for PA5 */ | 201 | PACR2 &= 0xFBFF; /* GPIO for PA5 */ |
203 | #endif | 202 | #endif |
204 | } | 203 | } |
205 | #endif | 204 | #endif /* SH1 based archos */ |
206 | } | 205 | } |
207 | #endif /* !HAVE_MMC */ | ||
208 | 206 | ||
209 | 207 | ||
210 | bool ide_powered(void) | 208 | bool ide_powered(void) |
@@ -213,7 +211,7 @@ bool ide_powered(void) | |||
213 | return (GPIO_OUT & 0x80000000)?false:true; | 211 | return (GPIO_OUT & 0x80000000)?false:true; |
214 | #elif defined(GMINI_ARCH) | 212 | #elif defined(GMINI_ARCH) |
215 | return (P1 & 0x08?true:false); | 213 | return (P1 & 0x08?true:false); |
216 | #else | 214 | #else /* SH1 based archos */ |
217 | #if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) | 215 | #if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) |
218 | #ifdef ATA_POWER_PLAYERSTYLE | 216 | #ifdef ATA_POWER_PLAYERSTYLE |
219 | /* This is not correct for very old players, since these are unable to | 217 | /* This is not correct for very old players, since these are unable to |
@@ -223,17 +221,18 @@ bool ide_powered(void) | |||
223 | return false; /* would be floating low, disk off */ | 221 | return false; /* would be floating low, disk off */ |
224 | else | 222 | else |
225 | return (PBDRL & 0x10) != 0; | 223 | return (PBDRL & 0x10) != 0; |
226 | #else | 224 | #else /* !ATA_POWER_PLAYERSTYLE */ |
227 | if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */ | 225 | if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */ |
228 | return true; /* would be floating high, disk on */ | 226 | return true; /* would be floating high, disk on */ |
229 | else | 227 | else |
230 | return (PADRL & 0x20) != 0; | 228 | return (PADRL & 0x20) != 0; |
231 | #endif /* ATA_POWER_PLAYERSTYLE */ | 229 | #endif /* !ATA_POWER_PLAYERSTYLE */ |
232 | #else | 230 | #else /* !defined(NEEDS_ATA_POWER_ON) && !defined(HAVE_ATA_POWER_OFF) */ |
233 | return true; /* pretend always powered if not controlable */ | 231 | return true; /* pretend always powered if not controlable */ |
234 | #endif | 232 | #endif |
235 | #endif | 233 | #endif |
236 | } | 234 | } |
235 | #endif /* !HAVE_MMC */ | ||
237 | 236 | ||
238 | 237 | ||
239 | void power_off(void) | 238 | void power_off(void) |