ti: remove usage of DM_I2C_COMPAT and don't disable DM_I2C in SPL
[oweals/u-boot.git] / board / ti / am335x / board.c
index 13845251afb5ad93e7366895934308ad504e6a28..d67f94ad47baec593946f51f4beffe9384915af8 100644 (file)
@@ -70,8 +70,9 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 void do_board_detect(void)
 {
        enable_i2c0_pin_mux();
+#ifndef CONFIG_DM_I2C
        i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-
+#endif
        if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
                                 CONFIG_EEPROM_CHIP_ADDRESS))
                printf("ti_i2c_eeprom_init failed\n");
@@ -328,8 +329,14 @@ static void scale_vcores_bone(int freq)
        if (board_is_bone() && !strncmp(board_ti_get_rev(), "00A1", 4))
                return;
 
+#ifndef CONFIG_DM_I2C
        if (i2c_probe(TPS65217_CHIP_PM))
                return;
+#else
+       if (power_tps65217_init(0))
+               return;
+#endif
+
 
        /*
         * On Beaglebone White we need to ensure we have AC power
@@ -421,9 +428,13 @@ void scale_vcores_generic(int freq)
         * 1.10V.  For MPU voltage we need to switch based on
         * the frequency we are running at.
         */
+#ifndef CONFIG_DM_I2C
        if (i2c_probe(TPS65910_CTRL_I2C_ADDR))
                return;
-
+#else
+       if (power_tps65910_init(0))
+               return;
+#endif
        /*
         * Depending on MPU clock and PG we will need a different
         * VDD to drive at that speed.
@@ -451,8 +462,10 @@ void gpi2c_init(void)
 
        if (first_time) {
                enable_i2c0_pin_mux();
+#ifndef CONFIG_DM_I2C
                i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED,
                         CONFIG_SYS_OMAP24_I2C_SLAVE);
+#endif
                first_time = false;
        }
 }