summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2019-06-18 15:42:24 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-24 20:48:49 +0000
commitb1fa948170aa5b5441914797256db6fb04b4464c (patch)
treea042cdcbadbb2e5b8d5d7cf2ee676e31653be5f7
parent99de2e458265cf59388b0eec54390b3c3d097624 (diff)
downloadchrome-ec-b1fa948170aa5b5441914797256db6fb04b4464c.tar.gz
nocturne: Wake AP on DP AltMode Entry & Attention.
This commit allows nocturne to wake from suspend when the device enters DisplayPort Alternate mode and if an attention VDM is received while in the mode. Note that since our policy is to be a sink only during suspend, only powered charge through hubs with external display capability will wake us up. BUG=chromium:786721 BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne; suspend DUT, plug in powered charge through hub, verify that DUT wakes up. TEST=Use a powered MST hub, plug in a second monitor, verify DUT wakes up as well. Change-Id: I7e0fc6745ef06865e9fc4c23c29adf5974664388 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1666367 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Benson Leung <bleung@google.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/nocturne/usb_pd_policy.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/nocturne/usb_pd_policy.c b/board/nocturne/usb_pd_policy.c
index d06e92ac96..8e2c06bd61 100644
--- a/board/nocturne/usb_pd_policy.c
+++ b/board/nocturne/usb_pd_policy.c
@@ -4,6 +4,7 @@
*/
#include "charge_manager.h"
+#include "chipset.h"
#include "common.h"
#include "console.h"
#include "compile_time_macros.h"
@@ -275,6 +276,14 @@ static int svdm_enter_dp_mode(int port, uint32_t mode_caps)
/* Only enter mode if device is DFP_D capable */
if (mode_caps & MODE_DP_SNK) {
svdm_safe_dp_mode(port);
+
+ if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND))
+ /*
+ * Wake the system up since we're entering DP AltMode.
+ */
+ pd_notify_dp_alt_mode_entry();
+
+
return 0;
}
@@ -363,6 +372,14 @@ static int svdm_dp_attention(int port, uint32_t *payload)
cur_lvl = gpio_get_level(hpd);
dp_status[port] = payload[1];
+ if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) &&
+ (irq || lvl))
+ /*
+ * Wake up the AP. IRQ or level high indicates a DP sink is now
+ * present.
+ */
+ pd_notify_dp_alt_mode_entry();
+
/* Its initial DP status message prior to config */
if (!(dp_flags[port] & DP_FLAGS_DP_ON)) {
if (lvl)