Sansa AMS: Disable DMA clocks when not in use

Add dma_retain() and dma_release() to reference count the users

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19344 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2008-12-04 22:54:06 +00:00
parent 3e4f3fe70e
commit e97191faa7
4 changed files with 30 additions and 3 deletions

View file

@ -568,6 +568,8 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
goto sd_transfer_error;
}
dma_retain();
while(count)
{
/* 128 * 512 = 2^16, and doesn't fit in the 16 bits of DATA_LENGTH
@ -628,6 +630,8 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
while (1)
{
dma_release();
#ifndef BOOTLOADER
sd_enable(false);
#endif