InfiniteMac OSx86

InfiniteMac OSx86 (http://infinitemac.com/forum.php)
-   10.X (http://infinitemac.com/forumdisplay.php?f=36)
-   -   Clamshell Sleep via DSDT? (http://infinitemac.com/showthread.php?t=4024)

chris7519 09-11-2009 12:32 AM

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 thanks to mormegil!) and clamshell sleep.

Taken from a post by pentiumpc:
Code:

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:
Code:

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)
                }
            }
        }


mormegil 09-11-2009 03:32 PM

Code:

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 (LSTS)
                    {
                        Notify (SLPB, 0x80)
                    }
                    Return (LSTS)
                }
                Else
                {
                    If (IGDS)
                    {
                        Store (LIDS, ^^PCI0.OVGA.CLID)
                    }

                    Return (LIDS)
                }
            }
        }

What the hell.. just give it a try :D

chris7519 09-11-2009 07:23 PM

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:
Code:

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???

mormegil 09-11-2009 09:57 PM

Code:

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)
                        Notify (SLPB, 0x80)
                    }

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

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

                    Return (LIDS)
                }
            }
        }

try it

chris7519 09-11-2009 10:49 PM

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

Code:

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).

mormegil 09-11-2009 11:00 PM

Glad to help.. Nice one!

uman 09-12-2009 05:23 PM

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

00oo00 02-11-2010 08:22 AM

1 Attachment(s)
Hi, mormegil.
I HAVE THE SAME PROBLEM CAN U HAVE A CHECK OF MY DSDT AND GIVE ME SOME ADVICE?
THANKS IN ADVANCE.

REGARS
MIKE

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

Nameci 02-11-2010 01:32 PM

1 Attachment(s)
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.

Goten 05-26-2010 07:09 PM

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?