summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/nocturne/board.c22
-rw-r--r--board/nocturne/board.h1
-rw-r--r--board/nocturne/gpio.inc2
3 files changed, 23 insertions, 2 deletions
diff --git a/board/nocturne/board.c b/board/nocturne/board.c
index 5d3f494127..87b8f6c67f 100644
--- a/board/nocturne/board.c
+++ b/board/nocturne/board.c
@@ -26,6 +26,8 @@
#include "hooks.h"
#include "i2c.h"
#include "lid_switch.h"
+#include "lpc.h"
+#include "mkbp_event.h"
#include "motion_sense.h"
#include "power.h"
#include "power_button.h"
@@ -390,6 +392,26 @@ void board_hibernate(void)
;
}
+static int mkbp_uses_gpio(void)
+{
+ return board_get_version() >= 2;
+}
+
+void mkbp_set_host_active(int active)
+{
+ if (mkbp_uses_gpio())
+ mkbp_set_host_active_via_gpio(active);
+
+ /*
+ * Always send the host event for compatibility.
+ * On board versions 2 and newer, the firmware is configured
+ * to not actually trigger an SCI on MKBP events. This means that
+ * the EC can send host event notifications without concern for the
+ * board version and expect the right thing to happen.
+ */
+ mkbp_set_host_active_via_event(active);
+}
+
static void board_init(void)
{
/* Enable USB Type-C interrupts. */
diff --git a/board/nocturne/board.h b/board/nocturne/board.h
index 8ecfe4f0c6..63c409678b 100644
--- a/board/nocturne/board.h
+++ b/board/nocturne/board.h
@@ -85,7 +85,6 @@
/* MKBP */
#define CONFIG_MKBP_EVENT
-#define CONFIG_MKBP_USE_HOST_EVENT
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
/* Sensors */
diff --git a/board/nocturne/gpio.inc b/board/nocturne/gpio.inc
index 985ad56e92..d9e10de5a6 100644
--- a/board/nocturne/gpio.inc
+++ b/board/nocturne/gpio.inc
@@ -61,7 +61,7 @@ GPIO(EC_BRD_ID0, PIN(4, 0), GPIO_INPUT)
GPIO(EC_BRD_ID1, PIN(9, 6), GPIO_INPUT)
GPIO(EC_BRD_ID2, PIN(9, 3), GPIO_INPUT)
GPIO(EC_BRD_ID3, PIN(F, 0), GPIO_INPUT)
-GPIO(EC_GPIO95, PIN(9, 5), GPIO_OUT_LOW)
+GPIO(EC_INT_L, PIN(9, 5), GPIO_OUT_HIGH)
GPIO(UHALL_PWR_EN, PIN(E, 0), GPIO_OUT_HIGH)
GPIO(USB2_VBUSSENSE, PIN(A, 2), GPIO_OUT_LOW)
GPIO(USB2_ID, PIN(A, 0), GPIO_OUT_LOW)