gimble: set 90% input current limit
BRANCH=none
TEST=make -j BOARD=gimble
Tested-by: Scott Chao
#include "battery.h"
#include "button.h"
#include "charge_ramp.h"
+#include "charge_state_v2.h"
#include "charger.h"
#include "common.h"
#include "compile_time_macros.h"
@@ -112,3 +113,17 @@ enum battery_present battery_hw_present(void)
/* The GPIO is low when the battery is physically present */
return gpio_get_level(batt_pres) ? BP_NO : BP_YES;
}
+
+__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.
+ */
+ charge_ma = charge_ma * 90 / 100;
+
+ charge_set_input_current_limit(MAX(charge_ma,
+ CONFIG_CHARGER_INPUT_CURRENT),
+ charge_mv);
+}
