From f0a96580ae84cdfbb09db568f296491c699b6a4b Mon Sep 17 00:00:00 2001 From: Michael Sparmann Date: Fri, 9 Oct 2009 20:36:09 +0000 Subject: 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 --- firmware/storage.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'firmware/storage.c') diff --git a/firmware/storage.c b/firmware/storage.c index cee7d1cc8b..d6700d1148 100644 --- a/firmware/storage.c +++ b/firmware/storage.c @@ -293,6 +293,35 @@ int storage_soft_reset(void) return rc; } +#ifdef HAVE_STORAGE_FLUSH +int storage_flush(void) +{ + int rc=0; + +#if (CONFIG_STORAGE & STORAGE_ATA) + //if ((rc=ata_flush())) return rc; +#endif + +#if (CONFIG_STORAGE & STORAGE_MMC) + //if ((rc=mmc_flush())) return rc; +#endif + +#if (CONFIG_STORAGE & STORAGE_SD) + //if ((rc=sd_flush())) return rc; +#endif + +#if (CONFIG_STORAGE & STORAGE_NAND) + if ((rc=nand_flush())) return rc; +#endif + +#if (CONFIG_STORAGE & STORAGE_RAMDISK) + //if ((rc=ramdisk_flush())) return rc; +#endif + + return rc; +} +#endif + void storage_spin(void) { #if (CONFIG_STORAGE & STORAGE_ATA) -- cgit v1.2.3