drivers: dac: mcp4728: 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 <b.bilas@grinn-global.com>
This commit is contained in:
parent
5cf7adeb5b
commit
9da5538f92
|
@ -7,3 +7,13 @@ config DAC_MCP4728
|
|||
depends on I2C
|
||||
help
|
||||
Enable driver for the Microchip MCP4728.
|
||||
|
||||
if DAC_MCP4728
|
||||
|
||||
config DAC_MCP4728_INIT_PRIORITY
|
||||
int "Init priority"
|
||||
default 80
|
||||
help
|
||||
Microchip MCP4728 device driver initialization priority.
|
||||
|
||||
endif # DAC_MCP4728
|
||||
|
|
|
@ -104,7 +104,7 @@ static const struct dac_driver_api mcp4728_driver_api = {
|
|||
DEVICE_DT_INST_DEFINE(index, dac_mcp4728_init, NULL, NULL, \
|
||||
&mcp4728_config_##index, \
|
||||
POST_KERNEL, \
|
||||
CONFIG_DAC_INIT_PRIORITY, \
|
||||
CONFIG_DAC_MCP4728_INIT_PRIORITY, \
|
||||
&mcp4728_driver_api);
|
||||
|
||||
DT_INST_FOREACH_STATUS_OKAY(INST_DT_MCP4728);
|
||||
|
|
Loading…
Reference in a new issue