]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00162729 MX6 ESAI: To reset the codec before initing a stream playbacking
authorLionel Xu <Lionel.Xu@freescale.com>
Fri, 9 Dec 2011 06:25:53 +0000 (14:25 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:35 +0000 (08:33 +0200)
Sometimes there is no sound after starting a stream playbacking, this problem
can be resolved by resetting external codec at the beginning of startup.

Signed-off-by: Lionel Xu <R63889@freescale.com>
sound/soc/codecs/cs42888.h
sound/soc/imx/imx-cs42888.c

index a650c9da53387eb7bad21bf76533864edcd3c7b2..bea8beb8b70d0ec1e2cd6a9987849120ea1cf5ee 100644 (file)
@@ -19,6 +19,7 @@
  * the .codec_dai field of your machine driver's snd_soc_dai_link structure.
  */
 extern struct snd_soc_dai_driver cs42888_dai;
+#define CS42888_RST 235
 
 /*
  * The ASoC codec device structure for the CS42888.  Assign this structure
index d34be0a0e8f997ba065883ff2873f7adb5d7df07..4c9ca9857464696c7107b5d88ad5acb8b475239d 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/regulator/consumer.h>
 #include <linux/fsl_devices.h>
+#include <linux/gpio.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
@@ -33,7 +34,6 @@
 #include "imx-esai.h"
 #include "../codecs/cs42888.h"
 
-
 struct imx_priv_state {
        int hw;
 };
@@ -45,8 +45,13 @@ static int imx_3stack_startup(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-       if (!cpu_dai->active)
+
+       if (!cpu_dai->active) {
                hw_state.hw = 0;
+               gpio_direction_output(CS42888_RST, 0);
+               msleep(100);
+               gpio_direction_output(CS42888_RST, 1);
+       }
 
        return 0;
 }