Merge tag 'u-boot-rockchip-20200531' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / drivers / i2c / i2c-uniphier-f.c
index ced606bf36fd179bd6f1352b3bf2fea0855a909f..d8b4a683bcedebb945d95e4e87a119d3ebabaa35 100644 (file)
@@ -5,6 +5,7 @@
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
+#include <dm/device_compat.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
@@ -281,7 +282,7 @@ static int uniphier_fi2c_set_bus_speed(struct udevice *bus, unsigned int speed)
        struct uniphier_fi2c_regs __iomem *regs = priv->regs;
 
        /* max supported frequency is 400 kHz */
-       if (speed > 400000)
+       if (speed > I2C_SPEED_FAST_RATE)
                return -EINVAL;
 
        ret = uniphier_fi2c_check_bus_busy(priv);