summaryrefslogtreecommitdiff
path: root/baseboard/guybrush
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-06-17 15:09:04 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-22 18:45:50 +0000
commit949d4a48716a557e4a911f86bf9477b7d27cac05 (patch)
tree7ecae182e7991b2b938050ad877a52ae617c6e56 /baseboard/guybrush
parente4c38351cbb4eafe7aa52c810136dfb1a591d32b (diff)
downloadchrome-ec-949d4a48716a557e4a911f86bf9477b7d27cac05.tar.gz
Guybrush: Reset TCPCs in dead battery mode after charger removal
When we're requested to set our charge port to None, indicating our previous charge port was either removed or switched to no longer being a sink role, reset any TCPCs which were in dead battery mode. This does not provide any increased risk of brown out, since we already lost our active charge port and would disable both board PPCs. BRANCH=None BUG=b:183660105 TEST=on guybrush, cut off the battery and boot with a charger. Remove the charger and ensure the TCPC is fully reset after removal Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0538b179075cbcc35f00f9710151183413dea2fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2970785 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'baseboard/guybrush')
-rw-r--r--baseboard/guybrush/baseboard.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/baseboard/guybrush/baseboard.c b/baseboard/guybrush/baseboard.c
index f6f2f0f36c..d6c2ee8d2f 100644
--- a/baseboard/guybrush/baseboard.c
+++ b/baseboard/guybrush/baseboard.c
@@ -581,6 +581,16 @@ int board_set_active_charge_port(int port)
/* Disable all ports. */
for (i = 0; i < ppc_cnt; i++) {
/*
+ * If this port had booted in dead battery mode, go
+ * ahead and reset it so EN_SNK responds properly.
+ */
+ if (nct38xx_get_boot_type(i) ==
+ NCT38XX_BOOT_DEAD_BATTERY) {
+ reset_nct38xx_port(cur_port);
+ pd_set_error_recovery(i);
+ }
+
+ /*
* Do not return early if one fails otherwise we can
* get into a boot loop assertion failure.
*/