summaryrefslogtreecommitdiff
path: root/board/gooey
diff options
context:
space:
mode:
Diffstat (limited to 'board/gooey')
-rw-r--r--board/gooey/board.c13
-rw-r--r--board/gooey/board.h5
2 files changed, 13 insertions, 5 deletions
diff --git a/board/gooey/board.c b/board/gooey/board.c
index 544117f9c6..250f6afd61 100644
--- a/board/gooey/board.c
+++ b/board/gooey/board.c
@@ -259,6 +259,19 @@ uint16_t tcpc_get_alert_status(void)
return status;
}
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
+{
+ int icl = MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT);
+
+ /*
+ * b/147463641: The charger IC seems to overdraw ~4%, therefore we
+ * reduce our target accordingly.
+ */
+ icl = icl * 96 / 100;
+ charge_set_input_current_limit(icl, charge_mv);
+}
+
__override void typec_set_source_current_limit(int port, enum tcpc_rp_value rp)
{
if (port < 0 || port > board_get_usb_pd_port_count())
diff --git a/board/gooey/board.h b/board/gooey/board.h
index fde32f8866..b586c0f334 100644
--- a/board/gooey/board.h
+++ b/board/gooey/board.h
@@ -32,11 +32,6 @@
*/
#undef CONFIG_USB_PD_TCPC_LPM_EXIT_DEBOUNCE
#define CONFIG_USB_PD_TCPC_LPM_EXIT_DEBOUNCE (100 * MSEC)
-/*
- * b/147463641: The charger IC seems to overdraw ~4%, therefore we
- * reduce our target accordingly.
- */
-#define CONFIG_CHARGER_INPUT_CURRENT_DERATE_PCT 4
/* DAC for PSYS */
#define CONFIG_DAC