summaryrefslogtreecommitdiff
path: root/zephyr/include
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2021-06-24 09:27:09 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-28 23:30:36 +0000
commit92a6d035526a4914e03e06d4eb7b0a6c928938e2 (patch)
treef0bc809492890f8dd056fbc177fe615f37b2c3a8 /zephyr/include
parent9679fba5d5dec3e68401ad56c4137c055116d683 (diff)
downloadchrome-ec-92a6d035526a4914e03e06d4eb7b0a6c928938e2.tar.gz
zephyr: add support for mkbp wake event mask
Add support in the devicetree for masking mkbp events to prevent said events from waking up a suspended system. BUG=b:190503252 BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ib53b8f96c2fb4704e25ce4fb62eb277a16d92cd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985820
Diffstat (limited to 'zephyr/include')
-rw-r--r--zephyr/include/dt-bindings/wake_mask_event_defines.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/zephyr/include/dt-bindings/wake_mask_event_defines.h b/zephyr/include/dt-bindings/wake_mask_event_defines.h
new file mode 100644
index 0000000000..80be063279
--- /dev/null
+++ b/zephyr/include/dt-bindings/wake_mask_event_defines.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2021 Google LLC.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#ifndef DT_BINDINGS_WAKE_MASK_EVENT_DEFINES_H_
+#define DT_BINDINGS_WAKE_MASK_EVENT_DEFINES_H_
+
+#ifndef BIT
+#define BIT(n) (1U << n)
+#endif
+
+/*
+ * NOTE: The convention in the Zephyr code is to have the public header file
+ * include the dt-binding header file to avoid duplicate definitions.
+ * However, ec_commands.h is shared with the linux kernel so we can't do that.
+ *
+ * Please consult include/ec_commands.h for explanations of the macros
+ * defined in this file.
+ */
+
+#define MKBP_EVENT_KEY_MATRIX BIT(0)
+#define MKBP_EVENT_HOST_EVENT BIT(1)
+#define MKBP_EVENT_SENSOR_FIFO BIT(2)
+#define MKBP_EVENT_BUTTON BIT(3)
+#define MKBP_EVENT_SWITCH BIT(4)
+#define MKBP_EVENT_FINGERPRINT BIT(5)
+#define MKBP_EVENT_SYSRQ BIT(6)
+#define MKBP_EVENT_HOST_EVENT64 BIT(7)
+#define MKBP_EVENT_CEC_EVENT BIT(8)
+#define MKBP_EVENT_CEC_MESSAGE BIT(9)
+#define MKBP_EVENT_DP_ALT_MODE_ENTERED BIT(10)
+#define MKBP_EVENT_ONLINE_CALIBRATION BIT(11)
+#define MKBP_EVENT_PCHG BIT(12)
+
+#define HOST_EVENT_NONE BIT(0)
+#define HOST_EVENT_LID_CLOSED BIT(1)
+#define HOST_EVENT_LID_OPEN BIT(2)
+#define HOST_EVENT_POWER_BUTTON BIT(3)
+#define HOST_EVENT_AC_CONNECTED BIT(4)
+#define HOST_EVENT_AC_DISCONNECTED BIT(5)
+#define HOST_EVENT_BATTERY_LOW BIT(6)
+#define HOST_EVENT_BATTERY_CRITICAL BIT(7)
+#define HOST_EVENT_BATTERY BIT(8)
+#define HOST_EVENT_THERMAL_THRESHOLD BIT(9)
+#define HOST_EVENT_DEVICE BIT(10)
+#define HOST_EVENT_THERMAL BIT(11)
+#define HOST_EVENT_USB_CHARGER BIT(12)
+#define HOST_EVENT_KEY_PRESSED BIT(13)
+#define HOST_EVENT_INTERFACE_READY BIT(14)
+#define HOST_EVENT_KEYBOARD_RECOVERY BIT(15)
+#define HOST_EVENT_THERMAL_SHUTDOWN BIT(16)
+#define HOST_EVENT_BATTERY_SHUTDOWN BIT(17)
+#define HOST_EVENT_THROTTLE_START BIT(18)
+#define HOST_EVENT_THROTTLE_STOP BIT(19)
+#define HOST_EVENT_HANG_DETECT BIT(20)
+#define HOST_EVENT_HANG_REBOOT BIT(21)
+#define HOST_EVENT_PD_MCU BIT(22)
+#define HOST_EVENT_BATTERY_STATUS BIT(23)
+#define HOST_EVENT_PANIC BIT(24)
+#define HOST_EVENT_KEYBOARD_FASTBOOT BIT(25)
+#define HOST_EVENT_RTC BIT(26)
+#define HOST_EVENT_MKBP BIT(27)
+#define HOST_EVENT_USB_MUX BIT(28)
+#define HOST_EVENT_MODE_CHANGE BIT(29)
+#define HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT BIT(30)
+#define HOST_EVENT_WOV BIT(31)
+#define HOST_EVENT_INVALID BIT(32)
+
+#endif /* DT_BINDINGS_WAKE_MASK_EVENT_DEFINES_H_ */
+