Merge branch '2020-06-03-misc-bugfixes'
[oweals/u-boot.git] / drivers / i2c / fsl_i2c.c
index bf8d52d5ad5ffb2c48debe4c72948e1f1b7a05d1..da933452f5156c16b2195dff904cc0cd78ae28aa 100644 (file)
@@ -9,11 +9,14 @@
 #include <common.h>
 #include <command.h>
 #include <i2c.h>               /* Functional interface */
+#include <log.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/fsl_i2c.h>       /* HW definitions */
 #include <clk.h>
 #include <dm.h>
 #include <mapmem.h>
+#include <linux/delay.h>
 
 /* The maximum number of microseconds we will wait until another master has
  * released the bus.  If not defined in the board header file, then use a
@@ -583,7 +586,8 @@ static int fsl_i2c_ofdata_to_platdata(struct udevice *bus)
        dev->index = dev_read_u32_default(bus, "cell-index", -1);
        dev->slaveadd = dev_read_u32_default(bus, "u-boot,i2c-slave-addr",
                                             0x7f);
-       dev->speed = dev_read_u32_default(bus, "clock-frequency", 400000);
+       dev->speed = dev_read_u32_default(bus, "clock-frequency",
+                                         I2C_SPEED_FAST_RATE);
 
        if (!clk_get_by_index(bus, 0, &clock))
                dev->i2c_clk = clk_get_rate(&clock);