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.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/zephyr/shim/include/usbc/utils.h b/zephyr/shim/include/usbc/utils.h
index 49b9aa4b71..53e9a34856 100644
--- a/zephyr/shim/include/usbc/utils.h
+++ b/zephyr/shim/include/usbc/utils.h
@@ -1,22 +1,19 @@
-/* Copyright 2022 The Chromium OS Authors. All rights reserved.
+/* Copyright 2022 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __CROS_EC_ZEPHYR_SHIM_USBC_UTIL
-
/*
* Enable interrupt from the `irq` property of an instance's node.
*
* @param inst: instance number
*/
-#define BC12_GPIO_ENABLE_INTERRUPT(inst) \
- IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, irq), \
- (gpio_enable_dt_interrupt( \
- GPIO_INT_FROM_NODE(DT_INST_PHANDLE(inst, irq)));\
- ) \
- )
+#define BC12_GPIO_ENABLE_INTERRUPT(inst) \
+ IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, irq), \
+ (gpio_enable_dt_interrupt( \
+ GPIO_INT_FROM_NODE(DT_INST_PHANDLE(inst, irq)));))
/*
* Get the port number from a child of `named-usbc-port` node.
@@ -26,11 +23,17 @@
#define USBC_PORT(id) DT_REG_ADDR(DT_PARENT(id))
/*
+ * Get the port number from a `named-usbc-port` node.
+ *
+ * @param id: `named-usbc-port` node id
+ */
+#define USBC_PORT_NEW(id) DT_REG_ADDR(id)
+
+/*
* Get the port number from a child of `named-usbc-port` node.
*
* @param inst: instance number of the node
*/
#define USBC_PORT_FROM_INST(inst) USBC_PORT(DT_DRV_INST(inst))
-
#endif /* __CROS_EC_ZEPHYR_SHIM_USBC_UTIL */