From eab3db41a2ebb51e88525e3dad2be91fe66b0a99 Mon Sep 17 00:00:00 2001 From: Vijay Hiremath Date: Fri, 9 Sep 2016 06:11:53 -0700 Subject: [PATCH] reef: Prepare LID_OPEN GPIO for hibernation LID_OPEN gpio is interrupt trigger on both the edge. If the system is hibernated when LID is open and then LID is closed, system wakes from hibernation. Hence setting the LID_OPEN GPIO as interrupt raising before hibernation so that system won't wake up upon LID close in hibernation. BUG=chrome-os-partner:57221 BRANCH=none TEST=Issued hibernate when LID is open, closed the LID after hibernation observed system won't boot back till LID is open again. Change-Id: Idc89c3d85b7d246c3e18d0ced48e7d47bebeafec Signed-off-by: Vijay Hiremath Reviewed-on: https://chromium-review.googlesource.com/383753 Commit-Ready: Vijay P Hiremath Tested-by: Vijay P Hiremath Reviewed-by: Shawn N --- board/reef/board.c | 1 + board/reef/gpio.inc | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/board/reef/board.c b/board/reef/board.c index 2aa03b584a..0f3e33055c 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -670,6 +670,7 @@ void board_hibernate_late(void) /* Turn off LEDs in hibernate */ {GPIO_BAT_LED_BLUE, GPIO_INPUT | GPIO_PULL_UP}, {GPIO_BAT_LED_AMBER, GPIO_INPUT | GPIO_PULL_UP}, + {GPIO_LID_OPEN, GPIO_INT_RISING | GPIO_PULL_DOWN}, /* * BD99956 handles charge input automatically. We'll disable diff --git a/board/reef/gpio.inc b/board/reef/gpio.inc index 7d950e4fc6..ddace28cb6 100644 --- a/board/reef/gpio.inc +++ b/board/reef/gpio.inc @@ -32,8 +32,11 @@ GPIO_INT(ALL_SYS_PGOOD, PIN(5, 0), GPIO_INT_BOTH, power_signal_interrupt) /* P GPIO_INT(AC_PRESENT, PIN(C, 1), GPIO_INT_BOTH, extpower_interrupt) /* ACOK_OD from BD99955 */ /* TODO: We might remove external pull-up for POWER_BUTTON_L in EVT */ GPIO_INT(POWER_BUTTON_L, PIN(0, 4), GPIO_INT_BOTH, power_button_interrupt) /* MECH_PWR_BTN_ODL */ -/* FIXME(furquan): GPIO_PULL_UP is not required for LID_OPEN on EVT. */ +#if IS_PROTO == 1 GPIO_INT(LID_OPEN, PIN(6, 7), GPIO_INT_BOTH | GPIO_PULL_UP, lid_interrupt) +#else +GPIO_INT(LID_OPEN, PIN(6, 7), GPIO_INT_BOTH, lid_interrupt) +#endif GPIO_INT(EC_VOLDN_BTN_ODL, PIN(8, 3), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(EC_VOLUP_BTN_ODL, PIN(8, 2), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(TABLET_MODE, PIN(3, 6), GPIO_INT_BOTH, tablet_mode_interrupt)