diff options
Diffstat (limited to 'zephyr/shim/include/gpio')
-rw-r--r-- | zephyr/shim/include/gpio/gpio.h | 6 | ||||
-rw-r--r-- | zephyr/shim/include/gpio/gpio_int.h | 25 |
2 files changed, 14 insertions, 17 deletions
diff --git a/zephyr/shim/include/gpio/gpio.h b/zephyr/shim/include/gpio/gpio.h index 6f92ed5795..3f95bdbbe0 100644 --- a/zephyr/shim/include/gpio/gpio.h +++ b/zephyr/shim/include/gpio/gpio.h @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -74,8 +74,8 @@ int gpio_config_unused_pins(void) __attribute__((weak)); */ #define UNUSED_GPIO_CONFIG_BY_IDX(i, _) \ { \ - .dev_name = DT_GPIO_LABEL_BY_IDX(UNUSED_PINS_LIST, \ - unused_gpios, i), \ + .dev_name = DEVICE_DT_NAME(DT_GPIO_CTLR_BY_IDX( \ + UNUSED_PINS_LIST, unused_gpios, i)), \ .pin = DT_GPIO_PIN_BY_IDX(UNUSED_PINS_LIST, unused_gpios, i), \ .flags = DT_GPIO_FLAGS_BY_IDX(UNUSED_PINS_LIST, unused_gpios, \ i), \ 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), |