diff options
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index cb9fb53fcb..91b09aa555 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -351,7 +351,7 @@ static void handle_auto_poweroff(void) | |||
351 | TIME_AFTER(current_tick, last_disk_activity + timeout) && | 351 | TIME_AFTER(current_tick, last_disk_activity + timeout) && |
352 | TIME_AFTER(current_tick, last_charge_time + timeout)) | 352 | TIME_AFTER(current_tick, last_charge_time + timeout)) |
353 | { | 353 | { |
354 | power_off(); | 354 | shutdown_hw(); |
355 | } | 355 | } |
356 | } | 356 | } |
357 | else | 357 | else |
@@ -375,7 +375,7 @@ static void handle_auto_poweroff(void) | |||
375 | we cut the power */ | 375 | we cut the power */ |
376 | while(ata_disk_is_active()) | 376 | while(ata_disk_is_active()) |
377 | sleep(HZ); | 377 | sleep(HZ); |
378 | power_off(); | 378 | shutdown_hw(); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | } | 381 | } |
@@ -874,3 +874,18 @@ void powermgmt_init(void) | |||
874 | 874 | ||
875 | #endif /* SIMULATOR */ | 875 | #endif /* SIMULATOR */ |
876 | 876 | ||
877 | void shutdown_hw(void) { | ||
878 | mpeg_stop(); | ||
879 | ata_flush(); | ||
880 | ata_spindown(1); | ||
881 | while(ata_disk_is_active()) | ||
882 | sleep(HZ/10); | ||
883 | |||
884 | mp3_shutdown(); | ||
885 | #if CONFIG_KEYPAD == ONDIO_PAD | ||
886 | backlight_off(); | ||
887 | sleep(1); | ||
888 | lcd_set_contrast(0); | ||
889 | #endif | ||
890 | power_off(); | ||
891 | } | ||