From bdb3f44ef2df844c97fcf02730a6433675778595 Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Tue, 7 Nov 2017 09:18:00 -0800 Subject: [PATCH] fizz: Enable charge_manager safe mode and never leave it Fizz has no battery, so any port / ILIM selection logic that could lead to de-powering the device should be relaxed. BUG=b:68953563 BRANCH=None TEST=Boot fizz with both zinger and barrel charger, verify no panic / brownout occurs. Change-Id: I3bf353f5a26fe6210c67f8ee3f785012d4c063f0 Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/756924 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Daisuke Nojiri --- board/fizz/board.h | 1 - board/fizz/usb_pd_policy.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/board/fizz/board.h b/board/fizz/board.h index 6b1c27d020..93dce5bd49 100644 --- a/board/fizz/board.h +++ b/board/fizz/board.h @@ -67,7 +67,6 @@ /* Charger */ #define CONFIG_CHARGE_MANAGER -#undef CONFIG_CHARGE_MANAGER_SAFE_MODE #define CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW 50000 diff --git a/board/fizz/usb_pd_policy.c b/board/fizz/usb_pd_policy.c index ee853f0ab6..39e47dd895 100644 --- a/board/fizz/usb_pd_policy.c +++ b/board/fizz/usb_pd_policy.c @@ -219,6 +219,16 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, return 0; } +/* + * Since fizz has no battery, it must source all of its power from either + * USB-C or the barrel jack (preferred). Fizz operates in continuous safe + * mode (charge_manager_leave_safe_mode() will never be called), which + * modifies port / ILIM selection as follows: + * + * - Dual-role / dedicated capability of the port partner is ignored. + * - Charge ceiling on PD voltage transition is ignored. + * - CHARGE_PORT_NONE will never be selected. + */ static void board_charge_manager_init(void) { int input_voltage;