Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47203
b: refs/heads/master
c: 965ac42
h: refs/heads/master
i:
  47201: 5bb949b
  47199: 257c1c3
v: v3
  • Loading branch information
Liam Girdwood authored and Jaroslav Kysela committed Feb 9, 2007
1 parent 53ea25f commit c6d8822
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: beb60119bcc9cbd80bc5b4f7feec419e067d3e46
refs/heads/master: 965ac42ce919db225ee64678f0be02f2fdf5b5e4
23 changes: 22 additions & 1 deletion trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ static int pmdown_time = 5000;
module_param(pmdown_time, int, 0);
MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)");

/*
* This function forces any delayed work to be queued and run.
*/
static int run_delayed_work(struct delayed_work *dwork)
{
int ret;

/* cancel any work waiting to be queued. */
ret = cancel_delayed_work(dwork);

/* if there was any work waiting then we run it now and
* wait for it's completion */
if (ret) {
schedule_delayed_work(dwork, 0);
flush_scheduled_work();
}
return ret;
}

#ifdef CONFIG_SND_SOC_AC97_BUS
/* unregister ac97 codec */
static int soc_ac97_dev_unregister(struct snd_soc_codec *codec)
Expand Down Expand Up @@ -1101,7 +1120,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
}

/* close any waiting streams and save state */
flush_scheduled_work();
run_delayed_work(&socdev->delayed_work);
codec->suspend_dapm_state = codec->dapm_state;

for(i = 0; i < codec->num_dai; i++) {
Expand Down Expand Up @@ -1255,6 +1274,8 @@ static int soc_remove(struct platform_device *pdev)
struct snd_soc_platform *platform = socdev->platform;
struct snd_soc_codec_device *codec_dev = socdev->codec_dev;

run_delayed_work(&socdev->delayed_work);

if (platform->remove)
platform->remove(pdev);

Expand Down

0 comments on commit c6d8822

Please sign in to comment.