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>
* 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
#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>
#include "imx-esai.h"
#include "../codecs/cs42888.h"
-
struct imx_priv_state {
int hw;
};
{
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;
}