summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-01 22:35:00 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-01 22:35:00 +0000
commit4048cf27a24b93e76c4262974831669e79c71da8 (patch)
treeb00fabb14f670ed139ae23fa44ceb08aa47e2d7b
parent5f43d0db5cccb966d4268533c76d11a2b6b7506f (diff)
downloadrockbox-4048cf27a24b93e76c4262974831669e79c71da8.tar.gz
rockbox-4048cf27a24b93e76c4262974831669e79c71da8.tar.bz2
rockbox-4048cf27a24b93e76c4262974831669e79c71da8.zip
Gigeabeat S: Reset DMA size info when stopping audio playback and recording transfers so that size remaing/peak buffer calls return 0/NULL when stopped.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28941 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
index 15f9d0bd1c..50c7da943e 100644
--- a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
@@ -270,6 +270,17 @@ static void play_stop_pcm(void)
SSI_STCR2 &= ~SSI_STCR_TFEN0; /* Disable TX */
SSI_SCR2 &= ~(SSI_SCR_TE | SSI_SCR_SSIEN); /* Disable transmission, SSI */
+ if (pcm_playing)
+ {
+ /* Stopping: clear buffer info to ensure 0-size readbacks when
+ * stopped */
+ unsigned long dsa = 0;
+ dma_play_bd.buf_addr = NULL;
+ dma_play_bd.mode.count = 0;
+ clean_dcache_range(&dsa, sizeof(dsa));
+ sdma_write_words(&dsa, CHANNEL_CONTEXT_ADDR(DMA_PLAY_CH_NUM)+0x0b, 1);
+ }
+
/* Clear any pending callback */
dma_play_data.callback_pending = 0;
}
@@ -463,6 +474,17 @@ void pcm_rec_dma_stop(void)
SSI_SCR1 &= ~SSI_SCR_RE; /* Disable RX */
SSI_SRCR1 &= ~SSI_SRCR_RFEN0; /* Disable RX FIFO */
+ if (pcm_recording)
+ {
+ /* Stopping: clear buffer info to ensure 0-size readbacks when
+ * stopped */
+ unsigned long pda = 0;
+ dma_rec_bd.buf_addr = NULL;
+ dma_rec_bd.mode.count = 0;
+ clean_dcache_range(&pda, sizeof(pda));
+ sdma_write_words(&pda, CHANNEL_CONTEXT_ADDR(DMA_REC_CH_NUM)+0x0a, 1);
+ }
+
/* Clear any pending callback */
dma_rec_data.callback_pending = 0;
}