summaryrefslogtreecommitdiff
path: root/baseboard/octopus/baseboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'baseboard/octopus/baseboard.c')
-rw-r--r--baseboard/octopus/baseboard.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 164e28b480..0f012d1352 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -298,6 +298,20 @@ int board_set_active_charge_port(int port)
return EC_SUCCESS;
}
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
+{
+ /*
+ * Empirically, the charger seems to draw a little more current that
+ * it is set to, so we reduce our limit by 5%.
+ */
+#if defined(CONFIG_CHARGER_BQ25710) || defined(CONFIG_CHARGER_ISL9238)
+ charge_ma = (charge_ma * 95) / 100;
+#endif
+ charge_set_input_current_limit(
+ MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
+}
+
void board_hibernate(void)
{
int port;