summaryrefslogtreecommitdiff
path: root/common/usb_pd_dual_role.c
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-08-14 10:17:59 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-18 04:11:50 +0000
commit001653461171f9685adfcba16b6d2e6108dfe725 (patch)
tree84b1dc78680e55ab99f559294aa96cc60e2ec26b /common/usb_pd_dual_role.c
parent2c458588fc6e6ba12cf34e17ac4f1173de9f8b0f (diff)
downloadchrome-ec-001653461171f9685adfcba16b6d2e6108dfe725.tar.gz
config: Require battery >5% to enable PD Try.SRC
Align the CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to the value of BATTERY_LEVEL_CRITICAL, which is 5%. The BATTERY_LEVEL_CRITICAL is 5% that means EC will send battery- critical host event when the battery level <= 5%. CrOS PD policies state that the system doesn't source power to any external USB devices when AP is shutdown. So the current CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC 1% default has no point. When the battery level is <= 5%, AP should be shutdown soon and the system should not be a source, so should not enable Try.SRC. Also change the comparison from soc >= CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to soc > CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC as the battery critical check is soc <= BATTERY_LEVEL_CRITICAL. BRANCH=None BUG=b:165057418 TEST=Plugging a PD charger to a board with the battery level very low, the system boots up (was failed), Change-Id: If6b11feacd62fd003e13b1756eb5c33d2f9bbce4 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360543 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/usb_pd_dual_role.c')
-rw-r--r--common/usb_pd_dual_role.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c
index daa6f6dc86..eff8954622 100644
--- a/common/usb_pd_dual_role.c
+++ b/common/usb_pd_dual_role.c
@@ -360,7 +360,7 @@ bool pd_is_try_source_capable(void)
* and at some minimum percentage.
*/
new_try_src = (try_src &&
- usb_get_battery_soc() >= CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC);
+ usb_get_battery_soc() > CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC);
#ifdef CONFIG_BATTERY_REVIVE_DISCONNECT
/*