Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed70a236 authored by Jack Pham's avatar Jack Pham
Browse files

msm: mdss: dp: Fix PD compliance issues



Fix issues found during PD compliance testing for DisplayPort
downstream ports:

- The outgoing DP Status message must contain a single VDO. This
  also fixes certain devices which would not respond unless there
  was a status object included in the request. Initialize this to
  0x1 to indicate that the DFP_D is connected.
- Don't send Enter Mode if the discovered mode doesn't support UFP_D.
- Don't send Configure if the Status response doesn't support UFP_D.

Change-Id: I690860613670753ae6634786f3ee2746a36be54a
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent f50e4f24
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2152,8 +2152,9 @@ static void mdss_dp_event_work(struct work_struct *work)
			SVDM_CMD_TYPE_INITIATOR, 0x1, 0x0, 0x0);
		break;
	case EV_USBPD_DP_STATUS:
		config = 0x1; /* DFP_D connected */
		usbpd_send_svdm(dp->pd, USB_C_DP_SID, DP_VDM_STATUS,
			SVDM_CMD_TYPE_INITIATOR, 0x1, 0x0, 0x0);
			SVDM_CMD_TYPE_INITIATOR, 0x1, &config, 0x1);
		break;
	case EV_USBPD_DP_CONFIGURE:
		config = mdss_dp_usbpd_gen_config_pkt(dp);
@@ -2552,6 +2553,7 @@ static void usbpd_response_callback(struct usbpd_svid_handler *hdlr, u8 cmd,
		dp_drv->alt_mode.dp_cap.response = *vdos;
		mdss_dp_usbpd_ext_capabilities(&dp_drv->alt_mode.dp_cap);
		dp_drv->alt_mode.current_state |= DISCOVER_MODES_DONE;
		if (dp_drv->alt_mode.dp_cap.s_port & BIT(0))
			dp_send_events(dp_drv, EV_USBPD_ENTER_MODE);
		break;
	case USBPD_SVDM_ENTER_MODE:
@@ -2574,6 +2576,7 @@ static void usbpd_response_callback(struct usbpd_svid_handler *hdlr, u8 cmd,

		if (!(dp_drv->alt_mode.current_state & DP_CONFIGURE_DONE)) {
			dp_drv->alt_mode.current_state |= DP_STATUS_DONE;
			if (dp_drv->alt_mode.dp_status.c_port & BIT(1))
				dp_send_events(dp_drv, EV_USBPD_DP_CONFIGURE);
		}
		break;