hp/pavilion_m6_1035dx: Suspend/resume on lid close/open with ACPI

This patch completes ACPI support for the lid switch. The lid SCI now
notifies the OSPM of the status change when the lid is closed or
opened, allowing system to suspend. The wake source is also declares,
and the system wakes when the lid is opened.

The system resumes successfully, but the display still does not come
back on.

Change-Id: I803c4fc64e15f8d1a90791ec246af66604646d8b
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/5549
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Alexandru Gagniuc 2014-04-18 21:29:59 -05:00
parent c4e7db51fc
commit c38d991387
3 changed files with 28 additions and 0 deletions

View File

@ -54,6 +54,15 @@ Scope(\_GPE) { /* Start Scope GPE */
/* DBGO("\\_GPE\\_L11\n") */
}
/* Lid switch opened or closed */
Method(_L16) {
Store("Lid status changed", Debug)
/* Flip trigger polarity */
Not(LPOL, LPOL)
/* Notify lid object of status change */
Notify(\_SB.LID, 0x80)
}
/* GPIO0 or GEvent8 event */
Method(_L18) {
/* DBGO("\\_GPE\\_L18\n") */

View File

@ -57,6 +57,14 @@
GE22, 1, /* General event 22 - connected to lid switch */
}
/* SMI/SCI control block -- hardcoded to 0xfed80200 by AGESA */
OperationRegion (SMIX, SystemMemory, 0xfed80200, 0x100)
Field (SMIX, AnyAcc, NoLock, Preserve) {
Offset (0x08), /* SCI level: 0 = active low, 1 = active high */
, 22,
LPOL, 1, /* SCI22 trigger polarity - lid switch */
}
/*
* Used by EC code on certain events
*
@ -75,10 +83,19 @@ Scope (\_SB) {
Device (LID)
{
Name(_HID, EisaId("PNP0C0D"))
Name(_PRW, Package () {EC_LID_GPE, 0x04}) /* wake from S1-S4 */
Method(_LID, 0)
{
Return (GE22) /* GE pin 22 */
}
Method (_INI, 0)
{
/* Make sure lid trigger polarity is set so that we
* trigger an SCI when lid status changes.
*/
Not(GE22, LPOL)
}
}
Device (MB) {

View File

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mainboard.h"
/* DefinitionBlock Statement */
DefinitionBlock (
"DSDT.AML", /* Output filename */