From: Liam Girdwood <lg@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: [PATCH] ASoC force running of delayed PM work at suspend() and remove()
Date: Wed, 31 Jan 2007 17:39:06 +0000 [thread overview]
Message-ID: <1170265146.16760.93.camel@localhost.localdomain> (raw)
In-Reply-To: <1170264157.16760.89.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
On Wed, 2007-01-31 at 17:22 +0000, Liam Girdwood wrote:
> Patch attached for AC97 codec.
Best use this one. I've now put the #ifdef CONFIG_SND_AC97_POWER_SAVE
around the function.
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Liam
[-- Attachment #2: ac97-delayed-work.patch --]
[-- Type: text/x-patch, Size: 1289 bytes --]
diff -r 2a5adb550155 pci/ac97/ac97_codec.c
--- a/pci/ac97/ac97_codec.c Wed Jan 31 14:34:38 2007 +0100
+++ b/pci/ac97/ac97_codec.c Wed Jan 31 17:36:31 2007 +0000
@@ -964,6 +964,23 @@ AD18XX_PCM_BITS("LFE Playback Volume", 2
/*
*
*/
+#ifdef CONFIG_SND_AC97_POWER_SAVE
+static int run_ac97_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;
+}
+#endif
static void snd_ac97_powerdown(struct snd_ac97 *ac97);
@@ -989,8 +1006,7 @@ static int snd_ac97_free(struct snd_ac97
{
if (ac97) {
#ifdef CONFIG_SND_AC97_POWER_SAVE
- cancel_delayed_work(&ac97->power_work);
- flush_scheduled_work();
+ run_ac97_delayed_work(&ac97->power_work);
#endif
snd_ac97_proc_done(ac97);
if (ac97->bus)
@@ -2417,8 +2433,7 @@ void snd_ac97_suspend(struct snd_ac97 *a
if (ac97->build_ops->suspend)
ac97->build_ops->suspend(ac97);
#ifdef CONFIG_SND_AC97_POWER_SAVE
- cancel_delayed_work(&ac97->power_work);
- flush_scheduled_work();
+ run_ac97_delayed_work(&ac97->power_work);
#endif
snd_ac97_powerdown(ac97);
}
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 161 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
next prev parent reply other threads:[~2007-01-31 17:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-31 12:26 [PATCH] ASoC force running of delayed PM work at suspend() and remove() Liam Girdwood
2007-01-31 13:23 ` Takashi Iwai
2007-01-31 17:22 ` Liam Girdwood
2007-01-31 17:39 ` Liam Girdwood [this message]
2007-02-01 11:13 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1170265146.16760.93.camel@localhost.localdomain \
--to=lg@opensource.wolfsonmicro.com \
--cc=alsa-devel@lists.sourceforge.net \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).