summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2019-01-09 13:07:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-26 04:42:44 -0700
commitedcc6fc02c816781a9c24ac1d04e6e56e092a457 (patch)
tree6ff04f3c63a2618b8aeaf00ec1844cc1f8ecb57e
parent862d00cf9994809711853c1f5261f7b9906ba149 (diff)
downloadchrome-ec-edcc6fc02c816781a9c24ac1d04e6e56e092a457.tar.gz
nocturne: Check DP MF-bit against selected pin cfg
When we are configuring a Type-C port for DisplayPort alternate mode, we should check to see that the selected pin config supports multi-function mode or not. This commit fixes a bug where we were setting the SuperSpeed muxes based solely upon the Multi-function Preferred bit in the DPStatus VDO. Some Type-C video adapters are buggy and set the MF preferred bit without actually supporting an MF pin configuration. Therefore, we trust the reported supported pin configurations in the DiscMode VDO. BUG=chromium:919756 BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne, plug in Insignia NS-PU369CH-WH USB-C to HDMI adapter, verify that 4k60 display is shown. TEST=Plug in Belkin dock which supports SuperSpeed ports, verify that SuperSpeed ports work and display is shown at 4k30. Change-Id: I9febb007edc5392a6172e4709482981dbcbdc8b7 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/1404136 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1530127 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/nocturne/usb_pd_policy.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/board/nocturne/usb_pd_policy.c b/board/nocturne/usb_pd_policy.c
index e4420c2a65..d06e92ac96 100644
--- a/board/nocturne/usb_pd_policy.c
+++ b/board/nocturne/usb_pd_policy.c
@@ -303,14 +303,22 @@ static int svdm_dp_config(int port, uint32_t *payload)
int opos = pd_alt_mode(port, USB_SID_DISPLAYPORT);
int mf_pref = PD_VDO_DPSTS_MF_PREF(dp_status[port]);
int pin_mode = pd_dfp_dp_get_pin_mode(port, dp_status[port]);
+ enum typec_mux mux_mode;
if (!pin_mode)
return 0;
+ /*
+ * Multi-function operation is only allowed if that pin config is
+ * supported.
+ */
+ mux_mode = ((pin_mode & MODE_DP_PIN_MF_MASK) && mf_pref) ?
+ TYPEC_MUX_DOCK : TYPEC_MUX_DP;
+ CPRINTS("pin_mode: %x, mf: %d, mux: %d", pin_mode, mf_pref, mux_mode);
+
/* Connect the SBU and USB lines to the connector. */
ppc_set_sbu(port, 1);
- usb_mux_set(port, mf_pref ? TYPEC_MUX_DOCK : TYPEC_MUX_DP,
- USB_SWITCH_CONNECT, pd_get_polarity(port));
+ usb_mux_set(port, mux_mode, USB_SWITCH_CONNECT, pd_get_polarity(port));
payload[0] = VDO(USB_SID_DISPLAYPORT, 1,
CMD_DP_CONFIG | VDO_OPOS(opos));