summaryrefslogtreecommitdiff
path: root/common/i2c_controller.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/i2c_controller.c')
-rw-r--r--common/i2c_controller.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/i2c_controller.c b/common/i2c_controller.c
index 2b5dbd99fd..5b04e079fb 100644
--- a/common/i2c_controller.c
+++ b/common/i2c_controller.c
@@ -1218,7 +1218,8 @@ static enum ec_status i2c_command_passthru(struct host_cmd_handler_args *args)
if (resp->num_msgs == params->num_msgs - 1)
xferflags |= I2C_XFER_STOP;
-#if defined(VIRTUAL_BATTERY_ADDR_FLAGS) && defined(I2C_PORT_VIRTUAL_BATTERY)
+#if defined(VIRTUAL_BATTERY_ADDR_FLAGS) && \
+ (defined(CONFIG_ZEPHYR) || defined(I2C_PORT_VIRTUAL_BATTERY))
if (params->port == I2C_PORT_VIRTUAL_BATTERY &&
addr_flags == VIRTUAL_BATTERY_ADDR_FLAGS) {
if (virtual_battery_handler(resp, in_len, &rv,