summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/pcm-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-12-04 22:54:02 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-12-04 22:54:02 +0000
commit3e4f3fe70e8ed404ea07c12e4fe9f5a25e55b16d (patch)
tree9f8dca59de06b196c88e5db4fe74f2ce5358d80d /firmware/target/arm/as3525/pcm-as3525.c
parent6aa807d32170eb463ede46397cb43c1c4088cbe9 (diff)
Sansa AMS: disable I2SOUT clocks when playback is stopped
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19343 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/pcm-as3525.c')
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index 0386cc3336..cf0333f24c 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -66,6 +66,9 @@ static void play_start_pcm(void)
dma_size -= size;
dma_start_addr += size;
+ CGU_PERI |= CGU_I2SOUT_APB_CLOCK_ENABLE;
+ CGU_AUDIO |= (1<<11);
+
dma_enable_channel(1, (void*)addr, (void*)I2SOUT_DATA, DMA_PERI_I2SOUT,
DMAC_FLOWCTRL_DMAC_MEM_TO_PERI, true, false, size >> 2, DMA_S1,
dma_callback);
@@ -98,6 +101,9 @@ void pcm_play_dma_stop(void)
{
dma_disable_channel(1);
dma_size = 0;
+
+ CGU_PERI &= ~CGU_I2SOUT_APB_CLOCK_ENABLE;
+ CGU_AUDIO &= ~(1<<11);
}
void pcm_play_dma_pause(bool pause)
@@ -112,8 +118,8 @@ void pcm_play_dma_init(void)
{
CGU_PERI |= CGU_I2SOUT_APB_CLOCK_ENABLE;
- /* enable I2SO_MCLK, clock source PLLA, minimal frequency */
- CGU_AUDIO |= (1<<11) | (511<<2) | (1<<0);
+ /* clock source PLLA, minimal frequency */
+ CGU_AUDIO |= (511<<2) | (1<<0);
I2SOUT_CONTROL |= (1<<6) ; /* enable dma */
I2SOUT_CONTROL |= (1<<3) ; /* stereo */