drivers: fpga: add an init priority config option

Add a Kconfig option for FPGA device initialization priority.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-08-22 15:58:20 +00:00 committed by Carles Cufí
commit f45e7eddaa
4 changed files with 10 additions and 3 deletions

View file

@ -14,6 +14,12 @@ module = fpga
module-str = fpga
source "subsys/logging/Kconfig.template.log_config"
config FPGA_INIT_PRIORITY
int "Init priority"
default 75
help
FPGA device drivers initialization priority
config FPGA_SHELL
bool "FPGA Shell"
depends on SHELL && FPGA

View file

@ -149,4 +149,4 @@ static const struct fpga_driver_api eos_s3_api = {
};
DEVICE_DT_DEFINE(DT_NODELABEL(fpga0), &eos_s3_fpga_init, NULL, &fpga_data, NULL, APPLICATION,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &eos_s3_api);
CONFIG_FPGA_INIT_PRIORITY, &eos_s3_api);

View file

@ -596,6 +596,7 @@ static int fpga_ice40_init(const struct device *dev)
FPGA_ICE40_PINCTRL_CONFIG(inst)}; \
\
DEVICE_DT_INST_DEFINE(inst, fpga_ice40_init, NULL, &fpga_ice40_data_##inst, \
&fpga_ice40_config_##inst, POST_KERNEL, 0, &fpga_ice40_api);
&fpga_ice40_config_##inst, POST_KERNEL, CONFIG_FPGA_INIT_PRIORITY, \
&fpga_ice40_api);
DT_INST_FOREACH_STATUS_OKAY(FPGA_ICE40_DEFINE)

View file

@ -323,4 +323,4 @@ static const struct fpga_driver_api zynqmp_api = {
};
DEVICE_DT_INST_DEFINE(0, &zynqmp_fpga_init, NULL, &fpga_data, NULL,
APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &zynqmp_api);
APPLICATION, CONFIG_FPGA_INIT_PRIORITY, &zynqmp_api);