From 8378d1178ea4384554974aec37eb54547e70e358 Mon Sep 17 00:00:00 2001 From: Zhuohao Lee Date: Fri, 29 Oct 2021 01:38:51 +0800 Subject: brask: Enable recovery key to send event to OS In order to make the recovery key to trigger the sysrq and warm reset to the OS, we move the pin to the irq for receiving the button interrupt and then passing the key event to the OS via MKBP event. BUG=b:204512547 BRANCH=None TEST=1. Press/release recovery button shortly -> sysrq sent 2. Press/hold recovery button at least 4s -> warm reset Change-Id: I7d86851b12b4771a43985c2891c7e8b9299d32e4 Signed-off-by: Zhuohao Lee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251206 Reviewed-by: Andrew McRae Commit-Queue: Andrew McRae --- board/brask/board.c | 1 + board/brask/gpio.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/brask/board.c b/board/brask/board.c index 8b53f63eec..7fb0162d17 100644 --- a/board/brask/board.c +++ b/board/brask/board.c @@ -4,6 +4,7 @@ */ #include "assert.h" +#include "button.h" #include "charge_manager.h" #include "charge_state_v2.h" #include "common.h" diff --git a/board/brask/gpio.inc b/board/brask/gpio.inc index b79690c903..49403519c6 100644 --- a/board/brask/gpio.inc +++ b/board/brask/gpio.inc @@ -27,6 +27,7 @@ GPIO_INT(USB_C2_BC12_INT_ODL, PIN(8, 3), GPIO_INT_FALLING, bc12_interrupt GPIO_INT(USB_C2_PPC_INT_ODL, PIN(7, 0), GPIO_INT_FALLING, ppc_interrupt) GPIO_INT(USB_C2_RT_INT_ODL, PIN(4, 1), GPIO_INT_FALLING, retimer_interrupt) GPIO_INT(BJ_ADP_PRESENT_ODL, PIN(8, 2), GPIO_INT_BOTH | GPIO_PULL_UP, adp_connect_interrupt) +GPIO_INT(EC_RECOVERY_BTN_OD, PIN(2, 3), GPIO_INT_BOTH, button_interrupt) /* CCD */ GPIO(CCD_MODE_ODL, PIN(E, 5), GPIO_INPUT) @@ -65,7 +66,6 @@ GPIO(CPU_C10_GATE_L, PIN(6, 7), GPIO_INPUT) /* Button */ GPIO(EC_PCH_PWR_BTN_ODL, PIN(C, 1), GPIO_ODR_HIGH) -GPIO(EC_RECOVERY_BTN_OD, PIN(2, 3), GPIO_INPUT) GPIO(GSC_EC_RECOVERY_BTN_OD, PIN(2, 2), GPIO_INPUT) /* NFC */ -- cgit v1.2.1