]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: nxp: common: support CONFIG_FSL_USE_PCA9547_MUX
authorVincent Jardin <vjardin@free.fr>
Sun, 10 May 2026 22:07:30 +0000 (00:07 +0200)
committerPeng Fan <peng.fan@nxp.com>
Fri, 15 May 2026 11:28:31 +0000 (19:28 +0800)
Use select_i2c_ch_pca9547() only when CONFIG_FSL_USE_PCA9547_MUX
is set, but several call in board/nxp/lx2160a/lx2160a.c invoke
it unconditionally,
or using unrelated Kconfigs (CONFIG_EMC2305, CONFIG_VID).

Compilation with LX2160A target that omits the mux therefore fails with

  error: implicit declaration of function 'select_i2c_ch_pca9547'

Add a static inline stub with -EOPNOTSUPP for the
!CONFIG_FSL_USE_PCA9547_MUX case so all cases compile cleanly.

Adapted from the convention used by include/scmi_nxp_protocols.h for
SCMI subprotocol stubs.

There is no functional change for NXP boards: all eight upstream
LX2160A defconfigs (lx2160ardb / lx2160aqds / lx2162aqds and their
secure / stmm / verified_boot variants) already set
CONFIG_FSL_USE_PCA9547_MUX=y, so the real declaration wins.

The purpose is to support new boards that do not use the PCA9547.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
board/nxp/common/i2c_mux.h

index 0870c1918e6e2f2818e3bbed214123bcd5ac1624..ef7ce8e2e51e9ba562294cc2a4cf267ff7b2ce79 100644 (file)
 
 #ifdef CONFIG_FSL_USE_PCA9547_MUX
 int select_i2c_ch_pca9547(u8 ch, int bus);
+#else
+static inline int select_i2c_ch_pca9547(u8 ch, int bus)
+{
+       return -EOPNOTSUPP;
+}
 #endif
 
 #endif