diff options
author | Todd Broch <tbroch@chromium.org> | 2014-11-06 02:34:47 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-11 00:11:18 +0000 |
commit | 84681349f444a9596d38117b41e8a279bb52a856 (patch) | |
tree | e53c17bcb712f8a41521bd60c54dae994d28797c /board/samus_pd/usb_pd_policy.c | |
parent | 56d92341f39570ea0f3e3ae2600b9710f79b6c3c (diff) | |
download | chrome-ec-84681349f444a9596d38117b41e8a279bb52a856.tar.gz |
pd: Send proper OPOS for DP status & config.
Once a mode is entered object position (OPOS ... AKA alternate mode) field in
the VDM header should always track that mode.
CL fixes DP status & config messages which did not add the correct OPOS. In
fixing I mapped to the UFPs function pd_alt_mode which for the DFP did require
the addition of port parameter. Finally I cleaned up code to use this function
throughout common policy layer where previously I'd just accessed the pe
structure directly.
BRANCH=samus_pd
BUG=none
TEST=manual, compiles, insert hoho/dingdong into samus and see OPOS=1 from samus
for enter, dp_config, dp_status SVDMs
Change-Id: I66448c3386be01bae58768632da216aff41a9a30
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/228130
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/samus_pd/usb_pd_policy.c')
-rw-r--r-- | board/samus_pd/usb_pd_policy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/board/samus_pd/usb_pd_policy.c b/board/samus_pd/usb_pd_policy.c index b30a46b71b..0425ef66a9 100644 --- a/board/samus_pd/usb_pd_policy.c +++ b/board/samus_pd/usb_pd_policy.c @@ -265,7 +265,8 @@ static int dp_on; static int svdm_dp_status(int port, uint32_t *payload) { - payload[0] = VDO(USB_SID_DISPLAYPORT, 1, CMD_DP_STATUS); + payload[0] = VDO(USB_SID_DISPLAYPORT, 1, + CMD_DP_STATUS | VDO_OPOS(pd_alt_mode(port))); payload[1] = VDO_DP_STATUS(0, /* HPD IRQ ... not applicable */ 0, /* HPD level ... not applicable */ 0, /* exit DP? ... no */ @@ -281,7 +282,8 @@ static int svdm_dp_config(int port, uint32_t *payload) { board_set_usb_mux(port, TYPEC_MUX_DP, pd_get_polarity(port)); dp_on = 1; - payload[0] = VDO(USB_SID_DISPLAYPORT, 1, CMD_DP_CONFIG); + payload[0] = VDO(USB_SID_DISPLAYPORT, 1, + CMD_DP_CONFIG | VDO_OPOS(pd_alt_mode(port))); payload[1] = VDO_DP_CFG(MODE_DP_PIN_E, /* sink pins */ MODE_DP_PIN_E, /* src pins */ 1, /* DPv1.3 signaling */ |