diff options
-rw-r--r-- | driver/battery/smart.c | 6 | ||||
-rw-r--r-- | include/config.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/driver/battery/smart.c b/driver/battery/smart.c index 2d314e5e6f..2a0278cee5 100644 --- a/driver/battery/smart.c +++ b/driver/battery/smart.c @@ -24,11 +24,17 @@ test_mockable int sbc_write(int cmd, int param) int sb_read(int cmd, int *param) { +#ifdef CONFIG_BATTERY_I2C_ACCESS_DELAY_TIME + usleep(CONFIG_BATTERY_I2C_ACCESS_DELAY_TIME); +#endif return i2c_read16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, param); } int sb_write(int cmd, int param) { +#ifdef CONFIG_BATTERY_I2C_ACCESS_DELAY_TIME + usleep(CONFIG_BATTERY_I2C_ACCESS_DELAY_TIME); +#endif return i2c_write16(I2C_PORT_BATTERY, BATTERY_ADDR, cmd, param); } diff --git a/include/config.h b/include/config.h index d9da27867a..c79f0208dd 100644 --- a/include/config.h +++ b/include/config.h @@ -99,6 +99,11 @@ #undef CONFIG_BATTERY_CUT_OFF /* + * Delay time for smart battery command. + */ +#undef CONFIG_BATTERY_I2C_ACCESS_DELAY_TIME + +/* * Battery percent thresholds to notify the host or shut down the system. * If not specified, default values are set in include/battery.h. */ |