aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin
diff options
context:
space:
mode:
authorCliff Cai <cliff.cai@analog.com>2009-09-16 20:25:12 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-18 10:07:19 -0400
commitad80efc469f56d41f3f4adc1b2c86bf65689ebeb (patch)
tree2b694e6abac0e0d70f39892028879f0ed0b344e7 /sound/soc/blackfin
parentfab19bae0c2951ed8bc517a53848b027fead293d (diff)
ASoC: Blackfin I2S: fix resuming when device hasn't been used
If the sound system hasn't been utilized yet and we suspend, then we attempt to save/restore using state that doesn't exist. So use a global handle instead to reconfigure properly. 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>
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r--sound/soc/blackfin/bf5xx-i2s.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c
index 19539c68c053..1e9d161c76c4 100644
--- a/sound/soc/blackfin/bf5xx-i2s.c
+++ b/sound/soc/blackfin/bf5xx-i2s.c
@@ -237,36 +237,31 @@ static void bf5xx_i2s_remove(struct platform_device *pdev,
237#ifdef CONFIG_PM 237#ifdef CONFIG_PM
238static int bf5xx_i2s_suspend(struct snd_soc_dai *dai) 238static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
239{ 239{
240 struct sport_device *sport =
241 (struct sport_device *)dai->private_data;
242 240
243 pr_debug("%s : sport %d\n", __func__, dai->id); 241 pr_debug("%s : sport %d\n", __func__, dai->id);
244 if (!dai->active) 242
245 return 0;
246 if (dai->capture.active) 243 if (dai->capture.active)
247 sport_rx_stop(sport); 244 sport_rx_stop(sport_handle);
248 if (dai->playback.active) 245 if (dai->playback.active)
249 sport_tx_stop(sport); 246 sport_tx_stop(sport_handle);
250 return 0; 247 return 0;
251} 248}
252 249
253static int bf5xx_i2s_resume(struct snd_soc_dai *dai) 250static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
254{ 251{
255 int ret; 252 int ret;
256 struct sport_device *sport =
257 (struct sport_device *)dai->private_data;
258 253
259 pr_debug("%s : sport %d\n", __func__, dai->id); 254 pr_debug("%s : sport %d\n", __func__, dai->id);
260 if (!dai->active)
261 return 0;
262 255
263 ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0); 256 ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1,
257 bf5xx_i2s.rcr2, 0, 0);
264 if (ret) { 258 if (ret) {
265 pr_err("SPORT is busy!\n"); 259 pr_err("SPORT is busy!\n");
266 return -EBUSY; 260 return -EBUSY;
267 } 261 }
268 262
269 ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0); 263 ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1,
264 bf5xx_i2s.tcr2, 0, 0);
270 if (ret) { 265 if (ret) {
271 pr_err("SPORT is busy!\n"); 266 pr_err("SPORT is busy!\n");
272 return -EBUSY; 267 return -EBUSY;