Now that when ID_MUX=1, DP_SNS can be connected to either ID_OUT or
CABLE_DET, we need to handle the case where a video dongle is not
reflected by DP_SNS going low. This is done by leaving ID_MUX=1 for USB
host and monitor its detachment by sensing VBUS. As for unpowered
dongle, we just ignore it when it's not recognized.
Note that due to the polarity of CABLE_DET, we now sense dongle
detachement by DP_SNS < 0.25V. To support older boards with ID_OUT
connected, we also disconnect video dongle on system suspend and
shutdown.
BUG=chrome-os-partner:19911
TEST=Powered/unpowered video dongle detected correctly.
TEST=Add a console command to simulate CABLE_DET being high. With that,
check battery charges with powered video dongle. Check nothing happens
with unpowered video dongle.
TEST=Check video dongle considered disconnected when OTG dongle plugged
in or system shutdown.
BRANCH=spring
Change-Id: If7b530b67c98c85017ca663d43c5148f0eb9163c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58070
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>