diff options
Diffstat (limited to 'board/eldrid/board.c')
-rw-r--r-- | board/eldrid/board.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/board/eldrid/board.c b/board/eldrid/board.c index dad5e88cf2..e1baf7bf55 100644 --- a/board/eldrid/board.c +++ b/board/eldrid/board.c @@ -8,6 +8,7 @@ #include "common.h" #include "accelgyro.h" #include "cbi_ec_fw_config.h" +#include "charge_state_v2.h" #include "driver/accel_bma2x2.h" #include "driver/accelgyro_bmi160.h" #include "driver/bc12/pi3usb9201.h" @@ -117,6 +118,21 @@ __override bool board_is_tbt_usb4_port(int port) && ((usb_db == DB_USB4_GEN2) || (usb_db == DB_USB4_GEN3))); } +__override void board_set_charge_limit(int port, int supplier, int charge_ma, + int max_ma, int charge_mv) +{ + /* + * Follow OEM request to limit the input current to + * 90% negotiated limit when S0. + */ + if (chipset_in_state(CHIPSET_STATE_ON)) + charge_ma = charge_ma * 90 / 100; + + charge_set_input_current_limit(MAX(charge_ma, + CONFIG_CHARGER_INPUT_CURRENT), + charge_mv); +} + /******************************************************************************/ /* Physical fans. These are logically separate from pwm_channels. */ |