diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-07-30 14:19:46 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-02 08:17:09 +0000 |
commit | 37b65d5c8c9400049d17a9349ad0b55f42b8203b (patch) | |
tree | 9106a145b182f171d188b4246522097c4ef0a2db /board/samus_pd | |
parent | 64bbfe253c7ec2d0fd34cf309d4685448a2fa13d (diff) | |
download | chrome-ec-37b65d5c8c9400049d17a9349ad0b55f42b8203b.tar.gz |
pd: don't enable try.src when battery is not present or too low
Don't enable try.src when battery is not present or <1% because
try.src will temporarily cut off power to system.
BUG=chrome-os-partner:43413
BRANCH=samus
TEST=tested on samus using "battfake" ec command. when battery
<1%, verified that try.src is disabled and when battery >=1% and
the AP is on (dual-role toggling is on), then try.src is enabled.
verified boot without battery succeeds on samus and glados.
Change-Id: I64816bb7c9669bfeca61687bcd9a48da32e67945
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289854
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/samus_pd')
-rw-r--r-- | board/samus_pd/board.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index dcf40cdd99..e1941cabbe 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -624,8 +624,11 @@ void board_set_charge_limit(int charge_ma) static void board_update_battery_soc(int soc) { - batt_soc = soc; - board_update_charge_limit(desired_charge_rate_ma); + if (batt_soc != soc) { + batt_soc = soc; + board_update_charge_limit(desired_charge_rate_ma); + hook_notify(HOOK_BATTERY_SOC_CHANGE); + } } /* Send host event up to AP */ |