From 048beaed310b1c630cbc7a041c18a2d6938812f6 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Wed, 21 May 2008 17:34:48 -0700 Subject: [PATCH] ARM: OMAP: Remove broken DMA function omap_get_dma_src_addr_counter We should use omap_get_dma_src_pos() instead, which returns the current address correctly. Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dma.c | 11 ----------- include/asm-arm/arch-omap/dma.h | 1 - sound/arm/omap/omap-alsa.c | 10 ++++++---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 906291ec503..1bb6a561d99 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1054,17 +1054,6 @@ dma_addr_t omap_get_dma_dst_pos(int lch) } EXPORT_SYMBOL(omap_get_dma_dst_pos); -/* - * Returns current source transfer counting for the given DMA channel. - * Can be used to monitor the progress of a transfer inside a block. - * It must be called with disabled interrupts. - */ -int omap_get_dma_src_addr_counter(int lch) -{ - return (dma_addr_t)dma_read(CSAC(lch)); -} -EXPORT_SYMBOL(omap_get_dma_src_addr_counter); - int omap_get_dma_active_status(int lch) { return (dma_read(CCR(lch)) & OMAP_DMA_CCR_EN) != 0; diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index 00b1f68e0f1..a12ac9ddf44 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h @@ -508,7 +508,6 @@ extern int omap_set_dma_callback(int lch, void *data); extern dma_addr_t omap_get_dma_src_pos(int lch); extern dma_addr_t omap_get_dma_dst_pos(int lch); -extern int omap_get_dma_src_addr_counter(int lch); extern void omap_clear_dma(int lch); extern int omap_get_dma_active_status(int lch); extern int omap_dma_running(void); diff --git a/sound/arm/omap/omap-alsa.c b/sound/arm/omap/omap-alsa.c index 86939424081..f9293cda59c 100644 --- a/sound/arm/omap/omap-alsa.c +++ b/sound/arm/omap/omap-alsa.c @@ -65,6 +65,9 @@ static char *id; static struct snd_card_omap_codec *alsa_codec; static struct omap_alsa_codec_config *alsa_codec_config; +/* FIXME: Please change to use omap asoc framework instead, this can be racy */ +static dma_addr_t dma_start_pos; + /* * HW interface start and stop helper functions */ @@ -149,7 +152,7 @@ static u_int audio_get_dma_pos(struct audio_stream *s) spin_lock_irqsave(&s->dma_lock, flags); /* For the current period let's see where we are */ - count = omap_get_dma_src_addr_counter(s->lch[s->dma_q_head]); + count = omap_get_dma_src_pos(s->lch[s->dma_q_head]) - dma_start_pos; spin_unlock_irqrestore(&s->dma_lock, flags); @@ -210,9 +213,8 @@ static void audio_process_dma(struct audio_stream *s) if (cpu_is_omap1510()) omap_stop_alsa_sound_dma(s); - ret = omap_start_alsa_sound_dma(s, - (dma_addr_t)runtime->dma_area + offset, - dma_size); + dma_start_pos = (dma_addr_t)runtime->dma_area + offset; + ret = omap_start_alsa_sound_dma(s, dma_start_pos, dma_size); if (ret) { printk(KERN_ERR "audio_process_dma: cannot" " queue DMA buffer (%i)\n", ret); -- 2.41.1