summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2021-10-29 01:38:51 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-03 11:16:20 +0000
commit8378d1178ea4384554974aec37eb54547e70e358 (patch)
tree9fcfa91d5df0f65594f19c4cbe32e08e9cabd1f2
parentcf24279a27b5196f1cf9052d369cacef3ffee730 (diff)
downloadchrome-ec-8378d1178ea4384554974aec37eb54547e70e358.tar.gz
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 <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251206 Reviewed-by: Andrew McRae <amcrae@google.com> Commit-Queue: Andrew McRae <amcrae@google.com>
-rw-r--r--baseboard/brask/baseboard.h1
-rw-r--r--board/brask/board.c1
-rw-r--r--board/brask/gpio.inc2
3 files changed, 2 insertions, 2 deletions
diff --git a/baseboard/brask/baseboard.h b/baseboard/brask/baseboard.h
index 4b9d8f386a..c07a177327 100644
--- a/baseboard/brask/baseboard.h
+++ b/baseboard/brask/baseboard.h
@@ -88,7 +88,6 @@
/* Buttons */
#define CONFIG_DEDICATED_RECOVERY_BUTTON
-#define CONFIG_DEDICATED_RECOVERY_BUTTON_2
#define CONFIG_EMULATED_SYSRQ
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_IGNORE_LID
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 */