diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2021-08-06 17:03:38 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-10 06:06:26 +0000 |
commit | 2b46b253ecb62909b769e2d52efe55042b06819b (patch) | |
tree | 34e972a17798e35497049048f7271ee309bef92e | |
parent | de9917c83703f31191ae3421275cec510990ab32 (diff) | |
download | chrome-ec-2b46b253ecb62909b769e2d52efe55042b06819b.tar.gz |
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 <Devin.Lu@quantatw.com>
Change-Id: I37c7854769b4bc1f1eafbe8134bf0804ea35474a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077590
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | board/redrix/board.c | 34 | ||||
-rw-r--r-- | board/redrix/board.h | 2 | ||||
-rw-r--r-- | board/redrix/ec.tasklist | 1 |
3 files changed, 1 insertions, 36 deletions
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 */ diff --git a/board/redrix/board.h b/board/redrix/board.h index c8d64702f3..aec19f667a 100644 --- a/board/redrix/board.h +++ b/board/redrix/board.h @@ -178,7 +178,7 @@ /* Charger defines */ #define CONFIG_CHARGER_BQ25720 #define CONFIG_CHARGER_BQ25720_VSYS_TH2_DV 70 -#define CONFIG_CHARGE_RAMP_SW +#define CONFIG_CHARGE_RAMP_HW #define CONFIG_CHARGER_SENSE_RESISTOR 10 #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 diff --git a/board/redrix/ec.tasklist b/board/redrix/ec.tasklist index 527007d689..937fe97ae0 100644 --- a/board/redrix/ec.tasklist +++ b/board/redrix/ec.tasklist @@ -14,7 +14,6 @@ TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_ALWAYS(LED, led_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS_RW(PCHG, pchg_task, NULL, LARGER_TASK_STACK_SIZE) \ - TASK_ALWAYS(CHG_RAMP, chg_ramp_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P0, usb_charger_task, 0, TASK_STACK_SIZE) \ TASK_ALWAYS(USB_CHG_P1, usb_charger_task, 0, TASK_STACK_SIZE) \ TASK_ALWAYS(CHARGER, charger_task, NULL, VENTI_TASK_STACK_SIZE) \ |