From 2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 1 Nov 2008 16:14:28 +0000 Subject: Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*. This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657 --- apps/buffering.c | 6 +++--- apps/codecs.c | 2 +- apps/debug_menu.c | 39 ++++++++++++++++++++++++++++++------ apps/gui/gwps.c | 8 ++++---- apps/main.c | 6 +++--- apps/misc.c | 6 +++--- apps/mpeg.c | 10 ++++----- apps/playback.c | 2 +- apps/playlist.c | 2 +- apps/plugin.c | 15 +++++++------- apps/plugin.h | 14 ++++++------- apps/plugins/battery_bench.c | 4 ++-- apps/plugins/clock/clock_settings.c | 2 +- apps/plugins/jpeg/jpeg.c | 8 ++++---- apps/plugins/mpegplayer/disk_buf.c | 6 +++--- apps/plugins/mpegplayer/stream_mgr.h | 2 +- apps/plugins/video.c | 2 +- apps/plugins/wavplay.c | 2 +- apps/recorder/pcm_record.c | 10 ++++----- apps/recorder/peakmeter.c | 4 ++-- apps/recorder/recording.c | 8 ++++---- apps/scrobbler.c | 2 +- apps/settings.c | 11 +++++----- apps/settings_list.c | 4 ++-- apps/tagcache.c | 2 +- apps/tagtree.c | 3 ++- apps/tree.c | 4 ++-- 27 files changed, 107 insertions(+), 77 deletions(-) (limited to 'apps') diff --git a/apps/buffering.c b/apps/buffering.c index d963a983a6..534a82d7b9 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -26,7 +26,7 @@ #include #include "buffering.h" -#include "ata.h" +#include "storage.h" #include "system.h" #include "thread.h" #include "file.h" @@ -832,7 +832,7 @@ static bool fill_buffer(void) { /* only spin the disk down if the filling wasn't interrupted by an event arriving in the queue. */ - ata_sleep(); + storage_sleep(); return false; } } @@ -1408,7 +1408,7 @@ void buffering_thread(void) * for simplicity until its done right */ #if MEM > 8 /* If the disk is spinning, take advantage by filling the buffer */ - else if (ata_disk_is_active() && queue_empty(&buffering_queue)) + else if (storage_disk_is_active() && queue_empty(&buffering_queue)) { if (num_handles > 0 && data_counters.useful <= high_watermark) send_event(BUFFER_EVENT_BUFFER_LOW, 0); diff --git a/apps/codecs.c b/apps/codecs.c index 53fa6755a8..8f5a0e36fd 100644 --- a/apps/codecs.c +++ b/apps/codecs.c @@ -43,7 +43,7 @@ #include "buffering.h" #include "mp3_playback.h" #include "backlight.h" -#include "ata.h" +#include "storage.h" #include "talk.h" #include "mp3data.h" #include "powermgmt.h" diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 26534cc101..b6038e7c89 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -59,13 +59,16 @@ #include "power.h" #include "usb.h" #include "rtc.h" -#include "ata.h" +#include "storage.h" #include "fat.h" #include "mas.h" #include "eeprom_24cxx.h" #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) #include "hotswap.h" #endif +#if (CONFIG_STORAGE & STORAGE_ATA) +#include "ata.h" +#endif #if CONFIG_TUNER #include "tuner.h" #include "radio.h" @@ -1731,11 +1734,13 @@ static bool view_battery(void) #ifndef SIMULATOR #if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) + #if (CONFIG_STORAGE & STORAGE_MMC) #define CARDTYPE "MMC" -#else +#elif (CONFIG_STORAGE & STORAGE_SD) #define CARDTYPE "microSD" #endif + static int disk_callback(int btn, struct gui_synclist *lists) { tCardInfo *card; @@ -1826,7 +1831,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) } return btn; } -#else /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ +#elif (CONFIG_STORAGE & STORAGE_ATA) static int disk_callback(int btn, struct gui_synclist *lists) { (void)lists; @@ -1860,7 +1865,7 @@ static int disk_callback(int btn, struct gui_synclist *lists) simplelist_addline(SIMPLELIST_ADD_LINE, "Free: %ld MB", free / 1024); simplelist_addline(SIMPLELIST_ADD_LINE, - "Spinup time: %d ms", ata_spinup_time * (1000/HZ)); + "Spinup time: %d ms", storage_spinup_time() * (1000/HZ)); i = identify_info[83] & (1<<3); simplelist_addline(SIMPLELIST_ADD_LINE, "Power mgmt: %s", i ? "enabled" : "unsupported"); @@ -1945,7 +1950,29 @@ static int disk_callback(int btn, struct gui_synclist *lists) "Cluster size: %d bytes", fat_get_cluster_size(IF_MV(0))); return btn; } +#else /* No SD, MMC or ATA */ +static int disk_callback(int btn, struct gui_synclist *lists) +{ + (void)btn; + (void)lists; + struct storage_info info; + storage_get_info(IF_MV2(0,)&info); + simplelist_addline(SIMPLELIST_ADD_LINE, "Vendor: %s", info.vendor); + simplelist_addline(SIMPLELIST_ADD_LINE, "Model: %s", info.product); + simplelist_addline(SIMPLELIST_ADD_LINE, "Firmware: %s", info.revision); + simplelist_addline(SIMPLELIST_ADD_LINE, + "Size: %ld MB", info.num_sectors*(info.sector_size/512)/2024); + unsigned long free; + fat_size( IF_MV2(0,) NULL, &free ); + simplelist_addline(SIMPLELIST_ADD_LINE, + "Free: %ld MB", free / 1024); + simplelist_addline(SIMPLELIST_ADD_LINE, + "Cluster size: %d bytes", fat_get_cluster_size(IF_MV(0))); + return btn; +} +#endif +#if (CONFIG_STORAGE & STORAGE_ATA) static bool dbg_identify_info(void) { int fd = creat("/identify_info.bin"); @@ -1960,7 +1987,7 @@ static bool dbg_identify_info(void) } return false; } -#endif /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */ +#endif static bool dbg_disk_info(void) { @@ -2504,7 +2531,7 @@ static const struct the_menu_item menuitems[] = { #endif #ifndef SIMULATOR { "View disk info", dbg_disk_info }, -#if !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) +#if (CONFIG_STORAGE & STORAGE_ATA) { "Dump ATA identify info", dbg_identify_info}, #endif #endif diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 4d50740182..9b6d6b5558 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -39,7 +39,7 @@ #include "audio.h" #include "usb.h" #include "status.h" -#include "ata.h" +#include "storage.h" #include "screens.h" #include "playlist.h" #ifdef HAVE_LCD_BITMAP @@ -184,7 +184,7 @@ long gui_wps_show(void) if (wps_state.paused) { settings_save(); #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) - call_ata_idle_notifys(true); + call_storage_idle_notifys(true); #endif } } @@ -322,7 +322,7 @@ long gui_wps_show(void) audio_pause(); settings_save(); #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF) - call_ata_idle_notifys(true); /* make sure resume info is saved */ + call_storage_idle_notifys(true); /* make sure resume info is saved */ #endif } break; @@ -701,7 +701,7 @@ long gui_wps_show(void) } if ( button ) - ata_spin(); + storage_spin(); } return GO_TO_ROOT; /* unreachable - just to reduce compiler warnings */ } diff --git a/apps/main.c b/apps/main.c index 50597699c5..111c5d1e78 100644 --- a/apps/main.c +++ b/apps/main.c @@ -20,7 +20,7 @@ ****************************************************************************/ #include "config.h" -#include "ata.h" +#include "storage.h" #include "disk.h" #include "fat.h" #include "lcd.h" @@ -289,7 +289,7 @@ static void init(void) #endif /* Must be done before any code uses the multi-screen APi */ gui_syncstatusbar_init(&statusbars); - ata_init(); + storage_init(); settings_reset(); settings_load(SETTINGS_ALL); gui_sync_wps_init(); @@ -427,7 +427,7 @@ static void init(void) } #endif - rc = ata_init(); + rc = storage_init(); if(rc) { #ifdef HAVE_LCD_BITMAP diff --git a/apps/misc.c b/apps/misc.c index 7c8ff0fbd8..02d8bed2d8 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -46,7 +46,7 @@ #include "audio.h" #include "mp3_playback.h" #include "settings.h" -#include "ata.h" +#include "storage.h" #include "ata_idle_notify.h" #include "kernel.h" #include "power.h" @@ -621,7 +621,7 @@ bool settings_parseline(char* line, char** name, char** value) static void system_flush(void) { tree_flush(); - call_ata_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ + call_storage_idle_notifys(true); /*doesnt work on usb and shutdown from ata thread */ } static void system_restore(void) @@ -635,7 +635,7 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter) (void)callback; (void)parameter; bookmark_autobookmark(); - call_ata_idle_notifys(true); + call_storage_idle_notifys(true); exit(0); #else long msg_id = -1; diff --git a/apps/mpeg.c b/apps/mpeg.c index 3c37a6b22f..f6d48bf42c 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -29,7 +29,7 @@ #include "metadata.h" #include "mpeg.h" #include "audio.h" -#include "ata.h" +#include "storage.h" #include "string.h" #include #include "thread.h" @@ -509,7 +509,7 @@ static void generate_postbuffer_events(void) static void recalculate_watermark(int bitrate) { int bytes_per_sec; - int time = ata_spinup_time; + int time = storage_spinup_time(); /* A bitrate of 0 probably means empty VBR header. We play safe and set a high threshold */ @@ -1589,7 +1589,7 @@ static void mpeg_thread(void) DEBUGF("0\n"); filling = false; generate_postbuffer_events(); - ata_sleep(); + storage_sleep(); break; } @@ -1947,7 +1947,7 @@ static void mpeg_thread(void) rc = fsync(mpeg_file); if (rc < 0) panicf("rec fls: %d", rc); - ata_sleep(); + storage_sleep(); break; case NEW_FILE: @@ -1957,7 +1957,7 @@ static void mpeg_thread(void) panicf("rec cls: %d", rc); mpeg_file = -1; update_header(); - ata_sleep(); + storage_sleep(); /* copy new filename */ strcpy(delayed_filename, recording_filename); diff --git a/apps/playback.c b/apps/playback.c index b2305949ac..ec4f4197a4 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -49,7 +49,7 @@ #include "mp3_playback.h" #include "usb.h" #include "status.h" -#include "ata.h" +#include "storage.h" #include "screens.h" #include "playlist.h" #include "playback.h" diff --git a/apps/playlist.c b/apps/playlist.c index cdcc0594c2..95e1b8262c 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1266,7 +1266,7 @@ static void playlist_thread(void) if (playlist->control_fd >= 0) { if (playlist->num_cached > 0) - register_ata_idle_func(playlist_flush_callback); + register_storage_idle_func(playlist_flush_callback); } if (!dirty_pointers) diff --git a/apps/plugin.c b/apps/plugin.c index 86e5c51128..e46e193129 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -38,6 +38,7 @@ #include "option_select.h" #include "talk.h" #include "version.h" +#include "storage.h" #if CONFIG_CHARGING #include "power.h" @@ -265,13 +266,13 @@ static const struct plugin_api rockbox_api = { fdprintf, read_line, settings_parseline, - ata_sleep, - ata_spin, - ata_spindown, -#if USING_ATA_CALLBACK - register_ata_idle_func, - unregister_ata_idle_func, -#endif /* USING_ATA_CALLBACK */ + storage_sleep, + storage_spin, + storage_spindown, +#if USING_STORAGE_CALLBACK + register_storage_idle_func, + unregister_storage_idle_func, +#endif /* USING_STORAGE_CALLBACK */ reload_directory, create_numbered_filename, file_exists, diff --git a/apps/plugin.h b/apps/plugin.h index 08d0b603ac..464614dcf9 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -379,13 +379,13 @@ struct plugin_api { int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); int (*read_line)(int fd, char* buffer, int buffer_size); bool (*settings_parseline)(char* line, char** name, char** value); - void (*ata_sleep)(void); - void (*ata_spin)(void); - void (*ata_spindown)(int seconds); -#if USING_ATA_CALLBACK - void (*register_ata_idle_func)(ata_idle_notify function); - void (*unregister_ata_idle_func)(ata_idle_notify function, bool run); -#endif /* USING_ATA_CALLBACK */ + void (*storage_sleep)(void); + void (*storage_spin)(void); + void (*storage_spindown)(int seconds); +#if USING_STORAGE_CALLBACK + void (*register_storage_idle_func)(storage_idle_notify function); + void (*unregister_storage_idle_func)(storage_idle_notify function, bool run); +#endif /* USING_STORAGE_CALLBACK */ void (*reload_directory)(void); char *(*create_numbered_filename)(char *buffer, const char *path, const char *prefix, const char *suffix, diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index ef4795a0e1..fff93b2a3a 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -344,7 +344,7 @@ void thread(void) bat[buf_idx].flags = charge_state(); #endif buf_idx++; - rb->register_ata_idle_func(flush_buffer); + rb->register_storage_idle_func(flush_buffer); } /* What to do when the measurement buffer is full: @@ -386,7 +386,7 @@ void thread(void) } /* unregister flush callback and flush to disk */ - rb->unregister_ata_idle_func(flush_buffer, true); + rb->unregister_storage_idle_func(flush_buffer, true); /* log end of bench and exit reason */ fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND); diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index 44a6f164a7..1147055ce5 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c @@ -173,7 +173,7 @@ void load_settings(void){ draw_message(display, MESSAGE_ERRLOAD, 1); display->update(); } - rb->ata_sleep(); + rb->storage_sleep(); rb->sleep(HZ); } diff --git a/apps/plugins/jpeg/jpeg.c b/apps/plugins/jpeg/jpeg.c index ed1b181e92..d8775dd176 100644 --- a/apps/plugins/jpeg/jpeg.c +++ b/apps/plugins/jpeg/jpeg.c @@ -438,14 +438,14 @@ int show_menu(void) /* return 1 to quit */ #if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE) /* change ata spindown time based on slideshow time setting */ immediate_ata_off = false; - rb->ata_spindown(rb->global_settings->disk_spindown); + rb->storage_spindown(rb->global_settings->disk_spindown); if (slideshow_enabled) { if(jpeg_settings.ss_timeout < 10) { /* slideshow times < 10s keep disk spinning */ - rb->ata_spindown(0); + rb->storage_spindown(0); } else if (!rb->mp3_is_playing()) { @@ -1057,7 +1057,7 @@ int load_and_show(char* filename) else if(immediate_ata_off) { /* running slideshow and time is long enough: power down disk */ - rb->ata_sleep(); + rb->storage_sleep(); } #endif @@ -1259,7 +1259,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE) /* set back ata spindown time in case we changed it */ - rb->ata_spindown(rb->global_settings->disk_spindown); + rb->storage_spindown(rb->global_settings->disk_spindown); #endif /* Turn on backlight timeout (revert to settings) */ diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index 7ba4025f1e..df5e005b50 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c @@ -171,7 +171,7 @@ static inline void disk_buf_buffer(void) if (!stream_get_window(&sw)) { disk_buf.state = TSTATE_DATA; - rb->ata_sleep(); + rb->storage_sleep(); break; } @@ -186,7 +186,7 @@ static inline void disk_buf_buffer(void) /* Free space is less than one page */ disk_buf.state = TSTATE_DATA; disk_buf.low_wm = DISK_BUF_LOW_WATERMARK; - rb->ata_sleep(); + rb->storage_sleep(); break; } @@ -208,7 +208,7 @@ static inline void disk_buf_buffer(void) { /* Error or end of stream */ disk_buf.state = TSTATE_EOS; - rb->ata_sleep(); + rb->storage_sleep(); break; } diff --git a/apps/plugins/mpegplayer/stream_mgr.h b/apps/plugins/mpegplayer/stream_mgr.h index c94fa84089..e3ea9207e6 100644 --- a/apps/plugins/mpegplayer/stream_mgr.h +++ b/apps/plugins/mpegplayer/stream_mgr.h @@ -153,7 +153,7 @@ static inline bool stream_can_seek(void) static inline void stream_keep_disk_active(void) { #ifdef HAVE_DISK_STORAGE - rb->ata_spin(); + rb->storage_spin(); #endif } diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 6a380b8e3c..1ba2b89e37 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -661,7 +661,7 @@ int PlayTick(int fd) #endif ) { - rb->ata_sleep(); /* no point in leaving the disk run til timeout */ + rb->storage_sleep(); /* no point in leaving the disk run til timeout */ gPlay.bDiskSleep = true; } diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c index c37b656d1c..dc0992abac 100644 --- a/apps/plugins/wavplay.c +++ b/apps/plugins/wavplay.c @@ -3598,7 +3598,7 @@ int play_file(char* filename) if (free_space <= 0) { filling = false; - rb->ata_sleep(); + rb->storage_sleep(); } else { diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index da4e9b7255..dbbc6901ec 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c @@ -24,7 +24,7 @@ #include "logf.h" #include "thread.h" #include -#include "ata.h" +#include "storage.h" #include "usb.h" #include "buffer.h" #include "general.h" @@ -162,7 +162,7 @@ static bool pcm_buffer_empty; /* all pcm chunks processed? */ static int low_watermark; /* Low watermark to stop flush */ static int high_watermark; /* max chunk limit for data flush */ static unsigned long spinup_time = 35*HZ/10; /* Fudged spinup time */ -static int last_ata_spinup_time = -1;/* previous spin time used */ +static int last_storage_spinup_time = -1;/* previous spin time used */ #ifdef HAVE_PRIORITY_SCHEDULING static int flood_watermark; /* boost thread priority when here */ #endif @@ -731,7 +731,7 @@ static void pcmrec_end_file(void) */ static void pcmrec_refresh_watermarks(void) { - logf("ata spinup: %d", ata_spinup_time); + logf("ata spinup: %d", storage_spinup_time()); /* set the low mark for when flushing stops if automatic */ low_watermark = (LOW_SECONDS*4*sample_rate + (enc_chunk_size-1)) @@ -755,7 +755,7 @@ static void pcmrec_refresh_watermarks(void) logf("flood at: %d", flood_watermark); #endif - spinup_time = last_ata_spinup_time = ata_spinup_time; + spinup_time = last_storage_spinup_time = storage_spinup_time(); /* write at 8s + st remaining in enc_buffer - range 12s to 20s total - default to 3.5s spinup. */ @@ -816,7 +816,7 @@ static void pcmrec_flush(unsigned flush_num) if (!is_recording) return; - if (ata_spinup_time != last_ata_spinup_time) + if (storage_spinup_time() != last_storage_spinup_time) pcmrec_refresh_watermarks(); /* enough available? no? then leave */ diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index ce0974a084..422b138020 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -26,7 +26,7 @@ #include "thread.h" #include "kernel.h" #include "settings.h" -#include "ata.h" +#include "storage.h" #include "lcd.h" #include "scrollbar.h" #include "gwps.h" @@ -1343,7 +1343,7 @@ int peak_meter_draw_get_btn(int action_context, int x[], int y[], * is active, it must not draw too much CPU power or a buffer overrun can * happen when saving a recording. As a compromise, poll only once per tick * when the disk is active, otherwise spin around as fast as possible. */ - bool highperf = !ata_disk_is_active(); + bool highperf = !storage_disk_is_active(); #endif bool dopeek = true; diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index d29db390c7..5a2aa096db 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -65,7 +65,7 @@ #include "errno.h" #include "talk.h" #include "sound.h" -#include "ata.h" +#include "storage.h" #include "splash.h" #include "screen_access.h" #include "action.h" @@ -298,7 +298,7 @@ static bool read_peak_levels(int *peak_l, int *peak_r, int *balance) peak_valid_mem[peak_time % 3] = *peak_l; if (((peak_valid_mem[0] == peak_valid_mem[1]) && (peak_valid_mem[1] == peak_valid_mem[2])) && - ((*peak_l < 32767) || ata_disk_is_active())) + ((*peak_l < 32767) || storage_disk_is_active())) return false; if (*peak_r > *peak_l) @@ -1034,7 +1034,7 @@ bool recording_screen(bool no_source) rec_status = RCSTAT_IN_RECSCREEN; #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) - ata_set_led_enabled(false); + storage_set_led_enabled(false); #endif #if CONFIG_CODEC == SWCODEC @@ -1905,7 +1905,7 @@ rec_abort: reload_directory(); #if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) - ata_set_led_enabled(true); + storage_set_led_enabled(true); #endif #if CONFIG_TUNER diff --git a/apps/scrobbler.c b/apps/scrobbler.c index acf1e9e4b0..b0f65158e8 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c @@ -180,7 +180,7 @@ static void add_to_cache(unsigned long play_length) logf("SCROBBLER: %s", scrobbler_entry.path); } else { cache_pos++; - register_ata_idle_func(scrobbler_flush_callback); + register_storage_idle_func(scrobbler_flush_callback); } } diff --git a/apps/settings.c b/apps/settings.c index 709e05e086..e15bfc8638 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -38,6 +38,7 @@ #include "rtc.h" #include "power.h" #include "ata_idle_notify.h" +#include "storage.h" #include "screens.h" #include "ctype.h" #include "file.h" @@ -582,11 +583,11 @@ void status_save(void) { update_runtime(); #ifdef HAVE_RTC_RAM - /* this will be done in the ata_callback if + /* this will be done in the storage_callback if target doesnt have rtc ram */ write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE); #else - register_ata_idle_func(flush_global_status_callback); + register_storage_idle_func(flush_global_status_callback); #endif } @@ -594,11 +595,11 @@ int settings_save(void) { update_runtime(); #ifdef HAVE_RTC_RAM - /* this will be done in the ata_callback if + /* this will be done in the storage_callback if target doesnt have rtc ram */ write_nvram_data(nvram_buffer,NVRAM_BLOCK_SIZE); #endif - register_ata_idle_func(flush_config_block_callback); + register_storage_idle_func(flush_config_block_callback); return 0; } @@ -768,7 +769,7 @@ void settings_apply(bool read_disk) buttonlight_set_timeout(global_settings.buttonlight_timeout); #endif #ifdef HAVE_DISK_STORAGE - ata_spindown(global_settings.disk_spindown); + storage_spindown(global_settings.disk_spindown); #endif #if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR) dac_line_in(global_settings.line_in); diff --git a/apps/settings_list.c b/apps/settings_list.c index 7f870b442e..3eeeffd8fd 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -23,7 +23,7 @@ #include #include #include "system.h" -#include "ata.h" +#include "storage.h" #include "lang.h" #include "talk.h" #include "lcd.h" @@ -714,7 +714,7 @@ const struct settings_list settings[] = { /* disk */ #ifdef HAVE_DISK_STORAGE INT_SETTING(0, disk_spindown, LANG_SPINDOWN, 5, "disk spindown", - UNIT_SEC, 3, 254, 1, NULL, NULL, ata_spindown), + UNIT_SEC, 3, 254, 1, NULL, NULL, storage_spindown), #endif /* HAVE_DISK_STORAGE */ /* browser */ CHOICE_SETTING(0, dirfilter, LANG_FILTER, SHOW_SUPPORTED, "show files", diff --git a/apps/tagcache.c b/apps/tagcache.c index 19469cde1a..b6cfcd5ef5 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3094,7 +3094,7 @@ static void run_command_queue(bool force) if (force || command_queue_is_full()) command_queue_sync_callback(); else - register_ata_idle_func(command_queue_sync_callback); + register_storage_idle_func(command_queue_sync_callback); } static void queue_command(int cmd, long idx_id, int tag, long data) diff --git a/apps/tagtree.c b/apps/tagtree.c index 7b05391640..7777a9f16d 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -48,6 +48,7 @@ #include "filetypes.h" #include "audio.h" #include "appevents.h" +#include "storage.h" #define FILE_SEARCH_INSTRUCTIONS ROCKBOX_DIR "/tagnavi.config" @@ -1057,7 +1058,7 @@ static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs, otherwise show it after the normal 1/2 second delay */ show_search_progress( #ifdef HAVE_DISK_STORAGE - ata_disk_is_active() + storage_disk_is_active() #else true #endif diff --git a/apps/tree.c b/apps/tree.c index 768223ec4d..dbc47e31b6 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -41,7 +41,7 @@ #include "settings.h" #include "status.h" #include "debug.h" -#include "ata.h" +#include "storage.h" #include "rolo.h" #include "icons.h" #include "lang.h" @@ -828,7 +828,7 @@ static int dirbrowse() return GO_TO_WPS; if (button) { - ata_spin(); + storage_spin(); } -- cgit v1.2.3