summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2022-02-14 18:11:14 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-20 00:30:51 +0000
commit7c2fa195590a1e496fe97ac10cc545138a66699c (patch)
tree306959b00a61cd4ea9e83e7e7449875f52746620 /include
parent145cc9689197c98c509fc4bd7352adc3daf2c092 (diff)
downloadchrome-ec-7c2fa195590a1e496fe97ac10cc545138a66699c.tar.gz
herobrine: Wait negotiated VBUS transition before enabling 5V rail
Previous, the PP5000 is enabled at GPIO init. In the dead battery case, enabling PP5000 overloads the battery charger at the initial 5V 500mA supply. We want to defer it until the PD negotiated VBUS transition, so the battery charger won't be overloaded. A window of PD negotiation is created. It starts from the Type-C state reaching Attached.SNK, and eneds when the PD contract is created. The VBUS may be raised anytime in this window. The current implementation is the worst case scenario. Every message the PD negotiation is received at the last moment before timeout. The extra time is added to compensate the delay internally, like the decision of the DPM. The unit tests are added. BRANCH=None BUG=b:215726554 TEST=Booted the Herobrine board with no-battery. The 5V rail got delayed. Change-Id: I5529762de3495e4cb6702e887bf6ee09d1711f14 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3501013 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'include')
-rw-r--r--include/charger.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/charger.h b/include/charger.h
index b6b3be3426..046ed3acc2 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -389,10 +389,15 @@ enum ec_error_list charger_enable_linear_charge(int chgnum, bool enable);
*/
enum ec_error_list charger_enable_bypass_mode(int chgnum, int enable);
-/*
+/**
* Print all charger info for debugging purposes
* @param chgnum: charger IC index.
*/
void print_charger_debug(int chgnum);
+/**
+ * Get the value of CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
+ */
+int charger_get_min_bat_pct_for_power_on(void);
+
#endif /* __CROS_EC_CHARGER_H */