zephyr/drivers/i2c/Kconfig.npcx
Fabio Baltieri c56a3615ee driver: npcx: i2c: set a dedicated priority for the port driver
The NPCX I2C controller has a port-controller hierarchy and the driver
is split in two files, with separate device struct and init functions.

These are currently initialized at the same level and priority, so the
actual order depends on what the linker does.

To avoid relying on the linking order, add a dedicated priority option
for the port that is set to go after the normal I2C one by default.

Found this by building with CONFIG_CHECK_INIT_PRIORITIES.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-26 14:08:12 -04:00

22 lines
650 B
Plaintext

# NPCX I2C driver configuration options
# Copyright (c) 2020 Nuvoton Technology Corporation.
# SPDX-License-Identifier: Apache-2.0
config I2C_NPCX
bool "Nuvoton NPCX embedded controller (EC) I2C driver"
default y
depends on DT_HAS_NUVOTON_NPCX_I2C_PORT_ENABLED
help
This option enables the I2C driver for NPCX family of
processors.
Say y if you wish to use I2C modules on NPCX MCU.
config I2C_NPCX_PORT_INIT_PRIORITY
int "NPCX I2C port init priority"
default 51
depends on I2C_NPCX
help
Initialization priority for the I2C port on an NPCX device, must be
set to a lower priority than the controller one (I2C_INIT_PRIORITY).