summaryrefslogtreecommitdiffstats
path: root/sound
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 15:07:19 +0100
commitad80efc469f56d41f3f4adc1b2c86bf65689ebeb (patch)
tree2b694e6abac0e0d70f39892028879f0ed0b344e7 /sound
parentfab19bae0c2951ed8bc517a53848b027fead293d (diff)
downloadtalos-op-linux-ad80efc469f56d41f3f4adc1b2c86bf65689ebeb.tar.gz
talos-op-linux-ad80efc469f56d41f3f4adc1b2c86bf65689ebeb.zip
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')
-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,
#ifdef CONFIG_PM
static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
{
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
pr_debug("%s : sport %d\n", __func__, dai->id);
- if (!dai->active)
- return 0;
+
if (dai->capture.active)
- sport_rx_stop(sport);
+ sport_rx_stop(sport_handle);
if (dai->playback.active)
- sport_tx_stop(sport);
+ sport_tx_stop(sport_handle);
return 0;
}
static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
{
int ret;
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
pr_debug("%s : sport %d\n", __func__, dai->id);
- if (!dai->active)
- return 0;
- ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0);
+ ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1,
+ bf5xx_i2s.rcr2, 0, 0);
if (ret) {
pr_err("SPORT is busy!\n");
return -EBUSY;
}
- ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0);
+ ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1,
+ bf5xx_i2s.tcr2, 0, 0);
if (ret) {
pr_err("SPORT is busy!\n");
return -EBUSY;
OpenPOWER on IntegriCloud