diff options
author | Cliff Cai <cliff.cai@analog.com> | 2009-06-20 11:29:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-20 14:45:28 -0400 |
commit | 895c9c056591f05ba3b669cda6c12afb212c6253 (patch) | |
tree | 1a7d8a7870b938773e29bbb77cc87cd3d7e25c90 | |
parent | ef39412622b6e8f09c383de9565b07e93553fc27 (diff) |
ASoC: Blackfin: keep better track of SPORT configuration state
Do not let the SPORT be reconfigured until there are no more active
streams. Then we can let the system reprogram the SPORT state.
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c index 964824419678..0e8af48650be 100644 --- a/sound/soc/blackfin/bf5xx-i2s.c +++ b/sound/soc/blackfin/bf5xx-i2s.c | |||
@@ -50,6 +50,7 @@ struct bf5xx_i2s_port { | |||
50 | u16 tcr2; | 50 | u16 tcr2; |
51 | u16 rcr2; | 51 | u16 rcr2; |
52 | int counter; | 52 | int counter; |
53 | int configured; | ||
53 | }; | 54 | }; |
54 | 55 | ||
55 | static struct bf5xx_i2s_port bf5xx_i2s; | 56 | static struct bf5xx_i2s_port bf5xx_i2s; |
@@ -168,7 +169,7 @@ static int bf5xx_i2s_hw_params(struct snd_pcm_substream *substream, | |||
168 | break; | 169 | break; |
169 | } | 170 | } |
170 | 171 | ||
171 | if (bf5xx_i2s.counter == 1) { | 172 | if (!bf5xx_i2s.configured) { |
172 | /* | 173 | /* |
173 | * TX and RX are not independent,they are enabled at the | 174 | * TX and RX are not independent,they are enabled at the |
174 | * same time, even if only one side is running. So, we | 175 | * 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, | |||
177 | * | 178 | * |
178 | * CPU DAI:slave mode. | 179 | * CPU DAI:slave mode. |
179 | */ | 180 | */ |
181 | bf5xx_i2s.configured = 1; | ||
180 | ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1, | 182 | ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1, |
181 | bf5xx_i2s.rcr2, 0, 0); | 183 | bf5xx_i2s.rcr2, 0, 0); |
182 | if (ret) { | 184 | if (ret) { |
@@ -200,6 +202,9 @@ static void bf5xx_i2s_shutdown(struct snd_pcm_substream *substream, | |||
200 | { | 202 | { |
201 | pr_debug("%s enter\n", __func__); | 203 | pr_debug("%s enter\n", __func__); |
202 | bf5xx_i2s.counter--; | 204 | bf5xx_i2s.counter--; |
205 | /* No active stream, SPORT is allowed to be configured again. */ | ||
206 | if (!bf5xx_i2s.counter) | ||
207 | bf5xx_i2s.configured = 0; | ||
203 | } | 208 | } |
204 | 209 | ||
205 | static int bf5xx_i2s_probe(struct platform_device *pdev, | 210 | static int bf5xx_i2s_probe(struct platform_device *pdev, |