From 5cf7adeb5b35826042221fa98c948eb68801a404 Mon Sep 17 00:00:00 2001 From: Bartosz Bilas Date: Tue, 12 Jul 2022 16:47:31 +0200 Subject: [PATCH] drivers: dac: mcp4725: set explicitly init priority Since this DAC is connected via I2C bus the init priority value must be higher than the default 50 so it can be initialized later than the bus itself so add a dedicated init config symbol for that. Signed-off-by: Bartosz Bilas --- drivers/dac/Kconfig.mcp4725 | 10 ++++++++++ drivers/dac/dac_mcp4725.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/dac/Kconfig.mcp4725 b/drivers/dac/Kconfig.mcp4725 index 532040740a1..87bfdab0507 100644 --- a/drivers/dac/Kconfig.mcp4725 +++ b/drivers/dac/Kconfig.mcp4725 @@ -9,3 +9,13 @@ config DAC_MCP4725 depends on I2C help Enable the driver for the Microchip MCP4725. + +if DAC_MCP4725 + +config DAC_MCP4725_INIT_PRIORITY + int "Init priority" + default 80 + help + Microchip MCP4725 DAC device driver initialization priority. + +endif # DAC_MCP4725 diff --git a/drivers/dac/dac_mcp4725.c b/drivers/dac/dac_mcp4725.c index 90a192e7caf..1ff4844b597 100644 --- a/drivers/dac/dac_mcp4725.c +++ b/drivers/dac/dac_mcp4725.c @@ -142,7 +142,7 @@ static const struct dac_driver_api mcp4725_driver_api = { NULL, \ NULL, \ &mcp4725_config_##index, POST_KERNEL, \ - CONFIG_DAC_INIT_PRIORITY, \ + CONFIG_DAC_MCP4725_INIT_PRIORITY, \ &mcp4725_driver_api); DT_INST_FOREACH_STATUS_OKAY(INST_DT_MCP4725);