summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/usbc/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/include/usbc/utils.h')
-rw-r--r--zephyr/shim/include/usbc/utils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/zephyr/shim/include/usbc/utils.h b/zephyr/shim/include/usbc/utils.h
index 53e9a34856..72a2173463 100644
--- a/zephyr/shim/include/usbc/utils.h
+++ b/zephyr/shim/include/usbc/utils.h
@@ -36,4 +36,16 @@
*/
#define USBC_PORT_FROM_INST(inst) USBC_PORT(DT_DRV_INST(inst))
+/*
+ * Check that the TCPC interrupt flag defined in the devicetree is the same as
+ * the hardware.
+ *
+ * @param id: node id of the tcpc port
+ */
+#define TCPC_VERIFY_NO_FLAGS_ACTIVE_ALERT_HIGH(id) \
+ BUILD_ASSERT( \
+ (DT_PROP(id, tcpc_flags) & TCPC_FLAGS_ALERT_ACTIVE_HIGH) == 0, \
+ "TCPC interrupt configuration error for " DT_NODE_FULL_NAME( \
+ id));
+
#endif /* __CROS_EC_ZEPHYR_SHIM_USBC_UTIL */