Mac OS X on x86 Hardware 2008–2024 Technical Archive
InfiniteMac OSx86 › OSx86 Core & 10.X › Clamshell Sleep via DSDT
16,723 reads · 2009-09-10 – 2010-12-20
Dossier 10.X Core DSDT ALC889a / Audio

Clamshell Sleep via DSDT

I'm attempting to get SL running on 64bit by removing the needed kexts that only support 32bit and get the needed support by patching my DSDT. I only have 2 issues left which include AppleHDA (no sound after sleep, but enabled via DSDT…

Primary Author
@chris7519 Published 2009-09-10
Collection
OSx86 Core & 10.X
Archival Footprint
16,723 historical reads · 6 curated field notes (from 12 dispatches) · 2009-09-10 – 2010-12-20
Credited Voices (8)
@chris7519 (3)@mormegil (3)@uman@00oo00@Nameci@Goten@neXus@SaGaR

I'm attempting to get SL running on 64bit by removing the needed kexts that only support 32bit and get the needed support by patching my DSDT. I only have 2 issues left which include AppleHDA (no sound after sleep, but enabled via DSDT thanks to mormegil!) and clamshell sleep.

Taken from a post by pentiumpc:

Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D")) //LID detection
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
Name (LIDS, One)
Method (_LID, 0, NotSerialized)
{
Store (^^PCI0.SBRG.EC0.SF13, LIDS) //LID register
XOr (LIDS, One, Local0)
IF (Local0) //if LID is closed 
{ 
Notify (SLPB, 0x80) //Set system to sleep
} 
Return (LIDS)
}

It looks like he's adding the Method or just those two lines of code, but I can't seem to get it to work with my set up. Advice from any1?

My dsdt:

Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Name (LSTS, Zero)
            Method (_LID, 0, NotSerialized)
            {
                If (ECOK)
                {
                    If (LEqual (^^PCI0.LPC.EC0.ECLS, One))
                    {
                        Store (Zero, LSTS)
                    }
                    Else
                    {
                        Store (One, LSTS)
                    }

                    If (IGDS)
                    {
                        Store (LSTS, LIDS)
                        Store (LSTS, ^^PCI0.OVGA.CLID)
                    }

                    Return (LSTS)
                }
                Else
                {
                    If (IGDS)
                    {
                        Store (LIDS, ^^PCI0.OVGA.CLID)
                    }

                    Return (LIDS)
                }
            }
        }

Author Updates & Technical Revisions

Follow-up dispatches by @chris7519

Author Update #1 @chris7519 2009-09-11

Close! It sleeps when the Lid is open instead of closed. Right now I can put it to sleep manually but once awake and the lid is open it keeps going back to sleep...

Update:

I tried:

Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Name (LSTS, Zero)
            Method (_LID, 0, NotSerialized)
            {
                If (ECOK)
                {
                    If (LEqual (^^PCI0.LPC.EC0.ECLS, One))
                    {
                        Store (Zero, LSTS)
                    }
                    Else
                    {
                        Store (One, LSTS)
                    }

                    If (IGDS)
                    {
                        Store (LSTS, LIDS)
                        Store (LSTS, ^^PCI0.OVGA.CLID)
                    }

                    If (LIDS)
                    { 
                        Notify (SLPB, 0x80)
                    }
                    Return (LSTS)
                }
                Else
                {
                    If (IGDS)
                    {
                        Store (LIDS, ^^PCI0.OVGA.CLID)
                    }

                    Return (LIDS)
                }
            }
        }

Now it sleeps when the lid is closed, but I still get the loop where after wake it keeps going back to sleep... Do I need a Return?

Author Update #2 @chris7519 2009-09-11

Alright! One more kext scratched off the list! It needed to be inserted here:

If (ECOK)
                {
                    If (LEqual (^^PCI0.LPC.EC0.ECLS, One))
                    {
                        Store (Zero, LSTS)
                        Notify (SLPB, 0x80)
                    }
                    Else
                    {
                        Store (One, LSTS)
                    }

Thanks once again for the help mormegil... someone buy that man a beer! Now just have to fix issues with battery meter (VoodooBattery is only 32bit) and No sound after sleep issue with patched AppleHDA via DSDT (VoodooHDA v2.2 doesn't let me adjust volume).

Synthesized Community Field Notes

6 technical responses curated from 12 original dispatches

Field Note #1 @uman 2009-09-12

Re: VoodooBattery is only 32bit. Superhai's published the source. Can't it be "ported" and compiled for 64-bit?

Field Note #2 @00oo00 2010-02-11

I HAVE THE SAME PROBLEM CAN U HAVE A CHECK OF MY DSDT AND GIVE ME SOME ADVICE?

REGARS
MIKE

HERE IS MY DSDT. I ALSO HAVE SOME GFX0 FAMILY MATCH ERRORS.

Field Note #3 @Nameci 2010-02-11

and here is mine as well, i already have sleep on lid close but cannot wake on lid open, and if i sleep, i cannot restart well as well as shutdown, there is no video but there is still activity on the wifi, fans and power monitor.

Field Note #4 @Goten 2010-05-26

thanks to mormegil. my laptop now goes to sleep when i close lid. just an issue: now the restart and shutdown processes have become slow (the system remains blocked on the desktop for 10 seconds doing nothing, and then it restart). i don't know why. has anyone the same problem?

Field Note #5 @neXus 2010-07-09

Try to add the PNLF section on your DSDT, it works for me for sleep (no wake) but I avoid the ugly Notify to the SleepButton.

Field Note #6 @SaGaR 2010-12-20

i tried the sleep fix, but i can't get it to work, sleep in general doesn't work, when i press the sleep button, my screen freezes and that's all, when i press the powerbutton i get the restart/shutdown popup and all works again.

Lidsleep also does the same, screen freezes but stays on.

i wanna ask you if you plz wanna look at it?

Corroborated & Participated: @mormegil
Sources & Contributor Provenance (8 credited usernames · Thread #4024)
UsernameDossier ContributionDispatchesActive Window
@chris7519Primary Author32009-09-10 → 2009-09-11
@mormegilCore Contributor32009-09-11
@umanContributor12009-09-12
@00oo00Contributor12010-02-11
@NameciContributor12010-02-11
@GotenContributor12010-05-26
@neXusContributor12010-07-09
@SaGaRContributor12010-12-20