Skip to contentSkip to conversation

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

PATCH Applied Mike Frysinger 2 participants 4 messages Sep 23, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: Blackfin I2S: use dai state rather than local counter

From: Barry Song <[email protected]>

Since the active field of the dai already tells us the stream activity, the local counter variable is redundant and can be replaced.

---
 sound/soc/blackfin/bf5xx-i2s.c |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
sound/soc/blackfin/bf5xx-i2s.c +1 -14
index 876abad..66e7333 100644
@@ -49,7 +49,6 @@ struct bf5xx_i2s_port {
 	u16 rcr1;
 	u16 tcr2;
 	u16 rcr2;
-	int counter;
 	int configured;
 };
 
@@ -133,16 +132,6 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
 	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,
 				struct snd_pcm_hw_params *params,
 				struct snd_soc_dai *dai)
@@ -201,9 +190,8 @@ static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream,
 			       struct snd_soc_dai *dai)
 {
 	pr_debug("%s enter\n", __func__);
-	bf5xx_i2s.counter--;
 	/* No active stream, SPORT is allowed to be configured again. */
-	if (!bf5xx_i2s.counter)
+	if (!dai->active)
 		bf5xx_i2s.configured = 0;
 }
 
@@ -288,7 +276,6 @@ static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
 	SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_ops bf5xx_i2s_dai_ops = {
-	.startup	= bf5xx_i2s_startup,
 	.shutdown	= bf5xx_i2s_shutdown,
 	.hw_params	= bf5xx_i2s_hw_params,
 	.set_fmt	= bf5xx_i2s_set_dai_fmt,
Signature · 1 line
1.6.5.rc1
#1 lore raw

PATCH 2/2 ASoC: Blackfin: fix inverted handling of SPORT0 on PORT F/G

From: Cliff Cai <[email protected]>

---
 sound/soc/blackfin/bf5xx-i2s.c |    8 ++++----
 sound/soc/blackfin/bf5xx-tdm.c |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
sound/soc/blackfin/bf5xx-i2s.c +4 -4
index 66e7333..43feac5 100644
@@ -76,12 +76,12 @@ static struct sport_param sport_params[2] = {
  * TFS. When Port G is selected and EMAC then there is a conflict between
  * the PHY interrupt line and TFS.  Current settings prevent the conflict
  * by ignoring the TFS pin when Port G is selected. This allows both
- * ssm2602 using Port G and EMAC concurrently.
+ * codecs and EMAC using Port G concurrently.
  */
-#ifdef CONFIG_BF527_SPORT0_PORTF
-#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
-#else
+#ifdef CONFIG_BF527_SPORT0_PORTG
 #define LOCAL_SPORT0_TFS (0)
+#else
+#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
 #endif
 
 static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
sound/soc/blackfin/bf5xx-tdm.c +4 -4
index 3096bad..ff546e9 100644
@@ -78,12 +78,12 @@ static struct sport_param sport_params[2] = {
  * TFS. When Port G is selected and EMAC then there is a conflict between
  * the PHY interrupt line and TFS.  Current settings prevent the conflict
  * by ignoring the TFS pin when Port G is selected. This allows both
- * ssm2602 using Port G and EMAC concurrently.
+ * codecs and EMAC using Port G concurrently.
  */
-#ifdef CONFIG_BF527_SPORT0_PORTF
-#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
-#else
+#ifdef CONFIG_BF527_SPORT0_PORTG
 #define LOCAL_SPORT0_TFS (0)
+#else
+#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
 #endif
 
 static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
Signature · 1 line
1.6.5.rc1