diff options
author | Diana Z <dzigterman@chromium.org> | 2021-03-04 16:27:35 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-05 01:24:05 +0000 |
commit | b9a62c42aa1fbe55a9eabf04b2650b1c3dcabd66 (patch) | |
tree | e5637a6d7ab16e26880d4239d0a0876b739682ab | |
parent | f88e6d3678794e103c2b1ae991fdbdda768d956b (diff) | |
download | chrome-ec-b9a62c42aa1fbe55a9eabf04b2650b1c3dcabd66.tar.gz |
OCPC: Skip voltage init with no battery
On systems with no battery present (or a battery which has not yet
reported a voltage), skip setting Vsys to the battery voltage.
BRANCH=None
BUG=b:176214112
TEST=on galtic, sysjump with a charger in C1 and verify initial Vsys is
not set to 0
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I790cd69ec948d4f2ccaad8c7963d8a4883564e1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738054
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | common/ocpc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/ocpc.c b/common/ocpc.c index 261cf3f009..ab7f8e74a3 100644 --- a/common/ocpc.c +++ b/common/ocpc.c @@ -665,7 +665,7 @@ void ocpc_reset(struct ocpc_data *ocpc) * Initialize the VSYS target on the aux chargers to the current battery * voltage to avoid a large spike. */ - if (ocpc->active_chg_chip > CHARGER_PRIMARY) { + if (ocpc->active_chg_chip > CHARGER_PRIMARY && batt.voltage > 0) { CPRINTS("OCPC: C%d Init VSYS to %dmV", ocpc->active_chg_chip, batt.voltage); charger_set_voltage(ocpc->active_chg_chip, batt.voltage); |