diff options
author | Michael Sparmann <theseven@rockbox.org> | 2009-10-09 20:36:09 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2009-10-09 20:36:09 +0000 |
commit | f0a96580ae84cdfbb09db568f296491c699b6a4b (patch) | |
tree | 73d71563c1ab314f322e0fe10fc80c3b7f698ab7 /firmware/export | |
parent | 8e3e5e7a59f741c16eafc5ff0672af2eb1404835 (diff) | |
download | rockbox-f0a96580ae84cdfbb09db568f296491c699b6a4b.tar.gz rockbox-f0a96580ae84cdfbb09db568f296491c699b6a4b.zip |
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
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config-ipodnano2g.h | 7 | ||||
-rw-r--r-- | firmware/export/nand.h | 3 | ||||
-rw-r--r-- | firmware/export/storage.h | 16 |
3 files changed, 26 insertions, 0 deletions
diff --git a/firmware/export/config-ipodnano2g.h b/firmware/export/config-ipodnano2g.h index 9d36a37046..641e88860b 100644 --- a/firmware/export/config-ipodnano2g.h +++ b/firmware/export/config-ipodnano2g.h | |||
@@ -39,6 +39,9 @@ | |||
39 | /* define this to enable JPEG decoding */ | 39 | /* define this to enable JPEG decoding */ |
40 | #define HAVE_JPEG | 40 | #define HAVE_JPEG |
41 | 41 | ||
42 | /* define this if the LCD can shut down */ | ||
43 | #define HAVE_LCD_SHUTDOWN | ||
44 | |||
42 | /* define this if you can invert the colours on your LCD */ | 45 | /* define this if you can invert the colours on your LCD */ |
43 | //#define HAVE_LCD_INVERT | 46 | //#define HAVE_LCD_INVERT |
44 | 47 | ||
@@ -58,6 +61,10 @@ | |||
58 | 61 | ||
59 | #define CONFIG_NAND NAND_SAMSUNG | 62 | #define CONFIG_NAND NAND_SAMSUNG |
60 | 63 | ||
64 | /* define this if at least one storage driver | ||
65 | needs to do cleanup on shutdown */ | ||
66 | #define HAVE_STORAGE_FLUSH | ||
67 | |||
61 | /* The NAND flash has 2048-byte sectors, and is our only storage */ | 68 | /* The NAND flash has 2048-byte sectors, and is our only storage */ |
62 | #define SECTOR_SIZE 2048 | 69 | #define SECTOR_SIZE 2048 |
63 | 70 | ||
diff --git a/firmware/export/nand.h b/firmware/export/nand.h index 67ebe73ddf..60b986dc2f 100644 --- a/firmware/export/nand.h +++ b/firmware/export/nand.h | |||
@@ -37,6 +37,9 @@ int nand_init(void); | |||
37 | void nand_close(void); | 37 | void nand_close(void); |
38 | int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 38 | int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
39 | int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 39 | int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
40 | #ifdef HAVE_STORAGE_FLUSH | ||
41 | int nand_flush(void); | ||
42 | #endif | ||
40 | void nand_spin(void); | 43 | void nand_spin(void); |
41 | int nand_spinup_time(void); /* ticks */ | 44 | int nand_spinup_time(void); /* ticks */ |
42 | 45 | ||
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index fc49d0ce31..cb4ad7fc3a 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -69,6 +69,9 @@ struct storage_info | |||
69 | #define storage_close() ata_close() | 69 | #define storage_close() ata_close() |
70 | #define storage_read_sectors(drive, start, count, buf) ata_read_sectors(IF_MD2(drive,) start, count, buf) | 70 | #define storage_read_sectors(drive, start, count, buf) ata_read_sectors(IF_MD2(drive,) start, count, buf) |
71 | #define storage_write_sectors(drive, start, count, buf) ata_write_sectors(IF_MD2(drive,) start, count, buf) | 71 | #define storage_write_sectors(drive, start, count, buf) ata_write_sectors(IF_MD2(drive,) start, count, buf) |
72 | #ifdef HAVE_STORAGE_FLUSH | ||
73 | #define storage_flush() (void)0 | ||
74 | #endif | ||
72 | #define storage_last_disk_activity() ata_last_disk_activity() | 75 | #define storage_last_disk_activity() ata_last_disk_activity() |
73 | #define storage_spinup_time() ata_spinup_time() | 76 | #define storage_spinup_time() ata_spinup_time() |
74 | #define storage_get_identify() ata_get_identify() | 77 | #define storage_get_identify() ata_get_identify() |
@@ -92,6 +95,9 @@ struct storage_info | |||
92 | #define storage_init() sd_init() | 95 | #define storage_init() sd_init() |
93 | #define storage_read_sectors(drive, start, count, buf) sd_read_sectors(IF_MD2(drive,) start, count, buf) | 96 | #define storage_read_sectors(drive, start, count, buf) sd_read_sectors(IF_MD2(drive,) start, count, buf) |
94 | #define storage_write_sectors(drive, start, count, buf) sd_write_sectors(IF_MD2(drive,) start, count, buf) | 97 | #define storage_write_sectors(drive, start, count, buf) sd_write_sectors(IF_MD2(drive,) start, count, buf) |
98 | #ifdef HAVE_STORAGE_FLUSH | ||
99 | #define storage_flush() (void)0 | ||
100 | #endif | ||
95 | #define storage_last_disk_activity() sd_last_disk_activity() | 101 | #define storage_last_disk_activity() sd_last_disk_activity() |
96 | #define storage_spinup_time() 0 | 102 | #define storage_spinup_time() 0 |
97 | #define storage_get_identify() sd_get_identify() | 103 | #define storage_get_identify() sd_get_identify() |
@@ -115,6 +121,9 @@ struct storage_info | |||
115 | #define storage_init() mmc_init() | 121 | #define storage_init() mmc_init() |
116 | #define storage_read_sectors(drive, start, count, buf) mmc_read_sectors(IF_MD2(drive,) start, count, buf) | 122 | #define storage_read_sectors(drive, start, count, buf) mmc_read_sectors(IF_MD2(drive,) start, count, buf) |
117 | #define storage_write_sectors(drive, start, count, buf) mmc_write_sectors(IF_MD2(drive,) start, count, buf) | 123 | #define storage_write_sectors(drive, start, count, buf) mmc_write_sectors(IF_MD2(drive,) start, count, buf) |
124 | #ifdef HAVE_STORAGE_FLUSH | ||
125 | #define storage_flush() (void)0 | ||
126 | #endif | ||
118 | #define storage_last_disk_activity() mmc_last_disk_activity() | 127 | #define storage_last_disk_activity() mmc_last_disk_activity() |
119 | #define storage_spinup_time() 0 | 128 | #define storage_spinup_time() 0 |
120 | #define storage_get_identify() mmc_get_identify() | 129 | #define storage_get_identify() mmc_get_identify() |
@@ -138,6 +147,9 @@ struct storage_info | |||
138 | #define storage_init() nand_init() | 147 | #define storage_init() nand_init() |
139 | #define storage_read_sectors(drive, start, count, buf) nand_read_sectors(IF_MD2(drive,) start, count, buf) | 148 | #define storage_read_sectors(drive, start, count, buf) nand_read_sectors(IF_MD2(drive,) start, count, buf) |
140 | #define storage_write_sectors(drive, start, count, buf) nand_write_sectors(IF_MD2(drive,) start, count, buf) | 149 | #define storage_write_sectors(drive, start, count, buf) nand_write_sectors(IF_MD2(drive,) start, count, buf) |
150 | #ifdef HAVE_STORAGE_FLUSH | ||
151 | #define storage_flush() nand_flush() | ||
152 | #endif | ||
141 | #define storage_last_disk_activity() nand_last_disk_activity() | 153 | #define storage_last_disk_activity() nand_last_disk_activity() |
142 | #define storage_spinup_time() 0 | 154 | #define storage_spinup_time() 0 |
143 | #define storage_get_identify() nand_get_identify() | 155 | #define storage_get_identify() nand_get_identify() |
@@ -161,6 +173,9 @@ struct storage_info | |||
161 | #define storage_init() ramdisk_init() | 173 | #define storage_init() ramdisk_init() |
162 | #define storage_read_sectors(drive, start, count, buf) ramdisk_read_sectors(IF_MD2(drive,) start, count, buf) | 174 | #define storage_read_sectors(drive, start, count, buf) ramdisk_read_sectors(IF_MD2(drive,) start, count, buf) |
163 | #define storage_write_sectors(drive, start, count, buf) ramdisk_write_sectors(IF_MD2(drive,) start, count, buf) | 175 | #define storage_write_sectors(drive, start, count, buf) ramdisk_write_sectors(IF_MD2(drive,) start, count, buf) |
176 | #ifdef HAVE_STORAGE_FLUSH | ||
177 | #define storage_flush() (void)0 | ||
178 | #endif | ||
164 | #define storage_last_disk_activity() ramdisk_last_disk_activity() | 179 | #define storage_last_disk_activity() ramdisk_last_disk_activity() |
165 | #define storage_spinup_time() 0 | 180 | #define storage_spinup_time() 0 |
166 | #define storage_get_identify() ramdisk_get_identify() | 181 | #define storage_get_identify() ramdisk_get_identify() |
@@ -187,6 +202,7 @@ int storage_soft_reset(void); | |||
187 | int storage_init(void); | 202 | int storage_init(void); |
188 | int storage_read_sectors(int drive, unsigned long start, int count, void* buf); | 203 | int storage_read_sectors(int drive, unsigned long start, int count, void* buf); |
189 | int storage_write_sectors(int drive, unsigned long start, int count, const void* buf); | 204 | int storage_write_sectors(int drive, unsigned long start, int count, const void* buf); |
205 | int storage_flush(void); | ||
190 | void storage_spin(void); | 206 | void storage_spin(void); |
191 | void storage_spindown(int seconds); | 207 | void storage_spindown(int seconds); |
192 | long storage_last_disk_activity(void); | 208 | long storage_last_disk_activity(void); |