diff --git a/common/i2c.c b/common/i2c.c index a17edc51d4..c3c8d50a9c 100644 --- a/common/i2c.c +++ b/common/i2c.c @@ -56,15 +56,18 @@ void i2c_lock(int port, int lock) ASSERT(port != -1); #endif if (lock) { - /* Don't allow deep sleep when I2C port is locked */ - disable_sleep(SLEEP_MASK_I2C); + /* + * Don't allow deep sleep when I2C port is locked + * TODO(crbug.com/537759): Fix sleep mask for multi-port lock. + */ + disable_sleep(SLEEP_MASK_I2C_MASTER); mutex_lock(port_mutex + port); } else { mutex_unlock(port_mutex + port); /* Allow deep sleep again after I2C port is unlocked */ - enable_sleep(SLEEP_MASK_I2C); + enable_sleep(SLEEP_MASK_I2C_MASTER); } } diff --git a/include/system.h b/include/system.h index e6e585ba21..2a1c1784ca 100644 --- a/include/system.h +++ b/include/system.h @@ -294,13 +294,14 @@ enum { /* * Sleep masks to prevent going in to deep sleep. */ - SLEEP_MASK_AP_RUN = (1 << 0), /* the main CPU is running */ - SLEEP_MASK_UART = (1 << 1), /* UART communication on-going */ - SLEEP_MASK_I2C = (1 << 2), /* I2C master communication on-going */ - SLEEP_MASK_CHARGING = (1 << 3), /* Charging loop on-going */ - SLEEP_MASK_USB_PWR = (1 << 4), /* USB power loop on-going */ - SLEEP_MASK_USB_PD = (1 << 5), /* USB PD device connected */ - SLEEP_MASK_SPI = (1 << 6), /* SPI communications on-going */ + SLEEP_MASK_AP_RUN = (1 << 0), /* the main CPU is running */ + SLEEP_MASK_UART = (1 << 1), /* UART communication ongoing */ + SLEEP_MASK_I2C_MASTER = (1 << 2), /* I2C master communication ongoing */ + SLEEP_MASK_CHARGING = (1 << 3), /* Charging loop ongoing */ + SLEEP_MASK_USB_PWR = (1 << 4), /* USB power loop ongoing */ + SLEEP_MASK_USB_PD = (1 << 5), /* USB PD device connected */ + SLEEP_MASK_SPI = (1 << 6), /* SPI communications ongoing */ + SLEEP_MASK_I2C_SLAVE = (1 << 7), /* I2C slave communication ongoing */ SLEEP_MASK_FORCE_NO_DSLEEP = (1 << 15), /* Force disable. */