diff options
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 6 | ||||
-rw-r--r-- | apps/plugins/clock/clock_settings.c | 2 | ||||
-rw-r--r-- | apps/plugins/jpeg/jpeg.c | 2 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/disk_buf.c | 6 | ||||
-rw-r--r-- | apps/plugins/video.c | 2 | ||||
-rw-r--r-- | apps/plugins/wavplay.c | 2 | ||||
-rw-r--r-- | firmware/drivers/sd.c | 13 | ||||
-rw-r--r-- | firmware/export/mmc.h | 3 | ||||
-rw-r--r-- | firmware/export/nand.h | 3 | ||||
-rw-r--r-- | firmware/export/sd.h | 3 | ||||
-rw-r--r-- | firmware/export/storage.h | 18 | ||||
-rw-r--r-- | firmware/target/arm/ata-nand-telechips.c | 13 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/ata-nand-s5l8700.c | 23 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c | 28 |
15 files changed, 29 insertions, 97 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 84200bbf05..4b7eb28b3d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -284,9 +284,11 @@ static const struct plugin_api rockbox_api = { | |||
284 | fdprintf, | 284 | fdprintf, |
285 | read_line, | 285 | read_line, |
286 | settings_parseline, | 286 | settings_parseline, |
287 | #ifdef HAVE_DISK_STORAGE | ||
287 | storage_sleep, | 288 | storage_sleep, |
288 | storage_spin, | 289 | storage_spin, |
289 | storage_spindown, | 290 | storage_spindown, |
291 | #endif | ||
290 | #if USING_STORAGE_CALLBACK | 292 | #if USING_STORAGE_CALLBACK |
291 | register_storage_idle_func, | 293 | register_storage_idle_func, |
292 | unregister_storage_idle_func, | 294 | unregister_storage_idle_func, |
diff --git a/apps/plugin.h b/apps/plugin.h index 74daa2a67b..ebb2518c78 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -129,12 +129,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
129 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 129 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
130 | 130 | ||
131 | /* increase this every time the api struct changes */ | 131 | /* increase this every time the api struct changes */ |
132 | #define PLUGIN_API_VERSION 162 | 132 | #define PLUGIN_API_VERSION 163 |
133 | 133 | ||
134 | /* update this to latest version if a change to the api struct breaks | 134 | /* update this to latest version if a change to the api struct breaks |
135 | backwards compatibility (and please take the opportunity to sort in any | 135 | backwards compatibility (and please take the opportunity to sort in any |
136 | new function which are "waiting" at the end of the function table) */ | 136 | new function which are "waiting" at the end of the function table) */ |
137 | #define PLUGIN_MIN_API_VERSION 162 | 137 | #define PLUGIN_MIN_API_VERSION 163 |
138 | 138 | ||
139 | /* plugin return codes */ | 139 | /* plugin return codes */ |
140 | enum plugin_status { | 140 | enum plugin_status { |
@@ -395,9 +395,11 @@ struct plugin_api { | |||
395 | int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); | 395 | int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); |
396 | int (*read_line)(int fd, char* buffer, int buffer_size); | 396 | int (*read_line)(int fd, char* buffer, int buffer_size); |
397 | bool (*settings_parseline)(char* line, char** name, char** value); | 397 | bool (*settings_parseline)(char* line, char** name, char** value); |
398 | #ifdef HAVE_DISK_STORAGE | ||
398 | void (*storage_sleep)(void); | 399 | void (*storage_sleep)(void); |
399 | void (*storage_spin)(void); | 400 | void (*storage_spin)(void); |
400 | void (*storage_spindown)(int seconds); | 401 | void (*storage_spindown)(int seconds); |
402 | #endif | ||
401 | #if USING_STORAGE_CALLBACK | 403 | #if USING_STORAGE_CALLBACK |
402 | void (*register_storage_idle_func)(storage_idle_notify function); | 404 | void (*register_storage_idle_func)(storage_idle_notify function); |
403 | void (*unregister_storage_idle_func)(storage_idle_notify function, bool run); | 405 | void (*unregister_storage_idle_func)(storage_idle_notify function, bool run); |
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index d765cbb0da..ef3114a943 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c | |||
@@ -173,7 +173,9 @@ void load_settings(void){ | |||
173 | draw_message(display, MESSAGE_ERRLOAD, 1); | 173 | draw_message(display, MESSAGE_ERRLOAD, 1); |
174 | display->update(); | 174 | display->update(); |
175 | } | 175 | } |
176 | #ifdef HAVE_DISK_STORAGE | ||
176 | rb->storage_sleep(); | 177 | rb->storage_sleep(); |
178 | #endif | ||
177 | rb->sleep(HZ); | 179 | rb->sleep(HZ); |
178 | } | 180 | } |
179 | 181 | ||
diff --git a/apps/plugins/jpeg/jpeg.c b/apps/plugins/jpeg/jpeg.c index fc98834a7d..685122bb1a 100644 --- a/apps/plugins/jpeg/jpeg.c +++ b/apps/plugins/jpeg/jpeg.c | |||
@@ -1038,7 +1038,9 @@ int load_and_show(char* filename) | |||
1038 | else if(immediate_ata_off) | 1038 | else if(immediate_ata_off) |
1039 | { | 1039 | { |
1040 | /* running slideshow and time is long enough: power down disk */ | 1040 | /* running slideshow and time is long enough: power down disk */ |
1041 | #ifdef HAVE_DISK_STORAGE | ||
1041 | rb->storage_sleep(); | 1042 | rb->storage_sleep(); |
1043 | #endif | ||
1042 | } | 1044 | } |
1043 | #endif | 1045 | #endif |
1044 | 1046 | ||
diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index defd8ef81d..4328606a1e 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c | |||
@@ -172,7 +172,9 @@ static inline void disk_buf_buffer(void) | |||
172 | if (!stream_get_window(&sw)) | 172 | if (!stream_get_window(&sw)) |
173 | { | 173 | { |
174 | disk_buf.state = TSTATE_DATA; | 174 | disk_buf.state = TSTATE_DATA; |
175 | #ifdef HAVE_DISK_STORAGE | ||
175 | rb->storage_sleep(); | 176 | rb->storage_sleep(); |
177 | #endif | ||
176 | break; | 178 | break; |
177 | } | 179 | } |
178 | 180 | ||
@@ -187,7 +189,9 @@ static inline void disk_buf_buffer(void) | |||
187 | /* Free space is less than one page */ | 189 | /* Free space is less than one page */ |
188 | disk_buf.state = TSTATE_DATA; | 190 | disk_buf.state = TSTATE_DATA; |
189 | disk_buf.low_wm = DISK_BUF_LOW_WATERMARK; | 191 | disk_buf.low_wm = DISK_BUF_LOW_WATERMARK; |
192 | #ifdef HAVE_DISK_STORAGE | ||
190 | rb->storage_sleep(); | 193 | rb->storage_sleep(); |
194 | #endif | ||
191 | break; | 195 | break; |
192 | } | 196 | } |
193 | 197 | ||
@@ -209,7 +213,9 @@ static inline void disk_buf_buffer(void) | |||
209 | { | 213 | { |
210 | /* Error or end of stream */ | 214 | /* Error or end of stream */ |
211 | disk_buf.state = TSTATE_EOS; | 215 | disk_buf.state = TSTATE_EOS; |
216 | #ifdef HAVE_DISK_STORAGE | ||
212 | rb->storage_sleep(); | 217 | rb->storage_sleep(); |
218 | #endif | ||
213 | break; | 219 | break; |
214 | } | 220 | } |
215 | 221 | ||
diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 6b0a47c7c6..8ead0a72f3 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c | |||
@@ -681,7 +681,9 @@ int PlayTick(int fd) | |||
681 | #endif | 681 | #endif |
682 | ) | 682 | ) |
683 | { | 683 | { |
684 | #ifdef HAVE_DISK_STORAGE | ||
684 | rb->storage_sleep(); /* no point in leaving the disk run til timeout */ | 685 | rb->storage_sleep(); /* no point in leaving the disk run til timeout */ |
686 | #endif | ||
685 | gPlay.bDiskSleep = true; | 687 | gPlay.bDiskSleep = true; |
686 | } | 688 | } |
687 | 689 | ||
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index 368d8e3475..9cb784b54d 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c | |||
@@ -3596,7 +3596,9 @@ int play_file(char* filename) | |||
3596 | if (free_space <= 0) | 3596 | if (free_space <= 0) |
3597 | { | 3597 | { |
3598 | filling = false; | 3598 | filling = false; |
3599 | #ifdef HAVE_DISK_STORAGE | ||
3599 | rb->storage_sleep(); | 3600 | rb->storage_sleep(); |
3601 | #endif | ||
3600 | } | 3602 | } |
3601 | else | 3603 | else |
3602 | { | 3604 | { |
diff --git a/firmware/drivers/sd.c b/firmware/drivers/sd.c index 4034b9453d..fdc05c73b7 100644 --- a/firmware/drivers/sd.c +++ b/firmware/drivers/sd.c | |||
@@ -66,19 +66,6 @@ void sd_parse_csd(tCardInfo *card) | |||
66 | logf("nsac: %d taac: %d r2w: %d", card->nsac, card->taac, card->r2w_factor); | 66 | logf("nsac: %d taac: %d r2w: %d", card->nsac, card->taac, card->r2w_factor); |
67 | } | 67 | } |
68 | 68 | ||
69 | void sd_sleep(void) | ||
70 | { | ||
71 | } | ||
72 | |||
73 | void sd_spin(void) | ||
74 | { | ||
75 | } | ||
76 | |||
77 | void sd_spindown(int seconds) | ||
78 | { | ||
79 | (void)seconds; | ||
80 | } | ||
81 | |||
82 | #ifdef STORAGE_GET_INFO | 69 | #ifdef STORAGE_GET_INFO |
83 | void sd_get_info(IF_MV2(int drive,) struct storage_info *info) | 70 | void sd_get_info(IF_MV2(int drive,) struct storage_info *info) |
84 | { | 71 | { |
diff --git a/firmware/export/mmc.h b/firmware/export/mmc.h index 06d99d219e..bd4b7f93ec 100644 --- a/firmware/export/mmc.h +++ b/firmware/export/mmc.h | |||
@@ -28,8 +28,6 @@ | |||
28 | struct storage_info; | 28 | struct storage_info; |
29 | 29 | ||
30 | void mmc_enable(bool on); | 30 | void mmc_enable(bool on); |
31 | void mmc_spindown(int seconds); | ||
32 | void mmc_sleep(void); | ||
33 | void mmc_sleepnow(void); | 31 | void mmc_sleepnow(void); |
34 | bool mmc_disk_is_active(void); | 32 | bool mmc_disk_is_active(void); |
35 | int mmc_soft_reset(void); | 33 | int mmc_soft_reset(void); |
@@ -37,7 +35,6 @@ int mmc_init(void); | |||
37 | void mmc_close(void); | 35 | void mmc_close(void); |
38 | int mmc_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); | 36 | int mmc_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); |
39 | int mmc_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); | 37 | int mmc_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); |
40 | void mmc_spin(void); | ||
41 | int mmc_spinup_time(void); | 38 | int mmc_spinup_time(void); |
42 | 39 | ||
43 | #ifdef STORAGE_GET_INFO | 40 | #ifdef STORAGE_GET_INFO |
diff --git a/firmware/export/nand.h b/firmware/export/nand.h index a5b0a1ceee..64416b9de5 100644 --- a/firmware/export/nand.h +++ b/firmware/export/nand.h | |||
@@ -28,15 +28,12 @@ | |||
28 | struct storage_info; | 28 | struct storage_info; |
29 | 29 | ||
30 | void nand_enable(bool on); | 30 | void nand_enable(bool on); |
31 | void nand_spindown(int seconds); | ||
32 | void nand_sleep(void); | ||
33 | bool nand_disk_is_active(void); | 31 | bool nand_disk_is_active(void); |
34 | int nand_soft_reset(void); | 32 | int nand_soft_reset(void); |
35 | int nand_init(void); | 33 | int nand_init(void); |
36 | void nand_close(void); | 34 | void nand_close(void); |
37 | int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); | 35 | int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); |
38 | int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); | 36 | int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); |
39 | void nand_spin(void); | ||
40 | 37 | ||
41 | #ifdef STORAGE_GET_INFO | 38 | #ifdef STORAGE_GET_INFO |
42 | void nand_get_info(IF_MV2(int drive,) struct storage_info *info); | 39 | void nand_get_info(IF_MV2(int drive,) struct storage_info *info); |
diff --git a/firmware/export/sd.h b/firmware/export/sd.h index d313a4c2e1..f100f3025f 100644 --- a/firmware/export/sd.h +++ b/firmware/export/sd.h | |||
@@ -30,15 +30,12 @@ | |||
30 | struct storage_info; | 30 | struct storage_info; |
31 | 31 | ||
32 | void sd_enable(bool on); | 32 | void sd_enable(bool on); |
33 | void sd_spindown(int seconds); | ||
34 | void sd_sleep(void); | ||
35 | bool sd_disk_is_active(void); | 33 | bool sd_disk_is_active(void); |
36 | int sd_soft_reset(void); | 34 | int sd_soft_reset(void); |
37 | int sd_init(void); | 35 | int sd_init(void); |
38 | void sd_close(void); | 36 | void sd_close(void); |
39 | int sd_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); | 37 | int sd_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); |
40 | int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); | 38 | int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); |
41 | void sd_spin(void); | ||
42 | 39 | ||
43 | #ifdef STORAGE_GET_INFO | 40 | #ifdef STORAGE_GET_INFO |
44 | void sd_get_info(IF_MV2(int drive,) struct storage_info *info); | 41 | void sd_get_info(IF_MV2(int drive,) struct storage_info *info); |
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index 47d8abda52..73ec970635 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -81,9 +81,9 @@ struct storage_info | |||
81 | #define storage_present(drive) ata_present(IF_MV(drive)) | 81 | #define storage_present(drive) ata_present(IF_MV(drive)) |
82 | #endif | 82 | #endif |
83 | #elif (CONFIG_STORAGE & STORAGE_SD) | 83 | #elif (CONFIG_STORAGE & STORAGE_SD) |
84 | #define storage_spindown sd_spindown | 84 | #define storage_spindown(seconds) (void)0 |
85 | #define storage_sleep sd_sleep | 85 | #define storage_sleep() (void)0 |
86 | #define storage_spin sd_spin | 86 | #define storage_spin() (void)0 |
87 | 87 | ||
88 | #define storage_enable(on) sd_enable(on) | 88 | #define storage_enable(on) sd_enable(on) |
89 | #define storage_sleepnow() sd_sleepnow() | 89 | #define storage_sleepnow() sd_sleepnow() |
@@ -105,9 +105,9 @@ struct storage_info | |||
105 | #define storage_present(drive) sd_present(IF_MV(drive)) | 105 | #define storage_present(drive) sd_present(IF_MV(drive)) |
106 | #endif | 106 | #endif |
107 | #elif (CONFIG_STORAGE & STORAGE_MMC) | 107 | #elif (CONFIG_STORAGE & STORAGE_MMC) |
108 | #define storage_spindown mmc_spindown | 108 | #define storage_spindown(seconds) (void)0 |
109 | #define storage_sleep mmc_sleep | 109 | #define storage_sleep() (void)0 |
110 | #define storage_spin mmc_spin | 110 | #define storage_spin() (void)0 |
111 | 111 | ||
112 | #define storage_enable(on) mmc_enable(on) | 112 | #define storage_enable(on) mmc_enable(on) |
113 | #define storage_sleepnow() mmc_sleepnow() | 113 | #define storage_sleepnow() mmc_sleepnow() |
@@ -129,9 +129,9 @@ struct storage_info | |||
129 | #define storage_present(drive) mmc_present(IF_MV(drive)) | 129 | #define storage_present(drive) mmc_present(IF_MV(drive)) |
130 | #endif | 130 | #endif |
131 | #elif (CONFIG_STORAGE & STORAGE_NAND) | 131 | #elif (CONFIG_STORAGE & STORAGE_NAND) |
132 | #define storage_spindown nand_spindown | 132 | #define storage_spindown(seconds) (void)0 |
133 | #define storage_sleep nand_sleep | 133 | #define storage_sleep() (void)0 |
134 | #define storage_spin nand_spin | 134 | #define storage_spin() (void)0 |
135 | 135 | ||
136 | #define storage_enable(on) (void)0 | 136 | #define storage_enable(on) (void)0 |
137 | #define storage_sleepnow() nand_sleepnow() | 137 | #define storage_sleepnow() nand_sleepnow() |
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c index 8bef57ee21..698f2b9d42 100644 --- a/firmware/target/arm/ata-nand-telechips.c +++ b/firmware/target/arm/ata-nand-telechips.c | |||
@@ -900,16 +900,3 @@ long nand_last_disk_activity(void) | |||
900 | { | 900 | { |
901 | return last_disk_activity; | 901 | return last_disk_activity; |
902 | } | 902 | } |
903 | |||
904 | void nand_sleep(void) | ||
905 | { | ||
906 | } | ||
907 | |||
908 | void nand_spin(void) | ||
909 | { | ||
910 | } | ||
911 | |||
912 | void nand_spindown(int seconds) | ||
913 | { | ||
914 | (void)seconds; | ||
915 | } | ||
diff --git a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c index ee1e581270..183ef18f40 100644 --- a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c +++ b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c | |||
@@ -64,29 +64,6 @@ int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count, | |||
64 | return 0; | 64 | return 0; |
65 | } | 65 | } |
66 | 66 | ||
67 | void nand_spindown(int seconds) | ||
68 | { | ||
69 | (void)seconds; | ||
70 | } | ||
71 | |||
72 | bool nand_disk_is_active(void) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | void nand_sleep(void) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | void nand_spin(void) | ||
82 | { | ||
83 | } | ||
84 | |||
85 | int nand_soft_reset(void) | ||
86 | { | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | void nand_enable(bool on) | 67 | void nand_enable(bool on) |
91 | { | 68 | { |
92 | (void)on; | 69 | (void)on; |
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c index d9189280e8..28325033b0 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-nand-jz4740.c | |||
@@ -685,34 +685,6 @@ int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const | |||
685 | return -1; | 685 | return -1; |
686 | } | 686 | } |
687 | 687 | ||
688 | void nand_spindown(int seconds) | ||
689 | { | ||
690 | /* null */ | ||
691 | (void)seconds; | ||
692 | } | ||
693 | |||
694 | bool nand_disk_is_active(void) | ||
695 | { | ||
696 | /* null */ | ||
697 | return false; | ||
698 | } | ||
699 | |||
700 | void nand_sleep(void) | ||
701 | { | ||
702 | /* null */ | ||
703 | } | ||
704 | |||
705 | void nand_spin(void) | ||
706 | { | ||
707 | /* null */ | ||
708 | } | ||
709 | |||
710 | int nand_soft_reset(void) | ||
711 | { | ||
712 | /* null */ | ||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | void nand_enable(bool on) | 688 | void nand_enable(bool on) |
717 | { | 689 | { |
718 | /* null - flash controller is enabled/disabled as needed. */ | 690 | /* null - flash controller is enabled/disabled as needed. */ |