]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: ast_i2c: Update to use standard enums for speed
authorSimon Glass <sjg@chromium.org>
Thu, 23 Jan 2020 18:48:17 +0000 (11:48 -0700)
committerHeiko Schocher <hs@denx.de>
Mon, 27 Jan 2020 06:22:41 +0000 (07:22 +0100)
Update this driver to use the new standard enums for speed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/i2c/ast_i2c.c
drivers/i2c/ast_i2c.h

index 763183d64920353fbbdf6d86e968a95065418971..35dc234160d9acd2bcd61667894357633582f05d 100644 (file)
@@ -314,7 +314,7 @@ static int ast_i2c_set_speed(struct udevice *dev, unsigned int speed)
        divider = i2c_rate / speed;
 
        priv->speed = speed;
-       if (speed > I2C_HIGHSPEED_RATE) {
+       if (speed > I2C_SPEED_FAST_RATE) {
                debug("Enable High Speed\n");
                setbits_le32(&regs->fcr, I2CD_M_HIGH_SPEED_EN
                             | I2CD_M_SDA_DRIVE_1T_EN
index 401e0970f768c16b15ece2726bcb837b1fc8ce85..928785989e78a6e6fe83401258d07e69553e00b5 100644 (file)
@@ -126,6 +126,4 @@ struct ast_i2c_regs {
 #define I2CD_RX_DATA_SHIFT                     8
 #define I2CD_RX_DATA_MASK                      (0xff << I2CD_RX_DATA_SHIFT)
 
-#define I2C_HIGHSPEED_RATE    400000
-
 #endif                         /* __AST_I2C_H_ */