[U-Boot] [RFC 5/9] pico-pi-imx7d: defconfig: Switch to DM for I2C

Joris Offouga offougajoris at gmail.com
Sun Jan 20 21:18:54 UTC 2019


This commit switches to DM I2C for pico-pi-imx7d.

Signed-off-by: Joris Offouga <offougajoris at gmail.com>
---
 board/technexion/pico-imx7d/pico-imx7d.c | 24 ------------------------
 configs/pico-pi-imx7d_defconfig          |  1 +
 include/configs/pico-imx7d.h             |  5 -----
 3 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c
index 48e90b0..cd7d5b1 100644
--- a/board/technexion/pico-imx7d/pico-imx7d.c
+++ b/board/technexion/pico-imx7d/pico-imx7d.c
@@ -33,26 +33,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define ENET_RX_PAD_CTRL  (PAD_CTL_PUS_PU100KOHM | PAD_CTL_DSE_3P3V_49OHM)
 
-#define I2C_PAD_CTRL    (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
-	PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
-
-#ifdef CONFIG_SYS_I2C_MXC
-#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
-/* I2C4 for PMIC */
-static struct i2c_pads_info i2c_pad_info4 = {
-	.scl = {
-		.i2c_mode = MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL | PC,
-		.gpio_mode = MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16 | PC,
-		.gp = IMX_GPIO_NR(6, 16),
-	},
-	.sda = {
-		.i2c_mode = MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA | PC,
-		.gpio_mode = MX7D_PAD_SAI1_RX_BCLK__GPIO6_IO17 | PC,
-		.gp = IMX_GPIO_NR(6, 17),
-	},
-};
-#endif
-
 int dram_init(void)
 {
 	gd->ram_size = imx_ddr_size();
@@ -203,10 +183,6 @@ int board_early_init_f(void)
 {
 	setup_iomux_uart();
 
-#ifdef CONFIG_SYS_I2C_MXC
-	setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info4);
-#endif
-
 	return 0;
 }
 
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index 0d1c56b..dd8af7f 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -27,6 +27,7 @@ CONFIG_DM_MMC=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_IMI is not set
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 1884c58..82c105b 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -117,12 +117,7 @@
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* I2C configs */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1
-#define CONFIG_SYS_I2C_MXC_I2C2
-#define CONFIG_SYS_I2C_MXC_I2C3
-#define CONFIG_SYS_I2C_MXC_I2C4
 #define CONFIG_SYS_I2C_SPEED		100000
 
 /* PMIC */
-- 
2.7.4



More information about the U-Boot mailing list