summaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-i2s.c')
-rw-r--r--sound/soc/blackfin/bf5xx-i2s.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c
index 9648244..af06904 100644
--- a/sound/soc/blackfin/bf5xx-i2s.c
+++ b/sound/soc/blackfin/bf5xx-i2s.c
@@ -50,6 +50,7 @@ struct bf5xx_i2s_port {
u16 tcr2;
u16 rcr2;
int counter;
+ int configured;
};
static struct bf5xx_i2s_port bf5xx_i2s;
@@ -168,7 +169,7 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
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
@@ -177,6 +178,7 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream,
*
* CPU DAI:slave mode.
*/
+ bf5xx_i2s.configured = 1;
ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1,
bf5xx_i2s.rcr2, 0, 0);
if (ret) {
@@ -200,6 +202,9 @@ static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream,
{
pr_debug("%s enter\n", __func__);
bf5xx_i2s.counter--;
+ /* No active stream, SPORT is allowed to be configured again. */
+ if (!bf5xx_i2s.counter)
+ bf5xx_i2s.configured = 0;
}
static int bf5xx_i2s_probe(struct platform_device *pdev,
@@ -244,8 +249,7 @@ static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
return 0;
}
-static int bf5xx_i2s_resume(struct platform_device *pdev,
- struct snd_soc_dai *dai)
+static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
{
int ret;
struct sport_device *sport =
OpenPOWER on IntegriCloud