]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Really apply audio L/R channel interchange fix
authorDirk Behme <dirk.behme@de.bosch.com>
Sat, 14 Jan 2006 00:20:00 +0000 (16:20 -0800)
committerTony Lindgren <tony@atomide.com>
Sat, 14 Jan 2006 00:20:00 +0000 (16:20 -0800)
>>12) ALSA Audio L/R Channel Interchanges fix
>>http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005971.html

Can you check if this is really applied? Using most recent git I can
still apply it ;-)
There were two similiar patches: One for OSS (is applied, number 7 of
the list) and this one for ALSA.

sound/arm/omap-aic23.c
sound/arm/omap-aic23.h
sound/arm/omap-alsa-dma.c

index 5d9a63a7f0e5660bf8f31fd8b3b49cde26fddddf..41ca0c36cae464a94ae99aa4f8c8dc7c6b7df9af 100644 (file)
@@ -34,6 +34,8 @@
  *
  * 2005-07-29   INdT Kernel Team - Alsa driver for omap osk. Creation of new 
  *                                 file omap-aic23.c
+ *
+ * 2005-12-18   Dirk Behme      - Added L/R Channel Interchange fix as proposed by Ajaya Babu
  */
 
 #include <linux/config.h>
@@ -156,6 +158,20 @@ static snd_pcm_hw_constraint_list_t hw_constraints_rates = {
        .mask = 0,
 };
 
+/*
+ * HW interface start and stop helper functions
+ */
+static int audio_ifc_start(void)
+{
+       omap_mcbsp_start(AUDIO_MCBSP);
+       return 0;
+}
+
+static int audio_ifc_stop(void)
+{
+       omap_mcbsp_stop(AUDIO_MCBSP);
+       return 0;
+}
 
 /*
  * Codec/mcbsp init and configuration section
@@ -243,12 +259,20 @@ static void omap_aic23_audio_init(struct snd_card_omap_aic23 *omap_aic23)
            SNDRV_PCM_STREAM_PLAYBACK;
        omap_aic23->s[SNDRV_PCM_STREAM_PLAYBACK].dma_dev =
            OMAP_DMA_MCBSP1_TX;
+       omap_aic23->s[SNDRV_PCM_STREAM_PLAYBACK].hw_start =
+           audio_ifc_start;
+       omap_aic23->s[SNDRV_PCM_STREAM_PLAYBACK].hw_stop =
+           audio_ifc_stop;
 
        omap_aic23->s[SNDRV_PCM_STREAM_CAPTURE].id = "Alsa AIC23 in";
        omap_aic23->s[SNDRV_PCM_STREAM_CAPTURE].stream_id =
            SNDRV_PCM_STREAM_CAPTURE;
        omap_aic23->s[SNDRV_PCM_STREAM_CAPTURE].dma_dev =
            OMAP_DMA_MCBSP1_RX;
+       omap_aic23->s[SNDRV_PCM_STREAM_CAPTURE].hw_start =
+           audio_ifc_start;
+       omap_aic23->s[SNDRV_PCM_STREAM_CAPTURE].hw_stop =
+           audio_ifc_stop;
 
        /* configuring the McBSP */
        omap_mcbsp_request(AUDIO_MCBSP);
index 50b4afbed83eb71b138f242283c6339c277bbe4b..c8ab42c29354c00b9e364c5c24abe5eaed9aa0f6 100644 (file)
@@ -33,7 +33,8 @@
  *  2005/07/25 INdT-10LE Kernel Team -         Alsa driver for omap osk,
  *                                     original version based in sa1100 driver
  *                                     and omap oss driver.
- *  
+ *
+ *  2005-12-18   Dirk Behme      - Added L/R Channel Interchange fix as proposed by Ajaya Babu
  */
 
 #ifndef __OMAP_AIC23_H
@@ -85,6 +86,8 @@ struct audio_stream {
        snd_pcm_substream_t *stream;    /* the pcm stream */
        unsigned linked:1;      /* dma channels linked */
        int offset;             /* store start position of the last period in the alsa buffer */
+       int (*hw_start)(void);  /* interface to start HW interface, e.g. McBSP */
+       int (*hw_stop)(void);   /* interface to stop HW interface, e.g. McBSP */
 };
 
 /*
index 8d6e9b4cb05d3803721dfb459f43c9e7b7fcdd96..8530acf7694d9f87c0b8917626f3e825289d8ae8 100644 (file)
@@ -34,7 +34,9 @@
  * 2005-07-19  INdT Kernel Team - Alsa port. Creation of new file omap-alsa-dma.c based in
  *                                omap-audio-dma-intfc.c oss file. Support for aic23 codec.
  *                                Removal of buffer handling (Alsa does that), modifications
- *                                in dma handling and port to alsa structures. 
+ *     in dma handling and port to alsa structures.
+ *
+ * 2005-12-18   Dirk Behme      - Added L/R Channel Interchange fix as proposed by Ajaya Babu
  */
 
 #include <linux/config.h>
@@ -356,8 +358,10 @@ static int audio_start_dma_chain(struct audio_stream *s)
        int channel = s->lch[s->dma_q_head];
        FN_IN;
        if (!s->started) {
+        s->hw_stop();      /* stops McBSP Interface */
                omap_start_dma(channel);
                s->started = 1;
+               s->hw_start();     /* start McBSP interface */
        }
        /* else the dma itself will progress forward with out our help */
        FN_OUT(0);