Title: [6487] trunk/sound/soc/blackfin/bf5xx-i2s.c: bug[#2424]change to a more reliable way to configure sport
Revision
6487
Author
cliff
Date
2009-05-27 04:09:44 -0500 (Wed, 27 May 2009)

Log Message

bug[#2424]change to a more reliable way to configure sport

Modified Paths

Diff

Modified: trunk/sound/soc/blackfin/bf5xx-i2s.c (6486 => 6487)


--- trunk/sound/soc/blackfin/bf5xx-i2s.c	2009-05-27 08:56:16 UTC (rev 6486)
+++ trunk/sound/soc/blackfin/bf5xx-i2s.c	2009-05-27 09:09:44 UTC (rev 6487)
@@ -49,7 +49,7 @@
 	u16 rcr1;
 	u16 tcr2;
 	u16 rcr2;
-	int counter;
+	int configured;
 };
 
 static struct bf5xx_i2s_port bf5xx_i2s;
@@ -132,15 +132,6 @@
 	return ret;
 }
 
-static int bf5xx_i2s_startup(struct snd_pcm_substream *substream)
-{
-	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)
 {
@@ -166,7 +157,7 @@
 		break;
 	}
 
-	if (bf5xx_i2s.counter == 1) {
+	if (!bf5xx_i2s.configured) {
 		/*
 		 * TX and RX are not independent,they are enabled at the
 		 * same time, even if only one side is running. So, we
@@ -188,6 +179,7 @@
 			pr_err("SPORT is busy!\n");
 			return -EBUSY;
 		}
+		bf5xx_i2s.configured = 1;
 	}
 
 	return 0;
@@ -196,7 +188,7 @@
 static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream)
 {
 	pr_debug("%s enter\n", __func__);
-	bf5xx_i2s.counter--;
+	bf5xx_i2s.configured = 0;
 }
 
 static int bf5xx_i2s_probe(struct platform_device *pdev,
@@ -305,7 +297,6 @@
 		.rates = BF5XX_I2S_RATES,
 		.formats = BF5XX_I2S_FORMATS,},
 	.ops = {
-		.startup   = bf5xx_i2s_startup,
 		.shutdown  = bf5xx_i2s_shutdown,
 		.hw_params = bf5xx_i2s_hw_params,},
 	.dai_ops = {
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to