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

Joel Stanley joel at jms.id.au
Mon Jul 18 18:55:23 AEST 2022


Don't attempt to switch to the AST2600 "new" register mode if the driver
is not compiled in.

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

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 +
-- 
2.35.1



More information about the openbmc mailing list