View Single Post
 
Old 05-13-2009, 09:57 AM
candykane candykane is offline
Jaguar
 
Join Date: May 2009
Location: schiedam
Posts: 36
got some stuff from insanely , but i think it would look nice in this collection
fixing sleep mode with the _WAK method

information about the _WAK method.
Arguments:
0 The value of the sleeping state (1 for S1, 2 for S2, and so on).
Result Code (2 DWORD package):
Status Bit field of defined conditions that occurred during sleep.
0x00000000 Wake was signaled and was successful
0x00000001 Wake was signaled but failed due to lack of power.
0x00000002 Wake was signaled but failed due to thermal condition.
Other Reserved
PSS If non-zero, the effective S-state the power supply really entered.

This value is used to detect when the targeted S-state was not entered
because of too much current being drawn from the power supply.

OK, so the _WAK method accepts one argument, which is the number of the sleep state that was requested. It returns its result as a package of 2 DWORDs. The first value is a code that tells whether the wake was successful (0 on success, nonzero on failure) and, if not, why. The second value is also zero on success and on failure returns the value of the sleep state that was actually entered. So basically, it's a success/failure code.

The first argument of the package declaration specifies the number of elements in the package, and the second is the package itself. So, the declaration above simply defines a two element package, where each of the elements is zero. This is necessary because the spec requires that the _WAK method return two values.
So, what this really boils down to is a dummy return value that satisfies the spec (thus eliminating the warnings), but doesn't really do anything. It just always returns a success condition.

Fixing sleep mode.

Look for: _WAK

CODE
Method (_WAK, 1, NotSerialized)
{
Store (0xFF, DBG1)
If (LEqual (Arg0, 0x03))
{
Store (0x8F, SCP)
}

If (LEqual (Arg0, 0x04))
{
If (LEqual (OSFL, Zero))
{
If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
Else
{
Store (0x58, SMIP)
}
}

If (LEqual (OSFL, One))
{
Store (0x56, SMIP)
}

If (LEqual (OSFL, 0x02))
{
Store (0x57, SMIP)
}

If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
}

If (LEqual (Arg0, One)) {}
If (OSFL)
{
Notify (\_SB.PWRB, 0x02)
}
Else
{
If (LEqual (RTCW, Zero))
{
Notify (\_SB.PWRB, 0x02)
}
}

Notify (\_SB.PCI0.USB0, Zero)
Notify (\_SB.PCI0.USB1, Zero)
Notify (\_SB.PCI0.USB2, Zero)
Notify (\_SB.PCI0.USB3, Zero)
Notify (\_SB.PCI0.USB4, Zero)
Notify (\_SB.PCI0.USB5, Zero)
Return(Package(0x02){0x00, 0x00}) <------ Add here. Edit dsdt_fixed.txt before compiling
}
Reply With Quote