drivers: gpio: Refactor drivers to use shared init priority

Refactors all of the on-chip GPIO drivers to use a shared driver class
initialization priority configuration, CONFIG_GPIO_INIT_PRIORITY, to
allow configuring GPIO drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

Most drivers previously used CONFIG_KERNEL_INIT_PRIORITY_DEFAULT or
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, therefore the default for this new
option is the lower of the two, which means earlier initialization.

Driver-specific options for off-chip I2C- or SPI-based GPIO drivers are
left intact because they often need to be initialized at a different
priority than on-chip GPIO drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2021-11-05 16:58:21 -05:00 committed by Christopher Friedt
commit 836651b453
49 changed files with 85 additions and 91 deletions

View file

@ -7,6 +7,9 @@ config BOARD
if GPIO if GPIO
config GPIO_INIT_PRIORITY
default 70
config GPIO_DW config GPIO_DW
default y default y

View file

@ -11,6 +11,9 @@ config BOARD
if GPIO if GPIO
config GPIO_INIT_PRIORITY
default 70
config GPIO_DW config GPIO_DW
default y default y

View file

@ -8,6 +8,9 @@ config BOARD
if GPIO if GPIO
config GPIO_INIT_PRIORITY
default 60
config GPIO_DW config GPIO_DW
default y default y

View file

@ -11,7 +11,7 @@ config BOARD_VDD_PWR_CTRL_INIT_PRIORITY
depends on GPIO depends on GPIO
help help
Initialization priority for the VDD power rail. Has to be greater Initialization priority for the VDD power rail. Has to be greater
than GPIO_NRF_INIT_PRIORITY. than GPIO_INIT_PRIORITY.
config BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY config BOARD_CCS_VDD_PWR_CTRL_INIT_PRIORITY
int "CCS_VDD power rail init priority" int "CCS_VDD power rail init priority"

View file

@ -42,8 +42,8 @@ static int pwr_ctrl_init(const struct device *dev)
* constraints. * constraints.
*/ */
#if CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY <= CONFIG_GPIO_NRF_INIT_PRIORITY #if CONFIG_BOARD_VDD_PWR_CTRL_INIT_PRIORITY <= CONFIG_GPIO_INIT_PRIORITY
#error GPIO_NRF_INIT_PRIORITY must be lower than \ #error GPIO_INIT_PRIORITY must be lower than \
BOARD_VDD_PWR_CTRL_INIT_PRIORITY BOARD_VDD_PWR_CTRL_INIT_PRIORITY
#endif #endif

View file

@ -19,6 +19,13 @@ config ADC_INIT_PRIORITY
endif # ADC endif # ADC
if GPIO
config GPIO_INIT_PRIORITY
default 99
endif # GPIO
if EEPROM if EEPROM
config I2C config I2C

View file

@ -119,6 +119,9 @@ config INTEL_GNA
if GPIO if GPIO
config GPIO_INIT_PRIORITY
default 70
config GPIO_DW config GPIO_DW
default y default y

View file

@ -21,6 +21,12 @@ config GPIO_SHELL
help help
Enable GPIO Shell for testing. Enable GPIO Shell for testing.
config GPIO_INIT_PRIORITY
int "GPIO init priority"
default KERNEL_INIT_PRIORITY_DEFAULT
help
GPIO driver device initialization priority.
source "drivers/gpio/Kconfig.b91" source "drivers/gpio/Kconfig.b91"
source "drivers/gpio/Kconfig.dw" source "drivers/gpio/Kconfig.dw"

View file

@ -6,18 +6,8 @@
# Workaround for not being able to have commas in macro arguments # Workaround for not being able to have commas in macro arguments
DT_COMPAT_SNPS_CREG_GPIO := snps,creg-gpio DT_COMPAT_SNPS_CREG_GPIO := snps,creg-gpio
menuconfig GPIO_SNPS_CREG config GPIO_SNPS_CREG
bool "SNPS CREG GPIO" bool "SNPS CREG GPIO"
default $(dt_compat_enabled,$(DT_COMPAT_SNPS_CREG_GPIO)) default $(dt_compat_enabled,$(DT_COMPAT_SNPS_CREG_GPIO))
help help
Enable driver for SNPS CREG GPIO. Enable driver for SNPS CREG GPIO.
if GPIO_SNPS_CREG
config GPIO_SNPS_CREG_INIT_PRIORITY
int "Init priority"
default 70
help
Device driver initialization priority.
endif # GPIO_SNPS_CREG

View file

@ -13,12 +13,6 @@ if GPIO_DW
config GPIO_DW_SHARED_IRQ config GPIO_DW_SHARED_IRQ
bool bool
config GPIO_DW_INIT_PRIORITY
int "Init priority"
default 60
help
Device driver initialization priority.
config GPIO_DW_CLOCK_GATE config GPIO_DW_CLOCK_GATE
bool "Enable clock gating" bool "Enable clock gating"
select CLOCK_CONTROL select CLOCK_CONTROL

View file

@ -3,7 +3,7 @@
# Copyright (c) 2019 Vestas Wind Systems A/S # Copyright (c) 2019 Vestas Wind Systems A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
menuconfig GPIO_LMP90XXX config GPIO_LMP90XXX
bool "LMP90xxx GPIO driver" bool "LMP90xxx GPIO driver"
depends on ADC_LMP90XXX_GPIO depends on ADC_LMP90XXX_GPIO
help help
@ -14,11 +14,3 @@ menuconfig GPIO_LMP90XXX
The GPIO port of the LMP90xxx (D6 to D0) is exposed as a The GPIO port of the LMP90xxx (D6 to D0) is exposed as a
GPIO controller driver with read/write support. GPIO controller driver with read/write support.
config GPIO_LMP90XXX_INIT_PRIORITY
int "Driver init priority"
default 99
depends on GPIO_LMP90XXX
help
Device driver initialization priority. This driver must be
initialized after the LMP90xxx ADC driver.

View file

@ -11,12 +11,6 @@ menuconfig GPIO_NRFX
if GPIO_NRFX if GPIO_NRFX
config GPIO_NRF_INIT_PRIORITY
int "nRF GPIO initialization priority"
default 40
help
Initialization priority for nRF GPIO.
choice choice
prompt "nRF GPIO edge interrupts mechanism" prompt "nRF GPIO edge interrupts mechanism"
default GPIO_NRF_INT_EDGE_USING_GPIOTE default GPIO_NRF_INT_EDGE_USING_GPIOTE

View file

@ -15,12 +15,6 @@ menuconfig GPIO_SX1509B
if GPIO_SX1509B if GPIO_SX1509B
config GPIO_SX1509B_INIT_PRIORITY
int "Init priority"
default 70
help
Device driver initialization priority.
config GPIO_SX1509B_INTERRUPT config GPIO_SX1509B_INTERRUPT
bool "Interrupt enable" bool "Interrupt enable"
default n default n

View file

@ -353,7 +353,7 @@ static int gpio_atcgpio100_init(const struct device *port)
&gpio_atcgpio100_data_##n, \ &gpio_atcgpio100_data_##n, \
&gpio_atcgpio100_config_##n, \ &gpio_atcgpio100_config_##n, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_atcgpio100_api); \ &gpio_atcgpio100_api); \
\ \
static void gpio_atcgpio100_cfg_func_##n(void) \ static void gpio_atcgpio100_cfg_func_##n(void) \

View file

@ -562,7 +562,7 @@ static void gpio_b91_irq_connect_4(void)
&gpio_b91_data_##n, \ &gpio_b91_data_##n, \
&gpio_b91_config_##n, \ &gpio_b91_config_##n, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_b91_driver_api); &gpio_b91_driver_api);
DT_INST_FOREACH_STATUS_OKAY(GPIO_B91_INIT) DT_INST_FOREACH_STATUS_OKAY(GPIO_B91_INIT)

View file

@ -283,5 +283,5 @@ static const struct gpio_driver_api gpio_cc13xx_cc26xx_driver_api = {
DEVICE_DT_INST_DEFINE(0, gpio_cc13xx_cc26xx_init, DEVICE_DT_INST_DEFINE(0, gpio_cc13xx_cc26xx_init,
NULL, &gpio_cc13xx_cc26xx_data_0, NULL, &gpio_cc13xx_cc26xx_data_0,
&gpio_cc13xx_cc26xx_cfg_0, &gpio_cc13xx_cc26xx_cfg_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_cc13xx_cc26xx_driver_api); &gpio_cc13xx_cc26xx_driver_api);

View file

@ -263,7 +263,7 @@ static const struct gpio_driver_api api_funcs = {
DEVICE_DT_INST_DEFINE(n, &gpio_cc32xx_a##n##_init, \ DEVICE_DT_INST_DEFINE(n, &gpio_cc32xx_a##n##_init, \
NULL, &gpio_cc32xx_a##n##_data, \ NULL, &gpio_cc32xx_a##n##_data, \
&gpio_cc32xx_a##n##_config, \ &gpio_cc32xx_a##n##_config, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&api_funcs) &api_funcs)
#define GPIO_CC32XX_INIT(n) \ #define GPIO_CC32XX_INIT(n) \

View file

@ -277,7 +277,7 @@ static int gpio_cmsdk_ahb_init(const struct device *dev)
NULL, \ NULL, \
&gpio_cmsdk_port_##n##_data, \ &gpio_cmsdk_port_##n##_data, \
&gpio_cmsdk_port_## n ##_config, \ &gpio_cmsdk_port_## n ##_config, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_cmsdk_ahb_drv_api_funcs); \ &gpio_cmsdk_ahb_drv_api_funcs); \
\ \
static void gpio_cmsdk_port_##n##_config_func(const struct device *dev) \ static void gpio_cmsdk_port_##n##_config_func(const struct device *dev) \

View file

@ -156,5 +156,5 @@ static struct creg_gpio_drv_data creg_gpio_drvdata = {
DEVICE_DT_INST_DEFINE(0, creg_gpio_init, NULL, DEVICE_DT_INST_DEFINE(0, creg_gpio_init, NULL,
&creg_gpio_drvdata, &creg_gpio_cfg, &creg_gpio_drvdata, &creg_gpio_cfg,
POST_KERNEL, CONFIG_GPIO_SNPS_CREG_INIT_PRIORITY, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_table); &api_table);

View file

@ -536,7 +536,7 @@ static struct gpio_dw_runtime gpio_0_runtime = {
DEVICE_DT_INST_DEFINE(0, DEVICE_DT_INST_DEFINE(0,
gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_0_runtime, gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_0_runtime,
&gpio_config_0, POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY, &gpio_config_0, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_funcs); &api_funcs);
#if DT_INST_IRQ_HAS_CELL(0, flags) #if DT_INST_IRQ_HAS_CELL(0, flags)
@ -598,7 +598,7 @@ static struct gpio_dw_runtime gpio_1_runtime = {
DEVICE_DT_INST_DEFINE(1, DEVICE_DT_INST_DEFINE(1,
gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_1_runtime, gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_1_runtime,
&gpio_dw_config_1, POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY, &gpio_dw_config_1, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_funcs); &api_funcs);
#if DT_INST_IRQ_HAS_CELL(1, flags) #if DT_INST_IRQ_HAS_CELL(1, flags)
@ -659,7 +659,7 @@ static struct gpio_dw_runtime gpio_2_runtime = {
DEVICE_DT_INST_DEFINE(2, DEVICE_DT_INST_DEFINE(2,
gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_2_runtime, gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_2_runtime,
&gpio_dw_config_2, POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY, &gpio_dw_config_2, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_funcs); &api_funcs);
#if DT_INST_IRQ_HAS_CELL(2, flags) #if DT_INST_IRQ_HAS_CELL(2, flags)
@ -720,7 +720,7 @@ static struct gpio_dw_runtime gpio_3_runtime = {
DEVICE_DT_INST_DEFINE(3, DEVICE_DT_INST_DEFINE(3,
gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_3_runtime, gpio_dw_initialize, gpio_dw_device_pm_action, &gpio_3_runtime,
&gpio_dw_config_3, POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY, &gpio_dw_config_3, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_funcs); &api_funcs);
#if DT_INST_IRQ_HAS_CELL(3, flags) #if DT_INST_IRQ_HAS_CELL(3, flags)

View file

@ -713,7 +713,7 @@ static int gpio_emul_pm_device_pm_action(const struct device *dev,
gpio_emul_pm_device_pm_action, \ gpio_emul_pm_device_pm_action, \
&gpio_emul_data_##_num, \ &gpio_emul_data_##_num, \
&gpio_emul_config_##_num, POST_KERNEL, \ &gpio_emul_config_##_num, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_emul_driver) &gpio_emul_driver)
DT_INST_FOREACH_STATUS_OKAY(DEFINE_GPIO_EMUL); DT_INST_FOREACH_STATUS_OKAY(DEFINE_GPIO_EMUL);

View file

@ -404,5 +404,5 @@ DEVICE_DT_INST_DEFINE(0,
&gpio_eos_s3_data, &gpio_eos_s3_data,
&gpio_eos_s3_config, &gpio_eos_s3_config,
POST_KERNEL, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, CONFIG_GPIO_INIT_PRIORITY,
&gpio_eos_s3_driver_api); &gpio_eos_s3_driver_api);

View file

@ -418,7 +418,7 @@ static const struct gpio_driver_api gpio_esp32_driver_api = {
&gpio_data_##_id, \ &gpio_data_##_id, \
&gpio_config_##_id, \ &gpio_config_##_id, \
PRE_KERNEL_2, \ PRE_KERNEL_2, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_esp32_driver_api); &gpio_esp32_driver_api);
DT_INST_FOREACH_STATUS_OKAY(ESP_SOC_GPIO_INIT); DT_INST_FOREACH_STATUS_OKAY(ESP_SOC_GPIO_INIT);

View file

@ -13,6 +13,11 @@
#include "gpio_utils.h" #include "gpio_utils.h"
#if CONFIG_GPIO_GECKO_COMMON_INIT_PRIORITY >= CONFIG_GPIO_INIT_PRIORITY
#error CONFIG_GPIO_GECKO_COMMON_INIT_PRIORITY must be less than \
CONFIG_GPIO_INIT_PRIORITY.
#endif
/* /*
* Macros to set the GPIO MODE registers * Macros to set the GPIO MODE registers
* *
@ -325,7 +330,7 @@ DEVICE_DT_INST_DEFINE(idx, \
NULL, \ NULL, \
&gpio_gecko_port##idx##_data, \ &gpio_gecko_port##idx##_data, \
&gpio_gecko_port##idx##_config, \ &gpio_gecko_port##idx##_config, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_gecko_driver_api); \ &gpio_gecko_driver_api); \
\ \
static int gpio_gecko_port##idx##_init(const struct device *dev) \ static int gpio_gecko_port##idx##_init(const struct device *dev) \

View file

@ -226,7 +226,7 @@ static const struct gpio_driver_api imx_gpio_driver_api = {
&imx_gpio_##n##_data, \ &imx_gpio_##n##_data, \
&imx_gpio_##n##_config, \ &imx_gpio_##n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&imx_gpio_driver_api); \ &imx_gpio_driver_api); \
\ \
static int imx_gpio_##n##_init(const struct device *port) \ static int imx_gpio_##n##_init(const struct device *port) \

View file

@ -596,7 +596,7 @@ int gpio_intel_init(const struct device *dev)
NULL, \ NULL, \
&gpio_intel_data_##n, \ &gpio_intel_data_##n, \
&gpio_intel_cfg_##n, \ &gpio_intel_cfg_##n, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_intel_api); &gpio_intel_api);
/* "sub" devices. no more than GPIO_INTEL_NR_SUBDEVS of these! */ /* "sub" devices. no more than GPIO_INTEL_NR_SUBDEVS of these! */

View file

@ -597,7 +597,7 @@ DEVICE_DT_INST_DEFINE(inst, \
&gpio_ite_data_##inst, \ &gpio_ite_data_##inst, \
&gpio_ite_cfg_##inst, \ &gpio_ite_cfg_##inst, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_ite_driver_api); &gpio_ite_driver_api);
DT_INST_FOREACH_STATUS_OKAY(GPIO_ITE_DEV_CFG_DATA) DT_INST_FOREACH_STATUS_OKAY(GPIO_ITE_DEV_CFG_DATA)
@ -624,4 +624,4 @@ static int gpio_it8xxx2_init_set(const struct device *arg)
return 0; return 0;
} }
SYS_INIT(gpio_it8xxx2_init_set, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); SYS_INIT(gpio_it8xxx2_init_set, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY);

View file

@ -317,7 +317,7 @@ static const struct gpio_driver_api gpio_litex_driver_api = {
&gpio_litex_data_##n, \ &gpio_litex_data_##n, \
&gpio_litex_cfg_##n, \ &gpio_litex_cfg_##n, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_litex_driver_api \ &gpio_litex_driver_api \
); \ ); \
\ \

View file

@ -158,7 +158,7 @@ static const struct gpio_driver_api gpio_lmp90xxx_api = {
.port_get_raw = gpio_lmp90xxx_port_get_raw, .port_get_raw = gpio_lmp90xxx_port_get_raw,
}; };
BUILD_ASSERT(CONFIG_GPIO_LMP90XXX_INIT_PRIORITY > BUILD_ASSERT(CONFIG_GPIO_INIT_PRIORITY >
CONFIG_ADC_INIT_PRIORITY, CONFIG_ADC_INIT_PRIORITY,
"LMP90xxx GPIO driver must be initialized after LMP90xxx ADC " "LMP90xxx GPIO driver must be initialized after LMP90xxx ADC "
"driver"); "driver");
@ -179,7 +179,7 @@ BUILD_ASSERT(CONFIG_GPIO_LMP90XXX_INIT_PRIORITY >
NULL, \ NULL, \
&gpio_lmp90xxx_##id##_data, \ &gpio_lmp90xxx_##id##_data, \
&gpio_lmp90xxx_##id##_cfg, POST_KERNEL, \ &gpio_lmp90xxx_##id##_cfg, POST_KERNEL, \
CONFIG_GPIO_LMP90XXX_INIT_PRIORITY, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_lmp90xxx_api); &gpio_lmp90xxx_api);
DT_INST_FOREACH_STATUS_OKAY(GPIO_LMP90XXX_DEVICE) DT_INST_FOREACH_STATUS_OKAY(GPIO_LMP90XXX_DEVICE)

View file

@ -593,7 +593,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio##id), \
NULL, \ NULL, \
&gpio_lpc11u6x_data_##id, \ &gpio_lpc11u6x_data_##id, \
&gpio_lpc11u6x_config_##id, \ &gpio_lpc11u6x_config_##id, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_lpc11u6x_driver_api) &gpio_lpc11u6x_driver_api)
#if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay) #if DT_NODE_HAS_STATUS(DT_NODELABEL(gpio0), okay)

View file

@ -355,7 +355,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_000_036),
gpio_xec_port000_036_init, gpio_xec_port000_036_init,
NULL, NULL,
&gpio_xec_port000_036_data, &gpio_xec_port000_036_config, &gpio_xec_port000_036_data, &gpio_xec_port000_036_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port000_036_init(const struct device *dev) static int gpio_xec_port000_036_init(const struct device *dev)
@ -401,7 +401,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_040_076),
gpio_xec_port040_076_init, gpio_xec_port040_076_init,
NULL, NULL,
&gpio_xec_port040_076_data, &gpio_xec_port040_076_config, &gpio_xec_port040_076_data, &gpio_xec_port040_076_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port040_076_init(const struct device *dev) static int gpio_xec_port040_076_init(const struct device *dev)
@ -447,7 +447,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_100_136),
gpio_xec_port100_136_init, gpio_xec_port100_136_init,
NULL, NULL,
&gpio_xec_port100_136_data, &gpio_xec_port100_136_config, &gpio_xec_port100_136_data, &gpio_xec_port100_136_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port100_136_init(const struct device *dev) static int gpio_xec_port100_136_init(const struct device *dev)
@ -493,7 +493,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_140_176),
gpio_xec_port140_176_init, gpio_xec_port140_176_init,
NULL, NULL,
&gpio_xec_port140_176_data, &gpio_xec_port140_176_config, &gpio_xec_port140_176_data, &gpio_xec_port140_176_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port140_176_init(const struct device *dev) static int gpio_xec_port140_176_init(const struct device *dev)
@ -539,7 +539,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_200_236),
gpio_xec_port200_236_init, gpio_xec_port200_236_init,
NULL, NULL,
&gpio_xec_port200_236_data, &gpio_xec_port200_236_config, &gpio_xec_port200_236_data, &gpio_xec_port200_236_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port200_236_init(const struct device *dev) static int gpio_xec_port200_236_init(const struct device *dev)
@ -585,7 +585,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(gpio_240_276),
gpio_xec_port240_276_init, gpio_xec_port240_276_init,
NULL, NULL,
&gpio_xec_port240_276_data, &gpio_xec_port240_276_config, &gpio_xec_port240_276_data, &gpio_xec_port240_276_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_xec_driver_api); &gpio_xec_driver_api);
static int gpio_xec_port240_276_init(const struct device *dev) static int gpio_xec_port240_276_init(const struct device *dev)

View file

@ -420,7 +420,7 @@ static const struct gpio_driver_api gpio_xec_driver_api = {
\ \
DEVICE_DT_INST_DEFINE(n, gpio_xec_port_init_##n, NULL, \ DEVICE_DT_INST_DEFINE(n, gpio_xec_port_init_##n, NULL, \
&gpio_xec_port_data_##n, &xec_gpio_config_##n, \ &gpio_xec_port_data_##n, &xec_gpio_config_##n, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_xec_driver_api); &gpio_xec_driver_api);
DT_INST_FOREACH_STATUS_OKAY(XEC_GPIO_PORT) DT_INST_FOREACH_STATUS_OKAY(XEC_GPIO_PORT)

View file

@ -304,7 +304,7 @@ static const struct gpio_driver_api gpio_mcux_driver_api = {
&gpio_mcux_port## n ##_data, \ &gpio_mcux_port## n ##_data, \
&gpio_mcux_port## n##_config, \ &gpio_mcux_port## n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_mcux_driver_api); \ &gpio_mcux_driver_api); \
\ \
static int gpio_mcux_port## n ##_init(const struct device *dev) \ static int gpio_mcux_port## n ##_init(const struct device *dev) \

View file

@ -229,7 +229,7 @@ static const struct gpio_driver_api mcux_igpio_driver_api = {
&mcux_igpio_##n##_data, \ &mcux_igpio_##n##_data, \
&mcux_igpio_##n##_config, \ &mcux_igpio_##n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&mcux_igpio_driver_api); \ &mcux_igpio_driver_api); \
\ \
static int mcux_igpio_##n##_init(const struct device *dev) \ static int mcux_igpio_##n##_init(const struct device *dev) \

View file

@ -395,7 +395,7 @@ static const clock_ip_name_t gpio_clock_names[] = GPIO_CLOCKS;
DEVICE_DT_INST_DEFINE(n, lpc_gpio_init_##n, NULL, \ DEVICE_DT_INST_DEFINE(n, lpc_gpio_init_##n, NULL, \
&gpio_mcux_lpc_data_##n, \ &gpio_mcux_lpc_data_##n, \
&gpio_mcux_lpc_config_##n, POST_KERNEL, \ &gpio_mcux_lpc_config_##n, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_mcux_lpc_driver_api); \ &gpio_mcux_lpc_driver_api); \
\ \
static int lpc_gpio_init_##n(const struct device *dev) \ static int lpc_gpio_init_##n(const struct device *dev) \

View file

@ -235,7 +235,7 @@ static const struct gpio_driver_api neorv32_gpio_driver_api = {
&neorv32_gpio_##n##_data, \ &neorv32_gpio_##n##_data, \
&neorv32_gpio_##n##_config, \ &neorv32_gpio_##n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&neorv32_gpio_driver_api); &neorv32_gpio_driver_api);
DT_INST_FOREACH_STATUS_OKAY(NEORV32_GPIO_INIT) DT_INST_FOREACH_STATUS_OKAY(NEORV32_GPIO_INIT)

View file

@ -336,7 +336,7 @@ int gpio_npcx_init(const struct device *dev)
&gpio_npcx_data_##inst, \ &gpio_npcx_data_##inst, \
&gpio_npcx_cfg_##inst, \ &gpio_npcx_cfg_##inst, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_npcx_driver); &gpio_npcx_driver);
DT_INST_FOREACH_STATUS_OKAY(NPCX_GPIO_DEVICE_INIT) DT_INST_FOREACH_STATUS_OKAY(NPCX_GPIO_DEVICE_INIT)

View file

@ -597,7 +597,7 @@ static int gpio_nrfx_init(const struct device *port)
&gpio_nrfx_p##id##_data, \ &gpio_nrfx_p##id##_data, \
&gpio_nrfx_p##id##_cfg, \ &gpio_nrfx_p##id##_cfg, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_GPIO_NRF_INIT_PRIORITY, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_nrfx_drv_api_funcs); &gpio_nrfx_drv_api_funcs);
DT_INST_FOREACH_STATUS_OKAY(GPIO_NRF_DEVICE) DT_INST_FOREACH_STATUS_OKAY(GPIO_NRF_DEVICE)

View file

@ -269,7 +269,7 @@ int gpio_psoc6_init(const struct device *dev)
DEVICE_DT_INST_DEFINE(n, gpio_psoc6_init, NULL, \ DEVICE_DT_INST_DEFINE(n, gpio_psoc6_init, NULL, \
&port_##n##_psoc6_runtime, \ &port_##n##_psoc6_runtime, \
&port_##n##_psoc6_config, POST_KERNEL, \ &port_##n##_psoc6_config, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_psoc6_api); \ &gpio_psoc6_api); \
\ \
static void port_##n##_psoc6_config_func(const struct device *dev) \ static void port_##n##_psoc6_config_func(const struct device *dev) \

View file

@ -310,7 +310,7 @@ static const struct gpio_driver_api gpio_rcar_driver_api = {
&gpio_rcar_data_##n, \ &gpio_rcar_data_##n, \
&gpio_rcar_cfg_##n, \ &gpio_rcar_cfg_##n, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_rcar_driver_api \ &gpio_rcar_driver_api \
); \ ); \
static void gpio_rcar_##n##_init(const struct device *dev) \ static void gpio_rcar_##n##_init(const struct device *dev) \

View file

@ -318,7 +318,7 @@ static const struct gpio_driver_api gpio_rv32m1_driver_api = {
&gpio_rv32m1_##n##_data, \ &gpio_rv32m1_##n##_data, \
&gpio_rv32m1_##n##_config, \ &gpio_rv32m1_##n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_rv32m1_driver_api); \ &gpio_rv32m1_driver_api); \
\ \
static int gpio_rv32m1_##n##_init(const struct device *dev) \ static int gpio_rv32m1_##n##_init(const struct device *dev) \

View file

@ -325,7 +325,7 @@ int gpio_sam_init(const struct device *dev)
DEVICE_DT_INST_DEFINE(n, gpio_sam_init, NULL, \ DEVICE_DT_INST_DEFINE(n, gpio_sam_init, NULL, \
&port_##n##_sam_runtime, \ &port_##n##_sam_runtime, \
&port_##n##_sam_config, POST_KERNEL, \ &port_##n##_sam_config, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_sam_api); \ &gpio_sam_api); \
\ \
static void port_##n##_sam_config_func(const struct device *dev) \ static void port_##n##_sam_config_func(const struct device *dev) \

View file

@ -306,7 +306,7 @@ static struct gpio_sam0_data gpio_sam0_data_0;
DEVICE_DT_DEFINE(DT_NODELABEL(porta), DEVICE_DT_DEFINE(DT_NODELABEL(porta),
gpio_sam0_init, NULL, gpio_sam0_init, NULL,
&gpio_sam0_data_0, &gpio_sam0_config_0, &gpio_sam0_data_0, &gpio_sam0_config_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_sam0_api); &gpio_sam0_api);
#endif #endif
@ -328,7 +328,7 @@ static struct gpio_sam0_data gpio_sam0_data_1;
DEVICE_DT_DEFINE(DT_NODELABEL(portb), DEVICE_DT_DEFINE(DT_NODELABEL(portb),
gpio_sam0_init, NULL, gpio_sam0_init, NULL,
&gpio_sam0_data_1, &gpio_sam0_config_1, &gpio_sam0_data_1, &gpio_sam0_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_sam0_api); &gpio_sam0_api);
#endif #endif
@ -350,7 +350,7 @@ static struct gpio_sam0_data gpio_sam0_data_2;
DEVICE_DT_DEFINE(DT_NODELABEL(portc), DEVICE_DT_DEFINE(DT_NODELABEL(portc),
gpio_sam0_init, NULL, gpio_sam0_init, NULL,
&gpio_sam0_data_2, &gpio_sam0_config_2, &gpio_sam0_data_2, &gpio_sam0_config_2,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_sam0_api); &gpio_sam0_api);
#endif #endif
@ -372,6 +372,6 @@ static struct gpio_sam0_data gpio_sam0_data_3;
DEVICE_DT_DEFINE(DT_NODELABEL(portd), DEVICE_DT_DEFINE(DT_NODELABEL(portd),
gpio_sam0_init, NULL, gpio_sam0_init, NULL,
&gpio_sam0_data_3, &gpio_sam0_config_3, &gpio_sam0_data_3, &gpio_sam0_config_3,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_sam0_api); &gpio_sam0_api);
#endif #endif

View file

@ -267,7 +267,7 @@ int gpio_sam_init(const struct device *dev)
DEVICE_DT_INST_DEFINE(n, gpio_sam_init, NULL, \ DEVICE_DT_INST_DEFINE(n, gpio_sam_init, NULL, \
&port_##n##_sam_runtime, \ &port_##n##_sam_runtime, \
&port_##n##_sam_config, POST_KERNEL, \ &port_##n##_sam_config, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_sam_api); \ &gpio_sam_api); \
\ \
static void port_##n##_sam_config_func(const struct device *dev)\ static void port_##n##_sam_config_func(const struct device *dev)\

View file

@ -361,7 +361,7 @@ DEVICE_DT_INST_DEFINE(0,
gpio_sifive_init, gpio_sifive_init,
NULL, NULL,
&gpio_sifive_data0, &gpio_sifive_config0, &gpio_sifive_data0, &gpio_sifive_config0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&gpio_sifive_driver); &gpio_sifive_driver);
#define IRQ_INIT(n) \ #define IRQ_INIT(n) \

View file

@ -255,7 +255,7 @@ static const struct gpio_driver_api gpio_stellaris_driver_api = {
NULL, \ NULL, \
&port_## n ##_stellaris_runtime, \ &port_## n ##_stellaris_runtime, \
&gpio_stellaris_port_## n ##_config, \ &gpio_stellaris_port_## n ##_config, \
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY, \
&gpio_stellaris_driver_api); \ &gpio_stellaris_driver_api); \
\ \
static void port_## n ##_stellaris_config_func(const struct device *dev) \ static void port_## n ##_stellaris_config_func(const struct device *dev) \

View file

@ -636,7 +636,7 @@ static int gpio_stm32_init(const struct device *dev)
&gpio_stm32_data_## __suffix, \ &gpio_stm32_data_## __suffix, \
&gpio_stm32_cfg_## __suffix, \ &gpio_stm32_cfg_## __suffix, \
PRE_KERNEL_1, \ PRE_KERNEL_1, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_stm32_driver) &gpio_stm32_driver)
#define GPIO_DEVICE_INIT_STM32(__suffix, __SUFFIX) \ #define GPIO_DEVICE_INIT_STM32(__suffix, __SUFFIX) \

View file

@ -786,5 +786,5 @@ static struct sx1509b_drv_data sx1509b_drvdata = {
DEVICE_DT_INST_DEFINE(0, sx1509b_init, NULL, DEVICE_DT_INST_DEFINE(0, sx1509b_init, NULL,
&sx1509b_drvdata, &sx1509b_cfg, &sx1509b_drvdata, &sx1509b_cfg,
POST_KERNEL, CONFIG_GPIO_SX1509B_INIT_PRIORITY, POST_KERNEL, CONFIG_GPIO_INIT_PRIORITY,
&api_table); &api_table);

View file

@ -287,7 +287,7 @@ static const struct gpio_driver_api gpio_xlnx_axi_driver_api = {
&gpio_xlnx_axi_##n##_2_data, \ &gpio_xlnx_axi_##n##_2_data, \
&gpio_xlnx_axi_##n##_2_config, \ &gpio_xlnx_axi_##n##_2_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_xlnx_axi_driver_api); &gpio_xlnx_axi_driver_api);
#define GPIO_XLNX_AXI_INIT(n) \ #define GPIO_XLNX_AXI_INIT(n) \
@ -315,7 +315,7 @@ static const struct gpio_driver_api gpio_xlnx_axi_driver_api = {
&gpio_xlnx_axi_##n##_data, \ &gpio_xlnx_axi_##n##_data, \
&gpio_xlnx_axi_##n##_config, \ &gpio_xlnx_axi_##n##_config, \
POST_KERNEL, \ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ CONFIG_GPIO_INIT_PRIORITY, \
&gpio_xlnx_axi_driver_api); \ &gpio_xlnx_axi_driver_api); \
GPIO_XLNX_AXI_GPIO2_COND_INIT(n); GPIO_XLNX_AXI_GPIO2_COND_INIT(n);