summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2019-06-07 15:21:18 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-12 00:17:18 +0000
commite9fbc32f0939323c7effb49a3be2686318c8b01b (patch)
tree6dd44eb3a4fc221b1d62860b1925b205e2af4d22
parent045b947ebc7e7767f57160153187f30311cbd4a4 (diff)
downloadchrome-ec-e9fbc32f0939323c7effb49a3be2686318c8b01b.tar.gz
atlas: Don't enter DP Alt Mode when AP is off.
According to the DisplayPort Alt Mode on USB Type-C specification, if the DisplayPort Source device does not need to maintain HPD connectivity information prior to entering a low power state, the device shall exit the DP Alternate Mode. Previously, we were always entering DP Alt Mode regardless of the SoC state. When we are shutting the device down to S5 or G3, there's no need to monitor the HPD connectivity information. This commit simply does not enter DP Alt Mode when the SoC is off. BUG=chromium:927636 BRANCH=firmware-atlas-11827.B TEST=Flash atlas, shut DUT down to S5/G3, plug in a USB-C monitor that can also act as a Source, verify with PD analyzer that DUT does not Enter DP Alt mode, boot system up, verify that external display works. Change-Id: Ic465e4ecb73ba09388e3e4b665f526354bcedf6e Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1650621 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com>
-rw-r--r--board/atlas/usb_pd_policy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/board/atlas/usb_pd_policy.c b/board/atlas/usb_pd_policy.c
index fbf1f4d299..f9e9d746a9 100644
--- a/board/atlas/usb_pd_policy.c
+++ b/board/atlas/usb_pd_policy.c
@@ -6,6 +6,7 @@
#include "atomic.h"
#include "extpower.h"
#include "charge_manager.h"
+#include "chipset.h"
#include "common.h"
#include "console.h"
#include "driver/tcpm/ps8xxx.h"
@@ -293,6 +294,21 @@ static void svdm_safe_dp_mode(int port)
static int svdm_enter_dp_mode(int port, uint32_t mode_caps)
{
+ /*
+ * Don't enter the mode if the SoC is off.
+ *
+ * There's no need to enter the mode while the SoC is off; we'll
+ * actually enter the mode on the chipset resume hook. Entering DP Alt
+ * Mode twice will confuse some monitors and require and unplug/replug
+ * to get them to work again. The DP Alt Mode on USB-C spec says that
+ * if we don't need to maintain HPD connectivity info in a low power
+ * mode, then we shall exit DP Alt Mode. (This is why we don't enter
+ * when the SoC is off as opposed to suspend where adding a display
+ * could cause a wake up.)
+ */
+ if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
+ return -1;
+
/* Only enter mode if device is DFP_D capable */
if (mode_caps & MODE_DP_SNK) {
svdm_safe_dp_mode(port);