[PATCH] Fix Macbook Addon to work after resume

Ryan Lortie desrt at desrt.ca
Sun Jun 3 18:02:32 PDT 2007


Hello.

This is almost OK.

We shouldn't wait for the first attempt to change the backlight value --
we should perform the fix as soon as we come back from resume.

The only reason that this might work is because I believe
gnome-power-manager sets the backlight value on resume.  Definitely not
worth relying on.

Cheers

On Sun, 2007-03-06 at 20:47 -0400, David Zeuthen wrote:
> On Sat, 2007-06-02 at 00:51 +0200, Martin Szulecki wrote:
> > I was finally able to get suspend to ram working on my Macbook
> > (non-Pro).
> > 
> > In order to make it work (it appears this is required on latest Xorg and
> > intel drivers) I had to change the currently set quirk from
> > "vbestate_restore" (causing system freeze on resume) to
> > "vbemode_restore" (flawless).
> > 
> > However, without restoring the state, it appears some registers come up
> > reset to zero which makes the addon refuse to work.
> > 
> > I attached a tiny patch to fix the addon to work even after a
> > suspend/resume.
> > 
> > If anyone else is able to verify that "vbemode_restore" is enough on the
> > Macbook it might be good to change the appropriate fdi file aswell?
> 
> So IIRC, Ryan wrote this code and he even kept bugging me at LCA for
> what to do when resuming :-) - Ryan, does this patch (just copy-pasted
> from Martin's mail) look good
> 
> > --- a/hald/linux/addons/addon-macbook-backlight.c
> > +++ b/hald/linux/addons/addon-macbook-backlight.c
> > @@ -160,6 +160,10 @@ backlight_set (long value)
> >  
> >         max = register_get () >> 17;
> >  
> > +       /* after resume the register might be set to zero; fix this */
> > +       if (max == 0x00)
> > +               max = 0x94;
> > +
> >         /* sanity check: this should always be 0x94 */
> >         if (max != 0x94)
> >                 return FALSE;
> 
> Thanks,
> David
> 



More information about the hal mailing list