diff options
-rw-r--r-- | board/fleex/board.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/board/fleex/board.c b/board/fleex/board.c index a8ad2c08c8..e5270908af 100644 --- a/board/fleex/board.c +++ b/board/fleex/board.c @@ -16,7 +16,7 @@ #include "cros_board_info.h" #include "driver/accel_lis2dh.h" #include "driver/accelgyro_lsm6dsm.h" -#include "driver/charger/bd9995x.h" +#include "driver/charger/isl923x.h" #include "driver/ppc/nx20p348x.h" #include "driver/tcpm/anx7447.h" #include "driver/tcpm/ps8xxx.h" @@ -264,3 +264,22 @@ void board_overcurrent_event(int port, int is_overcurrented) /* Note that the level is inverted because the pin is active low. */ gpio_set_level(GPIO_USB_C_OC, !is_overcurrented); } + +static void charger_set_buck_boost_mode(void) +{ + int reg; + /* Reduce Buck-boost mode switching frequency to improve power efficiency. */ + if (i2c_read16(I2C_PORT_CHARGER, I2C_ADDR_CHARGER_FLAGS, + ISL9238_REG_CONTROL3, ®) == EC_SUCCESS) { + reg |= ISL9238_C3_BB_SWITCHING_PERIOD; + if (i2c_write16(I2C_PORT_CHARGER, I2C_ADDR_CHARGER_FLAGS, + ISL9238_REG_CONTROL3, reg)) + ccprints("Failed to set isl9238"); + } +} + +static void board_init(void) +{ + charger_set_buck_boost_mode(); +} +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); |