diff mbox series

[v2,14/19] i2c: ast_i2c: Update to use standard enums for speed

Message ID 20200103152643.v2.14.I11ecfba19a6dd28e3ef56df374db8c3c104cbe3d@changeid
State Superseded
Headers show
Series i2c: designware_ic2: Improvements to timing and general cleanup | expand

Commit Message

Simon Glass Jan. 3, 2020, 10:26 p.m. UTC
Update this driver to use the new standard enums for speed.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2: None

 drivers/i2c/ast_i2c.c | 2 +-
 drivers/i2c/ast_i2c.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Heiko Schocher Jan. 16, 2020, 7:02 a.m. UTC | #1
Hello Simon,

Am 03.01.2020 um 23:26 schrieb Simon Glass:
> Update this driver to use the new standard enums for speed.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> Changes in v2: None
> 
>   drivers/i2c/ast_i2c.c | 2 +-
>   drivers/i2c/ast_i2c.h | 2 --
>   2 files changed, 1 insertion(+), 3 deletions(-)

Thanks for cleaning this up!

Reviewed-by: Heiko Schocher <hs at denx.de>

bye,
Heiko
diff mbox series

Patch

diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c
index 763183d649..35dc234160 100644
--- a/drivers/i2c/ast_i2c.c
+++ b/drivers/i2c/ast_i2c.c
@@ -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
diff --git a/drivers/i2c/ast_i2c.h b/drivers/i2c/ast_i2c.h
index 401e0970f7..928785989e 100644
--- a/drivers/i2c/ast_i2c.h
+++ b/drivers/i2c/ast_i2c.h
@@ -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_ */