U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] board: nxp: common: support CONFIG_FSL_USE_PCA9547_MUX
@ 2026-05-10 22:07 Vincent Jardin
  2026-05-13  9:59 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Jardin @ 2026-05-10 22:07 UTC (permalink / raw)
  To: u-boot
  Cc: Vincent Jardin, Alice Guo, Fabio Estevam, Meenakshi Aggarwal,
	NXP i.MX U-Boot Team, Stefano Babic, Tom Rini, Wasim Khan

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>

---

 board/nxp/common/i2c_mux.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/board/nxp/common/i2c_mux.h b/board/nxp/common/i2c_mux.h
index 0870c1918e6..ef7ce8e2e51 100644
--- a/board/nxp/common/i2c_mux.h
+++ b/board/nxp/common/i2c_mux.h
@@ -10,6 +10,11 @@
 
 #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
-- 
2.43.0

base-commit: bfe90a308a94caa9d855440683521ff04122ae2a
branch: for-upstream/nxp-common-pca9547-stub

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

* Re: [PATCH v1] board: nxp: common: support CONFIG_FSL_USE_PCA9547_MUX
  2026-05-10 22:07 [PATCH v1] board: nxp: common: support CONFIG_FSL_USE_PCA9547_MUX Vincent Jardin
@ 2026-05-13  9:59 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2026-05-13  9:59 UTC (permalink / raw)
  To: Vincent Jardin
  Cc: u-boot, Alice Guo, Fabio Estevam, Meenakshi Aggarwal,
	NXP i.MX U-Boot Team, Stefano Babic, Tom Rini, Wasim Khan

On Mon, May 11, 2026 at 12:07:30AM +0200, Vincent Jardin wrote:
>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>

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

end of thread, other threads:[~2026-05-13  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 22:07 [PATCH v1] board: nxp: common: support CONFIG_FSL_USE_PCA9547_MUX Vincent Jardin
2026-05-13  9:59 ` Peng Fan

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