summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/gimble/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/gimble/board.c b/board/gimble/board.c
index 7f940d3736..ca012f2e2d 100644
--- a/board/gimble/board.c
+++ b/board/gimble/board.c
@@ -6,6 +6,7 @@
#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);
+}