summaryrefslogtreecommitdiff
path: root/sound/soc/imx/imx-cs42888.c
diff options
context:
space:
mode:
authorLionel Xu <Lionel.Xu@freescale.com>2011-09-30 14:47:31 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 20:23:54 +0800
commit4b74139aabf51937618be40075c9b2a5dc170a78 (patch)
tree525b788f09b2ca4e50175e636f50904349825d13 /sound/soc/imx/imx-cs42888.c
parent2eed0e206a89760cc7d1de78c89a2ee5dfb21c41 (diff)
ENGR00156745 MX6Q ESAI: Playback and record can't start up concurrently
Proper flag setting and placement should be used to avoid function hw_param called multiple times when playback and record startup concurrently. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
Diffstat (limited to 'sound/soc/imx/imx-cs42888.c')
-rw-r--r--sound/soc/imx/imx-cs42888.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index e9f6633f1b74..d34be0a0e8f9 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -34,23 +34,29 @@
#include "../codecs/cs42888.h"
-struct imx_3stack_pcm_state {
- int lr_clk_active;
+struct imx_priv_state {
+ int hw;
};
-static struct imx_3stack_pcm_state clk_state;
+static struct imx_priv_state hw_state;
unsigned int mclk_freq;
static int imx_3stack_startup(struct snd_pcm_substream *substream)
{
- clk_state.lr_clk_active++;
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+ if (!cpu_dai->active)
+ hw_state.hw = 0;
return 0;
}
static void imx_3stack_shutdown(struct snd_pcm_substream *substream)
{
- clk_state.lr_clk_active--;
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+ if (!cpu_dai->active)
+ hw_state.hw = 0;
}
static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
@@ -62,8 +68,10 @@ static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
unsigned int rate = params_rate(params);
u32 dai_format;
unsigned int lrclk_ratio = 0;
- if (clk_state.lr_clk_active > 1)
+
+ if (hw_state.hw)
return 0;
+ hw_state.hw = 1;
if (cpu_is_mx53()) {
switch (rate) {
case 32000: