summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2019-07-17 22:31:12 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-19 17:44:14 +0000
commitc4fea05fb09d7c0290cd5f5b1f4ece886e49e233 (patch)
treec84701be0fc32d22b531bb109550f30d4f657911
parent94484c33a24a5285d452b318ee96122e5e435449 (diff)
downloadchrome-ec-c4fea05fb09d7c0290cd5f5b1f4ece886e49e233.tar.gz
eve: Wake AP on DP AltMode Entry & Attention.
This commit allows eve 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:985228 BRANCH=firmware-eve-9584.B TEST=Flash eve; 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: I70128c12657c7af7639ecc26fcc22040b4ff9099 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719752 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/eve/usb_pd_policy.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/eve/usb_pd_policy.c b/board/eve/usb_pd_policy.c
index 541264ee3e..63d6d3b666 100644
--- a/board/eve/usb_pd_policy.c
+++ b/board/eve/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/charger/bd9995x.h"
@@ -313,6 +314,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_SUSPEND) ||
+ chipset_in_state(CHIPSET_STATE_STANDBY))
+ /*
+ * Wake the system up to since we've attached an adapter
+ */
+ pd_notify_dp_alt_mode_entry();
+
return 0;
}
@@ -372,6 +381,12 @@ static int svdm_dp_attention(int port, uint32_t *payload)
int irq = PD_VDO_DPSTS_HPD_IRQ(payload[1]);
const struct usb_mux *mux = &usb_muxes[port];
+ if ((chipset_in_state(CHIPSET_STATE_SUSPEND) ||
+ chipset_in_state(CHIPSET_STATE_STANDBY)) &&
+ (irq || lvl))
+ /* Wake up the AP. */
+ pd_notify_dp_alt_mode_entry();
+
dp_status[port] = payload[1];
if (!(dp_flags[port] & DP_FLAGS_DP_ON)) {
if (lvl)