diff mbox series

[u-boot,v2019.04-aspeed-openbmc,2/2] i2c/aspeed: Use new mode only when driver is enabled

Message ID 20220718085523.1140566-3-joel@jms.id.au
State New
Headers show
Series I2C Fixes | expand

Commit Message

Joel Stanley July 18, 2022, 8:55 a.m. UTC
Don't attempt to switch to the AST2600 "new" register mode if the driver
is not compiled in.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/i2c/aspeed_i2c_global.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/i2c/aspeed_i2c_global.c b/drivers/i2c/aspeed_i2c_global.c
index c76c29821083..86ed8f746d56 100644
--- a/drivers/i2c/aspeed_i2c_global.c
+++ b/drivers/i2c/aspeed_i2c_global.c
@@ -60,7 +60,8 @@  static int aspeed_i2c_global_probe(struct udevice *dev)
 
 	reset_deassert(&i2c_global->reset);
 
-	if (i2c_global->version == AST2600_I2C_GLOBAL) {
+	if (IS_ENABLED(SYS_I2C_AST2600) &&
+	    i2c_global->version == AST2600_I2C_GLOBAL) {
 		writel(AST2600_GLOBAL_INIT, i2c_global->regs +
 			AST2600_I2CG_CTRL);
 		writel(I2CCG_DIV_CTRL, i2c_global->regs +