From 2b46b253ecb62909b769e2d52efe55042b06819b Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Fri, 6 Aug 2021 17:03:38 +0800 Subject: Redrix: Enable hardware charging ramp This patch enables hw charging ramp, the bq25720 have hw ramp function (call Input Current Optimizer (ICO)). Enable it instead of sw ramp. BUG=b:195826406 BRANCH=none TEST=On Redrix. Plug in CDP, SDP, DCP, type-C and PD charger: 1. EC console chgsup to make sure voltage/current is indeed. 2. PDtrace to make sure we ramp current to a reasonable value. Signed-off-by: Devin Lu Change-Id: I37c7854769b4bc1f1eafbe8134bf0804ea35474a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077590 Reviewed-by: Boris Mittelberg Reviewed-by: Keith Short --- board/redrix/board.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'board/redrix/board.c') diff --git a/board/redrix/board.c b/board/redrix/board.c index 3d213debb7..3c0f48f2bd 100644 --- a/board/redrix/board.c +++ b/board/redrix/board.c @@ -78,40 +78,6 @@ static void board_chipset_suspend(void) } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); -#ifdef CONFIG_CHARGE_RAMP_SW - -/* - * TODO(b/181508008): tune this threshold - */ - -#define BC12_MIN_VOLTAGE 4400 - -/** - * Return true if VBUS is too low - */ -int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state) -{ - int voltage; - - if (charger_get_vbus_voltage(port, &voltage)) - voltage = 0; - - if (voltage == 0) { - CPRINTS("%s: must be disconnected", __func__); - return 1; - } - - if (voltage < BC12_MIN_VOLTAGE) { - CPRINTS("%s: port %d: vbus %d lower than %d", __func__, - port, voltage, BC12_MIN_VOLTAGE); - return 1; - } - - return 0; -} - -#endif /* CONFIG_CHARGE_RAMP_SW */ - enum battery_present battery_hw_present(void) { /* The GPIO is low when the battery is physically present */ -- cgit v1.2.1