At Wed, 31 Jan 2007 17:39:06 +0000, Liam Girdwood wrote: > > 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. Well, in the case of ac97_codec.c, we don't have to put schedule_delayed_work() there. The work is only for power-off, and suspend/powerdown is the very place to force to turn off the power immediately afterward. Takashi > > Signed-off-by: Liam Girdwood <lg@xxxxxxxxxxxxxxxxxxxxxxxxxxx> > > Liam > [2 ac97-delayed-work.patch <text/x-patch; utf-8 (7bit)>] > 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); > } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel