U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cmd: kconfig: i2c: add missing I2C API dependency
@ 2026-07-02 15:26 Julien Stephan
  2026-07-02 16:33 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Stephan @ 2026-07-02 15:26 UTC (permalink / raw)
  To: u-boot
  Cc: GSS_MTK_Uboot_upstream, Tom Rini, Jerome Forissier,
	Kory Maincent (TI.com), Simon Glass, Quentin Schulz,
	Peter Robinson, Mikhail Kshevetskiy, Heiko Schocher,
	Andrew Goodbody, Julien Stephan

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@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@lists.denx.de
Cc: GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jerome Forissier <jerome.forissier@arm.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: "Kory Maincent (TI.com)" <kory.maincent@bootlin.com>
Cc: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Cc: Heiko Schocher <hs@nabladev.com>
Cc: Andrew Goodbody <andrew.goodbody@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@baylibre.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-02 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 15:26 [PATCH v2] cmd: kconfig: i2c: add missing I2C API dependency Julien Stephan
2026-07-02 16:33 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox