summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLionel Xu <Lionel.Xu@freescale.com>2011-12-09 14:25:53 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 21:09:53 +0800
commitcbffd11e886c6ba1e2eb5df670b0bb7b0183c852 (patch)
treeb76a69c691c4b1c930f31d95e1f6fd16d19d9546 /sound
parent5e0a900817230061549d4573c5b799e46d973a2d (diff)
ENGR00162729 MX6 ESAI: To reset the codec before initing a stream playbacking
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42888.h1
-rw-r--r--sound/soc/imx/imx-cs42888.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/cs42888.h b/sound/soc/codecs/cs42888.h
index a650c9da5338..bea8beb8b70d 100644
--- a/sound/soc/codecs/cs42888.h
+++ b/sound/soc/codecs/cs42888.h
@@ -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
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index d34be0a0e8f9..4c9ca9857464 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -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;
}