mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 06:05:21 -05:00
Sansa AMS: disable SD clocks when not in use (copied from FS#9570)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19280 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
50519416ca
commit
ce851c0c67
1 changed files with 5 additions and 0 deletions
|
|
@ -405,6 +405,9 @@ int sd_init(void)
|
||||||
sd_init_card(SD_SLOT_AS3525);
|
sd_init_card(SD_SLOT_AS3525);
|
||||||
#endif
|
#endif
|
||||||
/* init mutex */
|
/* init mutex */
|
||||||
|
|
||||||
|
sd_enable(false);
|
||||||
|
|
||||||
mutex_init(&sd_mtx);
|
mutex_init(&sd_mtx);
|
||||||
|
|
||||||
queue_init(&sd_queue, true);
|
queue_init(&sd_queue, true);
|
||||||
|
|
@ -493,6 +496,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mutex_lock(&sd_mtx);
|
mutex_lock(&sd_mtx);
|
||||||
|
sd_enable(true);
|
||||||
|
|
||||||
#ifdef HAVE_MULTIVOLUME
|
#ifdef HAVE_MULTIVOLUME
|
||||||
if (drive != 0 && !card_detect_target())
|
if (drive != 0 && !card_detect_target())
|
||||||
|
|
@ -579,6 +583,7 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
sd_enable(false);
|
||||||
mutex_unlock(&sd_mtx);
|
mutex_unlock(&sd_mtx);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue