mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
Core changes to allow storage drivers to do cleanup on shutdown, and iPod Nano 2G shutdown code rework (FS#10668)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23057 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8e3e5e7a59
commit
f0a96580ae
12 changed files with 98 additions and 15 deletions
|
|
@ -36,9 +36,6 @@ long last_disk_activity = -1;
|
|||
/** static, private data **/
|
||||
static bool initialized = false;
|
||||
|
||||
static long next_yield = 0;
|
||||
#define MIN_YIELD_PERIOD 2000
|
||||
|
||||
/* API Functions */
|
||||
|
||||
void nand_led(bool onoff)
|
||||
|
|
@ -67,6 +64,10 @@ void nand_sleep(void)
|
|||
{
|
||||
}
|
||||
|
||||
void nand_sleepnow(void)
|
||||
{
|
||||
}
|
||||
|
||||
void nand_spin(void)
|
||||
{
|
||||
}
|
||||
|
|
@ -86,6 +87,13 @@ long nand_last_disk_activity(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_STORAGE_FLUSH
|
||||
int nand_flush(void)
|
||||
{
|
||||
return ftl_sync();
|
||||
}
|
||||
#endif
|
||||
|
||||
int nand_init(void)
|
||||
{
|
||||
if (ftl_init()) return 1;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "lcd.h"
|
||||
#include "system.h"
|
||||
#include "cpu.h"
|
||||
#include "pmu-target.h"
|
||||
|
||||
|
||||
/* The Nano 2G has two different LCD types. What we call "type 0"
|
||||
|
|
@ -124,10 +125,11 @@ void lcd_set_flip(bool yesno)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void lcd_off(void)
|
||||
void lcd_shutdown(void)
|
||||
{
|
||||
pmu_write(0x2b, 0); /* Kill the backlight, instantly. */
|
||||
pmu_write(0x29, 0);
|
||||
|
||||
if (lcd_type == 0)
|
||||
{
|
||||
s5l_lcd_write_cmd_data(R_DISPLAY_CONTROL_1, 0x232);
|
||||
|
|
@ -151,6 +153,11 @@ void lcd_off(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void lcd_off(void)
|
||||
{
|
||||
}
|
||||
|
||||
void lcd_on(void)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,4 +103,4 @@ void pmu_switch_power(int gate, int onoff)
|
|||
if (onoff) newval |= 1 << (2 * (gate - 4));
|
||||
pmu_write(0x3C, newval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,13 +32,6 @@
|
|||
|
||||
void power_off(void)
|
||||
{
|
||||
if (ftl_sync() != 0) panicf("Failed to unmount flash!");
|
||||
|
||||
pmu_write(0x2b, 0); /* Kill the backlight, instantly. */
|
||||
pmu_write(0x29, 0);
|
||||
|
||||
lcd_off();
|
||||
|
||||
pmu_switch_power(0, 0);
|
||||
pmu_switch_power(2, 0);
|
||||
pmu_switch_power(3, 0);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ int rtc_read_datetime(struct tm *tm)
|
|||
int rtc_write_datetime(const struct tm *tm)
|
||||
{
|
||||
unsigned int i;
|
||||
int rc, oldlevel;
|
||||
unsigned char buf[7];
|
||||
|
||||
buf[0] = tm->tm_sec;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue