[PATCH v2] cmd: kconfig: i2c: add missing I2C API dependency

Julien Stephan jstephan at baylibre.com
Thu Jul 2 17:26:57 CEST 2026


CMD_I2C relies on either the Driver Model I2C API or the legacy I2C
API, but its Kconfig currently does not enforce either dependency.

As a result, enabling CMD_I2C without DM_I2C or SYS_I2C_LEGACY can lead
to link errors due to unresolved i2c_* symbols.

Require either DM_I2C or SYS_I2C_LEGACY to prevent unsupported
configurations while preserving support for legacy platforms.

Signed-off-by: Julien Stephan <jstephan at baylibre.com>
---
CMD_I2C relies on either the Driver Model I2C API or the legacy I2C
API, but its Kconfig currently does not enforce either dependency.

In order to not break some legacy I2C board, we need to keep
SYS_I2C_LEGACY in the depends on logic

$ ./tools/qconfig.py -f CMD_I2C ~DM_I2C
15 matches
MPC837XERDB cl-som-imx7 d2net_v2 db-88f6720 db-88f6820-gp inetspace_v2 ls2080aqds_nand ls2080aqds_qspi ls2080ardb_nand net2big_v2 netspace_lite_v2 netspace_max_v2 netspace_mini_v2 netspace_v2 work_92105
---
Changes in v2:
- Add SYS_I2C_LEGACY in the depends on logic
- Link to v1: https://patch.msgid.link/20260701-cmd-i2-add-dm-i2c-dependency-v1-1-19ebda3a80f8@baylibre.com

To: u-boot at lists.denx.de
Cc: GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream at mediatek.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: Jerome Forissier <jerome.forissier at arm.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: "Kory Maincent (TI.com)" <kory.maincent at bootlin.com>
Cc: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
Cc: Quentin Schulz <quentin.schulz at cherry.de>
Cc: Heiko Schocher <hs at nabladev.com>
Cc: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 cmd/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 032e55e8127..8303884084f 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1392,6 +1392,7 @@ config CMD_IOTRACE
 
 config CMD_I2C
 	bool "i2c"
+	depends on DM_I2C || SYS_I2C_LEGACY
 	help
 	  I2C support.
 

---
base-commit: 1a3a5c30a253031257b4738e7b1dba635d93b241
change-id: 20260701-cmd-i2-add-dm-i2c-dependency-d8b349b9f0b2

Best regards,
--  
Julien Stephan <jstephan at baylibre.com>



More information about the U-Boot mailing list