summaryrefslogtreecommitdiff
path: root/common/usb_pd_policy.c
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2014-10-13 15:45:50 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-30 21:48:06 +0000
commita3913d99d7a40062144b96d505bba56a62986faa (patch)
tree35b6531d59c0889a36d77253faa30bfa1ea86b4e /common/usb_pd_policy.c
parentd4f3279db9d31159624449828362e45062bd7703 (diff)
downloadchrome-ec-a3913d99d7a40062144b96d505bba56a62986faa.tar.gz
pd: dingdong/hoho: HPD over USB PD.
HPD needs to be transported of USB PD as both SBU lines are consumed for differential AUX signalling. This CL does the following: 1. Enables GPIO DP_HPD as interrupt 2. Sends debounced HPD across CC via the SVDM DP status message BRANCH=none BUG=chrome-os-partner:31192,chrome-os-partner:31193 TEST=manual, From servo w/ GPIO attached to HPD drove the following transactions after inserting with HPD low initially: # e1: hpd_high # e2: hpd_low # non-registered glitch # e3: hpd_high followed by hpd_low # e4: hpd high # non-registered glitch # e5: hpd_irq # e6: hpd_irq # e7: hpd_irq # e8: hpd_low followed by hpd_high From fruitpie console (marked up to show result of above) ----> enter-mode, dp status, dp config [6.774108 DONE] SVDM/1 [4] ff018144 [6.777467 DONE] SVDM/2 [16] ff018150 00000002 [6.780637 DONE] SVDM/1 [17] ff018051 ----> attentions start arriving ----> e1 [18.966741 DONE] SVDM/2 [6] ff018106 0000008a ----> e2 [33.724367 DONE] SVDM/2 [6] ff018106 0000000a ----> e3 [64.550398 DONE] SVDM/2 [6] ff018106 0000008a ----> e3 [64.752452 DONE] SVDM/2 [6] ff018106 0000000a ----> e4 [74.247127 DONE] SVDM/2 [6] ff018106 0000008a ----> e5 [88.906254 DONE] SVDM/2 [6] ff018106 0000010a ----> e6 [100.938738 DONE] SVDM/2 [6] ff018106 0000010a ----> e7 [123.693414 DONE] SVDM/2 [6] ff018106 0000010a ----> e8 [130.050074 DONE] SVDM/2 [6] ff018106 0000000a ----> e8 [130.254087 DONE] SVDM/2 [6] ff018106 0000008a Change-Id: I976c268467ece84cedab7ba4943fb59d1e48c113 Signed-off-by: Todd Broch <tbroch@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/223262 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r--common/usb_pd_policy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 3149934d33..f0ae2cffab 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -267,7 +267,6 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
break;
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
case CMD_ATTENTION:
- /* This is DFP response */
func = &dfp_consume_attention;
break;
#endif
@@ -288,9 +287,9 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
payload[0] |= VDO_CMDT(CMDT_RSP_BUSY);
rsize = 1;
}
-#ifdef CONFIG_USB_PD_ALT_MODE_DFP
} else if (cmd_type == CMDT_RSP_ACK) {
switch (cmd) {
+#ifdef CONFIG_USB_PD_ALT_MODE_DFP
case CMD_DISCOVER_IDENT:
dfp_consume_identity(port, payload);
rsize = dfp_discover_svids(port, payload);
@@ -333,6 +332,7 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
/* no response after DFPs ack */
rsize = 0;
break;
+#endif
case CMD_ATTENTION:
/* no response after DFPs ack */
rsize = 0;
@@ -343,6 +343,7 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
}
payload[0] |= VDO_CMDT(CMDT_INIT);
+#ifdef CONFIG_USB_PD_ALT_MODE_DFP
} else if (cmd_type == CMDT_RSP_BUSY) {
switch (cmd) {
case CMD_DISCOVER_IDENT:
@@ -381,6 +382,10 @@ int pd_svdm(int port, int cnt, uint32_t *payload, uint32_t **rpayload)
return 0;
}
+int pd_alt_mode(int port)
+{
+ return 0;
+}
#endif /* CONFIG_USB_PD_ALT_MODE */
#ifndef CONFIG_USB_PD_CUSTOM_VDM