]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: omap1510/16xx fixes for the tsc2101 oss driver
authorlakmir <lamikr lamikr@cc.jyu.fi>
Thu, 19 Jan 2006 20:03:42 +0000 (12:03 -0800)
committerTony Lindgren <tony@atomide.com>
Thu, 19 Jan 2006 20:03:42 +0000 (12:03 -0800)
1) mcbsp.h needs to define AUDIO_MCBSP_DATAREAD and
AUDIO_MCBSP_DATAWRITE functions, etc... both for the omap1510 and
omap16xx oterwise the sound/oss/omap-audio-dma-intfc.c fails to compile
with omap1.

2) Added cpu_is_omap1510 check to places which earlier only checked
cpu_is_omap16xx() so that the dma got initialized properly also with the
omap1510 based iPAQ h6300.

3)  DCSR_ERROR check looked suspicious compared to the version in 2.6.14
kernel. In addition that prevented the sound working after first played
frame
in the iPAQ h6300 as assumed always that error had happened.

After applying attached fixes, cat my_song.wav > /dev/dsp worked ok for me.

include/asm-arm/arch-omap/mcbsp.h
sound/oss/omap-audio-dma-intfc.c

index a3755ec8d4001490f5cdd32fa6dadce49aef48f7..d97e0318a68f7a2fe1db8e03fc2a9af415efe820 100644 (file)
@@ -40,7 +40,7 @@
 #define OMAP24XX_MCBSP1_BASE   0x48074000
 #define OMAP24XX_MCBSP2_BASE   0x48076000
 
-#ifdef CONFIG_ARCH_OMAP16XX
+#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
 
 #define OMAP_MCBSP_REG_DRR2    0x00
 #define OMAP_MCBSP_REG_DRR1    0x02
@@ -76,6 +76,9 @@
 
 #define OMAP_MAX_MCBSP_COUNT 3
 
+#define AUDIO_MCBSP_DATAWRITE  (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1)
+#define AUDIO_MCBSP_DATAREAD   (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1)
+
 #define AUDIO_MCBSP            OMAP_MCBSP1
 #define AUDIO_DMA_TX           OMAP_DMA_MCBSP1_TX
 #define AUDIO_DMA_RX           OMAP_DMA_MCBSP1_RX
index 876d773be09dcc9cc3bed0574c11206455fdfe10..7bcc3fa499df3a3b18b83f9a3fc923da6954acc4 100644 (file)
@@ -683,13 +683,6 @@ void omap_clear_sound_dma(audio_stream_t * s)
        return;
 }
 
-/*********************************** MODULE FUNCTIONS DEFINTIONS ***********************/
-
-#ifdef OMAP1610_MCBSP1_BASE
-#undef OMAP1610_MCBSP1_BASE
-#endif
-#define OMAP1610_MCBSP1_BASE    0xE1011000
-
 /***************************************************************************************
  *
  * DMA related functions
@@ -707,8 +700,8 @@ static int audio_set_dma_params_play(int channel, dma_addr_t dma_ptr,
 
        FN_IN;
 
-       if (cpu_is_omap16xx()) {
-               dest_start = (OMAP1610_MCBSP1_BASE + 0x806);
+       if (cpu_is_omap1510() || cpu_is_omap16xx()) {
+               dest_start = AUDIO_MCBSP_DATAWRITE;
                dest_port = OMAP_DMA_PORT_MPUI;
        }
        if (cpu_is_omap24xx()) {
@@ -737,8 +730,8 @@ static int audio_set_dma_params_capture(int channel, dma_addr_t dma_ptr,
 
        FN_IN;
 
-       if (cpu_is_omap16xx()) {
-               src_start = (OMAP1610_MCBSP1_BASE + 0x802);
+       if (cpu_is_omap1510() || cpu_is_omap16xx()) {
+               src_start = AUDIO_MCBSP_DATAREAD;
                src_port = OMAP_DMA_PORT_MPUI;
        }
        if (cpu_is_omap24xx()) {
@@ -878,8 +871,8 @@ static void sound_dma_irq_handler(int sound_curr_lch, u16 ch_status, void *data)
        DPRINTK("lch=%d,status=0x%x, dma_status=%d, data=%p\n", sound_curr_lch,
                ch_status, dma_status, data);
 
-       if (dma_status) {
-               if (cpu_is_omap16xx() && (dma_status & (DCSR_ERROR)))
+       if (dma_status & (DCSR_ERROR)) {
+               if (cpu_is_omap1510() || cpu_is_omap16xx())
                        OMAP_DMA_CCR_REG(sound_curr_lch) &= ~DCCR_EN;
                ERR("DCSR_ERROR!\n");
                FN_OUT(-1);