Commit 766df6d9 authored by Barry Song's avatar Barry Song Committed by Mark Brown

ASoC: Blackfin I2S: use dai state rather than local counter

Since the active field of the dai already tells us the stream activity,
the local counter variable is redundant and can be replaced.
Signed-off-by: default avatarBarry Song <barry.song@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent e0274b0a
...@@ -49,7 +49,6 @@ struct bf5xx_i2s_port { ...@@ -49,7 +49,6 @@ struct bf5xx_i2s_port {
u16 rcr1; u16 rcr1;
u16 tcr2; u16 tcr2;
u16 rcr2; u16 rcr2;
int counter;
int configured; int configured;
}; };
...@@ -133,16 +132,6 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -133,16 +132,6 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
return ret; return ret;
} }
static int bf5xx_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
pr_debug("%s enter\n", __func__);
/*this counter is used for counting how many pcm streams are opened*/
bf5xx_i2s.counter++;
return 0;
}
static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream, static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
...@@ -201,9 +190,8 @@ static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream, ...@@ -201,9 +190,8 @@ static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
pr_debug("%s enter\n", __func__); pr_debug("%s enter\n", __func__);
bf5xx_i2s.counter--;
/* No active stream, SPORT is allowed to be configured again. */ /* No active stream, SPORT is allowed to be configured again. */
if (!bf5xx_i2s.counter) if (!dai->active)
bf5xx_i2s.configured = 0; bf5xx_i2s.configured = 0;
} }
...@@ -284,7 +272,6 @@ static int bf5xx_i2s_resume(struct snd_soc_dai *dai) ...@@ -284,7 +272,6 @@ static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
SNDRV_PCM_FMTBIT_S32_LE) SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = { static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = {
.startup = bf5xx_i2s_startup,
.shutdown = bf5xx_i2s_shutdown, .shutdown = bf5xx_i2s_shutdown,
.hw_params = bf5xx_i2s_hw_params, .hw_params = bf5xx_i2s_hw_params,
.set_fmt = bf5xx_i2s_set_dai_fmt, .set_fmt = bf5xx_i2s_set_dai_fmt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment