summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/gpio/gpio_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/include/gpio/gpio_int.h')
-rw-r--r--zephyr/shim/include/gpio/gpio_int.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/zephyr/shim/include/gpio/gpio_int.h b/zephyr/shim/include/gpio/gpio_int.h
index 5cbddf76ca..835c5503ba 100644
--- a/zephyr/shim/include/gpio/gpio_int.h
+++ b/zephyr/shim/include/gpio/gpio_int.h
@@ -1,4 +1,4 @@
-/* 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.
*/
@@ -23,8 +23,7 @@
/*
* Maps nodelabel of interrupt node to internal configuration block.
*/
-#define GPIO_INT_FROM_NODELABEL(lbl) \
- (GPIO_INT_FROM_NODE(DT_NODELABEL(lbl)))
+#define GPIO_INT_FROM_NODELABEL(lbl) (GPIO_INT_FROM_NODE(DT_NODELABEL(lbl)))
/*
* Unique enum name for the interrupt.
@@ -34,17 +33,15 @@
/*
* Create an enum list of the interrupts
*/
-#define GPIO_INT_ENUM_WITH_COMMA(id) GPIO_INT_ENUM(id),
enum gpio_interrupts {
#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_gpio_interrupts)
- DT_FOREACH_CHILD(DT_COMPAT_GET_ANY_STATUS_OKAY(cros_ec_gpio_interrupts),
- GPIO_INT_ENUM_WITH_COMMA)
+ DT_FOREACH_CHILD_SEP(
+ DT_COMPAT_GET_ANY_STATUS_OKAY(cros_ec_gpio_interrupts),
+ GPIO_INT_ENUM, (, )),
#endif
- GPIO_INT_COUNT
+ GPIO_INT_COUNT
};
-#undef GPIO_INT_ENUM_WITH_COMMA
-
/*
* Forward reference to avoiding exposing internal structure
* defined in gpio_int.c
@@ -60,24 +57,24 @@ struct gpio_int_config;
* ... // set up device
* gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(my_interrupt_node));
*/
-int gpio_enable_dt_interrupt(const struct gpio_int_config * const ic);
+int gpio_enable_dt_interrupt(const struct gpio_int_config *const ic);
/*
* Disable the interrupt.
*/
-int gpio_disable_dt_interrupt(const struct gpio_int_config * const ic);
+int gpio_disable_dt_interrupt(const struct gpio_int_config *const ic);
/*
* Get the interrupt config for this interrupt.
*/
const struct gpio_int_config *
- gpio_interrupt_get_config(enum gpio_interrupts intr);
+gpio_interrupt_get_config(enum gpio_interrupts intr);
/*
* Declare interrupt configuration data structures.
*/
-#define GPIO_INT_DECLARE(id) \
- extern const struct gpio_int_config * const GPIO_INT_FROM_NODE(id);
+#define GPIO_INT_DECLARE(id) \
+ extern const struct gpio_int_config *const GPIO_INT_FROM_NODE(id);
#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_gpio_interrupts)
DT_FOREACH_CHILD(DT_COMPAT_GET_ANY_STATUS_OKAY(cros_ec_gpio_interrupts),