TCPMv2: Check for mode discovery complete before switching
TCPMv2: Check for mode discovery complete before switching

If port discovery is run multiple times, because of power state changes
to the AP, DP alt modes are not detected because dpm_attempt_mode_entry
is run after discovery is initialised, but before discovery completes,
and so no modes are detected, and no attempt is made thereafter.

Also correct an unsigned compare against 0.

BUG=b:158813138
TEST=Confirm that type-C monitors now work
BRANCH=none

Change-Id: Idef39ad97d6af2952474e8edcebd409f8324fa80
Signed-off-by: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2245580
Reviewed-by: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@chromium.org>
Commit-Queue: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@chromium.org>
Tested-by: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec