From d8354778f4af8c5a58dddb82b9f539d7b5be4a27 Mon Sep 17 00:00:00 2001 From: Boris Mittelberg Date: Wed, 14 Apr 2021 22:44:05 +0000 Subject: brya: add lid_open interrupt Any change on LID_OPEN line coming from GMR will trigger an interrupt. Notes: on P0 there is no magnet, so the interrupt will never be triggered on P1 the magnet is upside down, so lidstate would always report "open" BRANCH=none BUG=b:185322560 TEST=manual test with a magnet: when magnet approaches the GMR sensor with correct orientation - lid close event happens. Depending on the OS state the system shuts down or enters sleep. When the magnet is removed the system wakes up Signed-off-by: Boris Mittelberg Change-Id: I427c15d4f75add34266701089e05f99a924a5b3a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2827411 Reviewed-by: Tim Wawrzynczak --- board/brya/board.c | 1 + board/brya/generated-gpio.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/brya/board.c b/board/brya/board.c index 8d6b6f9209..d4af09d5c6 100644 --- a/board/brya/board.c +++ b/board/brya/board.c @@ -14,6 +14,7 @@ #include "driver/accelgyro_lsm6dso.h" #include "driver/als_tcs3400.h" #include "hooks.h" +#include "lid_switch.h" #include "power_button.h" #include "power.h" #include "switch.h" diff --git a/board/brya/generated-gpio.inc b/board/brya/generated-gpio.inc index c2bea63d4a..732b35aceb 100644 --- a/board/brya/generated-gpio.inc +++ b/board/brya/generated-gpio.inc @@ -12,6 +12,7 @@ GPIO_INT(EC_VOLDN_BTN_ODL, PIN(9, 3), GPIO_INT_BOTH | GPIO_PULL_UP GPIO_INT(EC_VOLUP_BTN_ODL, PIN(9, 7), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(EC_WP_ODL, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) GPIO_INT(GSC_EC_PWR_BTN_ODL, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH, lid_interrupt) GPIO_INT(SEQ_EC_ALL_SYS_PG, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(SEQ_EC_DSW_PWROK, PIN(C, 7), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(SEQ_EC_RSMRST_ODL, PIN(E, 2), GPIO_INT_BOTH, power_signal_interrupt) @@ -69,7 +70,6 @@ GPIO(EN_PP5000_FAN, PIN(6, 1), GPIO_OUT_HIGH) GPIO(EN_PP5000_USBA_R, PIN(D, 7), GPIO_OUT_LOW) GPIO(EN_S5_RAILS, PIN(B, 6), GPIO_OUT_LOW) GPIO(IMVP9_VRRDY_OD, PIN(4, 3), GPIO_INPUT) -GPIO(LID_OPEN, PIN(D, 2), GPIO_INPUT) GPIO(PCH_PWROK, PIN(7, 2), GPIO_OUT_LOW) GPIO(SYS_RST_ODL, PIN(C, 5), GPIO_ODR_HIGH) GPIO(USB_C0_C2_TCPC_RST_ODL, PIN(3, 4), GPIO_ODR_LOW) -- cgit v1.2.1