summaryrefslogtreecommitdiff
path: root/board/drobit
diff options
context:
space:
mode:
Diffstat (limited to 'board/drobit')
-rw-r--r--board/drobit/board.c14
-rw-r--r--board/drobit/board.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/board/drobit/board.c b/board/drobit/board.c
index 1d881d9a2c..1a20870d1f 100644
--- a/board/drobit/board.c
+++ b/board/drobit/board.c
@@ -475,3 +475,17 @@ static void board_chipset_suspend(void)
gpio_set_level(GPIO_EC_KB_BL_EN, 0);
}
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
+
+/******************************************************************************/
+/* Set the charge limit based upon desired maximum. */
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
+{
+ /*
+ * Limit the input current to 98% negotiated limit,
+ * to account for the charger chip margin.
+ */
+ charge_ma = charge_ma * 98 / 100;
+ charge_set_input_current_limit(
+ MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
+}
diff --git a/board/drobit/board.h b/board/drobit/board.h
index bf3e64ae5a..d6fda98f3d 100644
--- a/board/drobit/board.h
+++ b/board/drobit/board.h
@@ -89,7 +89,6 @@
/* charger defines */
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
-#define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 2
/*
* Macros for GPIO signals used in common code that don't match the