Add checking the return value of enabling vbus in SRC_DISCONNECTED.
If failed to enable vbus, don't transition to SRC_DISCOVERY. This
can happen on zinger if zinger is in a fault condition, but once
the fault is cleared, we need to be in SRC_DISCONNECTED in order
to re-apply vbus.
BUG=none
BRANCH=none
TEST=load onto EVT zinger. without this change, if zinger is plugged
into a samus without a battery, when PD MCU is reset, zinger gets
stuck in SRC_DISCOVERY with vbus disabled because
pd_set_power_supply_ready() returns an error. This means to get
power back to samus, we need to unplug and replug raiden. This change
fixes the problem.
Change-Id: I2ac75c7095b5d819b54b2f25ec974ccfd974e1e2
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216608
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>