From 81621671aac91e23d7cbf4e49cdcc2aeee365c95 Mon Sep 17 00:00:00 2001 From: Wenkai Du Date: Thu, 25 Sep 2014 09:40:45 -0700 Subject: [PATCH] auron: add _PRW and _DSW methods to trackpad and touch screen Auron/Peppy use GPIO 12 and GPIO 25 as wake up pins. GPIO_OWN, GPIO_ROUTE, GPnCONFIG registers are setup if _DSW methods are available. Example capture after GPIO 12 and 25 are enabled for wake up: GPIO Registers: GPIO_OWN_0 3dfbea0f GPIO_ROUTE_0 00000000 GPIO Registers: GPnCONFIGA_12 4000000d GPnCONFIGB_12 00000000 GPIO Registers: GPnCONFIGA_25 4000000d GPnCONFIGB_25 00000000 As Duncan suggested, I moved _PRW and _DSW to respective trackpad and touch screen devices, and wake up worked with latest Chrome image R39.6301. Trackpad wake up is automatically enabled after boot. But touch screen wake up is not enabled by powerd on boot. BUG=chrome-os-partner:32047 TEST=check if trackpad can wake up board Change-Id: Idd1e93dee8678044a6756cf36e8fdf4d27cd9676 Signed-off-by: Wenkai Du Reviewed-on: https://chromium-review.googlesource.com/219906 Reviewed-by: Duncan Laurie --- src/mainboard/google/auron/acpi/mainboard.asl | 85 ++++++++----------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/src/mainboard/google/auron/acpi/mainboard.asl b/src/mainboard/google/auron/acpi/mainboard.asl index ebd0f92bdf..c489402bf3 100644 --- a/src/mainboard/google/auron/acpi/mainboard.asl +++ b/src/mainboard/google/auron/acpi/mainboard.asl @@ -37,56 +37,6 @@ Scope (\_SB) { Name(_HID, EisaId("PNP0C0C")) } - - Device (TPAD) - { - Name (_ADR, 0x0) - Name (_UID, 1) - - // Report as a Sleep Button device so Linux will - // automatically enable it as a wake source - Name (_HID, EisaId("PNP0C0E")) - - Name (_CRS, ResourceTemplate() - { - Interrupt (ResourceConsumer, Edge, ActiveLow) - { - BOARD_TRACKPAD_IRQ - } - - VendorShort (ADDR) - { - BOARD_TRACKPAD_I2C_ADDR - } - }) - - Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) - } - - Device (TSCR) - { - Name (_ADR, 0x0) - Name (_UID, 2) - - // Report as a Sleep Button device so Linux will - // automatically enable it as a wake source - Name (_HID, EisaId("PNP0C0E")) - - Name (_CRS, ResourceTemplate() - { - Interrupt (ResourceConsumer, Edge, ActiveLow) - { - BOARD_TOUCHSCREEN_IRQ - } - - VendorShort (ADDR) - { - BOARD_TOUCHSCREEN_I2C_ADDR - } - }) - - Name (_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x3 }) - } } Scope (\_SB.PCI0.I2C0) @@ -122,6 +72,17 @@ Scope (\_SB.PCI0.I2C0) } } + Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BOARD_TRACKPAD_WAKE_GPIO, Local0) + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GPIO.GWAK (Local0) + } + } + /* Allow device to power off in S0 */ Name (_S0W, 4) } @@ -157,6 +118,17 @@ Scope (\_SB.PCI0.I2C0) } } + Name (_PRW, Package() { BOARD_TRACKPAD_WAKE_GPIO, 0x3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BOARD_TRACKPAD_WAKE_GPIO, Local0) + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GPIO.GWAK (Local0) + } + } + /* Allow device to power off in S0 */ Name (_S0W, 4) } @@ -172,7 +144,7 @@ Scope (\_SB.PCI0.I2C1) Name (ISTP, 0) /* TouchScreen */ Name (_CRS, ResourceTemplate() - { + { I2cSerialBus ( 0x4a, // SlaveAddress ControllerInitiated, // SlaveMode @@ -186,6 +158,17 @@ Scope (\_SB.PCI0.I2C1) Interrupt (ResourceConsumer, Edge, ActiveLow) { 38 } }) + Name (_PRW, Package() { BOARD_TOUCHSCREEN_WAKE_GPIO, 0x3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BOARD_TOUCHSCREEN_WAKE_GPIO, Local0) + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GPIO.GWAK (Local0) + } + } + Method (_STA) { If (LEqual (\S2EN, 1)) {