[PATCH] Fix Macbook Addon to work after resume

David Zeuthen david at fubar.dk
Sun Jun 3 17:47:00 PDT 2007


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