]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: freescale: ls1021aqds: Update I2C mux config
authorStephen Carlson <stcarlso@linux.microsoft.com>
Tue, 22 Jun 2021 23:38:21 +0000 (16:38 -0700)
committerPriyanka Jain <priyanka.jain@nxp.com>
Tue, 20 Jul 2021 08:48:04 +0000 (14:18 +0530)
Updates the board configuration to enable use of the PCA9547 I2C mux.

Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
board/freescale/ls1021aqds/dcu.c
board/freescale/ls1021aqds/ls1021aqds.c
configs/ls1021aqds_ddr4_nor_defconfig
configs/ls1021aqds_ddr4_nor_lpuart_defconfig
configs/ls1021aqds_nand_defconfig
configs/ls1021aqds_nor_SECURE_BOOT_defconfig
configs/ls1021aqds_nor_defconfig
configs/ls1021aqds_nor_lpuart_defconfig
configs/ls1021aqds_qspi_defconfig
configs/ls1021aqds_sdcard_ifc_defconfig
configs/ls1021aqds_sdcard_qspi_defconfig

index 7532f7c0b2007b3f2d095be9dcf0dd19506c591d..b5fee06b5b01e3ea1ce80e83db948fbcb6eb0f29 100644 (file)
 #include <common.h>
 #include <fsl_dcu_fb.h>
 #include <i2c.h>
+#include "../common/i2c_mux.h"
 #include "div64.h"
 #include "../common/diu_ch7301.h"
 #include "ls1021aqds_qixis.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int select_i2c_ch_pca9547(u8 ch, int bus_num)
-{
-       int ret;
-#if CONFIG_IS_ENABLED(DM_I2C)
-       struct udevice *dev;
-
-       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
-                                     1, &dev);
-       if (ret) {
-               printf("%s: Cannot find udev for a bus %d\n", __func__,
-                      bus_num);
-               return ret;
-       }
-       ret = dm_i2c_write(dev, 0, &ch, 1);
-#else
-       ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
-#endif
-       if (ret) {
-               puts("PCA: failed to select proper channel\n");
-               return ret;
-       }
-
-       return 0;
-}
-
 unsigned int dcu_set_pixel_clock(unsigned int pixclock)
 {
        unsigned long long div;
index aa1f6025c1342d10cecaa407dbc03b07442ae18a..fcbde2ceb798ac5cd3ff22294efde1334435481c 100644 (file)
@@ -25,6 +25,7 @@
 #include <fsl_devdis.h>
 #include <fsl_validate.h>
 #include <fsl_ddr.h>
+#include "../common/i2c_mux.h"
 #include "../common/sleep.h"
 #include "../common/qixis.h"
 #include "ls1021aqds_qixis.h"
@@ -141,31 +142,6 @@ unsigned long get_board_ddr_clk(void)
        return 66666666;
 }
 
-int select_i2c_ch_pca9547(u8 ch, int bus_num)
-{
-       int ret;
-#if CONFIG_IS_ENABLED(DM_I2C)
-       struct udevice *dev;
-
-       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
-                                     1, &dev);
-       if (ret) {
-               printf("%s: Cannot find udev for a bus %d\n", __func__,
-                      bus_num);
-               return ret;
-       }
-       ret = dm_i2c_write(dev, 0, &ch, 1);
-#else
-       ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
-#endif
-       if (ret) {
-               puts("PCA: failed to select proper channel\n");
-               return ret;
-       }
-
-       return 0;
-}
-
 int dram_init(void)
 {
        /*
index a02a9fd955cce012ec5e8f01c04386e475e53bfe..04ad86673144f3a913257b34e8db06b9e5b369bf 100644 (file)
@@ -69,3 +69,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index d42e3517549bf84e075b96b3d8effa637664c22b..700768294d6c683ece91773e8c6d4b2318fd4ce7 100644 (file)
@@ -69,3 +69,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 1aac0bf408497742f977b576b88eeb3b047f512f..f969fdc4e0803c1852e2152385e6ad5bd24b0157 100644 (file)
@@ -84,3 +84,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index d3b68b9f950c028cf0385454bcb410a74eb4d4e4..43e77c95bc76ea683d33cf8ac782505ae27b90de 100644 (file)
@@ -68,3 +68,4 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index a67d0404432055b0678f092620f3714a4368a429..26d2e5e5673731f2354caba14436c1c562cd2f26 100644 (file)
@@ -70,3 +70,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 46625f14309309d6d333c075d80248005ac39035..f2d81ce0e172f2a3ed1b64b168f013b1465f7c58 100644 (file)
@@ -70,3 +70,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 17a7a60b238e9ff377210caf564cc1df9e497740..1f6f819d91ea50146053d175e1da323b52eb5b15 100644 (file)
@@ -69,3 +69,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 148d67b8b7e9785366dfb1c2f9de234838b14476..aa75d1404359681448e00fcd59e8fa3965f5b123 100644 (file)
@@ -83,3 +83,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y
index 207307f206853ede7680615035c4b0bce607a3c7..2427760dc61fd45586e871c1eabf57a0b3f9851e 100644 (file)
@@ -81,3 +81,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_STORAGE=y
+CONFIG_FSL_USE_PCA9547_MUX=y