board: freescale: Refactor NXP common mux code
Refactors similar mux code from multiple NXP boards into a common location,
and allows it to be disabled in config.
New config: CONFIG_FSL_USE_PCA9547_MUX to enable PCA9547 mux functionality.
Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 7862a79..116c1e7 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -15,6 +15,15 @@
# necessary to create built-in.o
obj- := __dummy__.o
else
+# include i2c_common.o once if either VID or FSL_USE_PCA9547_MUX
+I2C_COMMON=
+ifdef CONFIG_VID
+I2C_COMMON=y
+endif
+ifdef CONFIG_FSL_USE_PCA9547_MUX
+I2C_COMMON=y
+endif
+
obj-$(CONFIG_FSL_CADMUS) += cadmus.o
obj-$(CONFIG_FSL_VIA) += cds_via.o
obj-$(CONFIG_FMAN_ENET) += fman.o
@@ -22,6 +31,8 @@
ifndef CONFIG_SPL_BUILD
obj-$(CONFIG_FSL_NGPIXIS) += ngpixis.o
endif
+obj-$(I2C_COMMON) += i2c_common.o
+obj-$(CONFIG_FSL_USE_PCA9547_MUX) += i2c_mux.o
obj-$(CONFIG_VID) += vid.o
obj-$(CONFIG_FSL_QIXIS) += qixis.o
obj-$(CONFIG_PQ_MDS_PIB) += pq-mds-pib.o