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

Commit 53aaf612 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/dp: Add flag to notify peer_usb_comm support to dp"

parents 1cb2af0c 691da06c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1085,6 +1085,8 @@ static void dp_catalog_ctrl_usb_reset(struct dp_catalog_ctrl *ctrl, bool flip)


	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_RESET_OVRD_CTRL, 0x0a);
	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_RESET_OVRD_CTRL, 0x0a);
	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_PHY_MODE_CTRL, 0x02);
	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_PHY_MODE_CTRL, 0x02);
	pr_debug("Program PHYMODE to DP only\n");

	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_SW_RESET, 0x01);
	dp_write(catalog->exe_mode, io_data, USB3_DP_COM_SW_RESET, 0x01);
	/* make sure usb3 com phy software reset is done */
	/* make sure usb3 com phy software reset is done */
	wmb();
	wmb();
+2 −1
Original line number Original line Diff line number Diff line
@@ -731,7 +731,8 @@ static void dp_display_host_init(struct dp_display_private *dp)
	if (dp->hpd->orientation == ORIENTATION_CC2)
	if (dp->hpd->orientation == ORIENTATION_CC2)
		flip = true;
		flip = true;


	reset = dp->debug->sim_mode ? false : !dp->hpd->multi_func;
	reset = dp->debug->sim_mode ? false :
		(!dp->hpd->multi_func || !dp->hpd->peer_usb_comm);


	dp->power->init(dp->power, flip);
	dp->power->init(dp->power, flip);
	dp->hpd->host_init(dp->hpd, &dp->catalog->hpd);
	dp->hpd->host_init(dp->hpd, &dp->catalog->hpd);
+1 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,7 @@ struct dp_hpd {
	bool hpd_irq;
	bool hpd_irq;
	bool alt_mode_cfg_done;
	bool alt_mode_cfg_done;
	bool multi_func;
	bool multi_func;
	bool peer_usb_comm;


	void (*isr)(struct dp_hpd *dp_hpd);
	void (*isr)(struct dp_hpd *dp_hpd);
	int (*register_hpd)(struct dp_hpd *dp_hpd);
	int (*register_hpd)(struct dp_hpd *dp_hpd);
+4 −2
Original line number Original line Diff line number Diff line
@@ -244,7 +244,8 @@ static void dp_usbpd_send_event(struct dp_usbpd_private *pd,
	}
	}
}
}


static void dp_usbpd_connect_cb(struct usbpd_svid_handler *hdlr)
static void dp_usbpd_connect_cb(struct usbpd_svid_handler *hdlr,
		bool peer_usb_comm)
{
{
	struct dp_usbpd_private *pd;
	struct dp_usbpd_private *pd;


@@ -254,7 +255,8 @@ static void dp_usbpd_connect_cb(struct usbpd_svid_handler *hdlr)
		return;
		return;
	}
	}


	pr_debug("\n");
	pr_debug("peer_usb_comm: %d\n", peer_usb_comm);
	pd->dp_usbpd.base.peer_usb_comm = peer_usb_comm;
	dp_usbpd_send_event(pd, DP_USBPD_EVT_DISCOVER);
	dp_usbpd_send_event(pd, DP_USBPD_EVT_DISCOVER);
}
}


+9 −2
Original line number Original line Diff line number Diff line
@@ -1276,6 +1276,8 @@ static void reset_vdm_state(struct usbpd *pd)
	mutex_lock(&pd->svid_handler_lock);
	mutex_lock(&pd->svid_handler_lock);
	list_for_each_entry(handler, &pd->svid_handlers, entry) {
	list_for_each_entry(handler, &pd->svid_handlers, entry) {
		if (handler->discovered) {
		if (handler->discovered) {
			usbpd_dbg(&pd->dev, "Notify SVID: 0x%04x disconnect\n",
				handler->svid);
			handler->disconnect(handler);
			handler->disconnect(handler);
			handler->discovered = false;
			handler->discovered = false;
		}
		}
@@ -1783,7 +1785,9 @@ int usbpd_register_svid(struct usbpd *pd, struct usbpd_svid_handler *hdlr)


		for (i = 0; i < pd->num_svids; i++) {
		for (i = 0; i < pd->num_svids; i++) {
			if (pd->discovered_svids[i] == hdlr->svid) {
			if (pd->discovered_svids[i] == hdlr->svid) {
				hdlr->connect(hdlr);
				usbpd_dbg(&pd->dev, "Notify SVID: 0x%04x connect\n",
						hdlr->svid);
				hdlr->connect(hdlr, pd->peer_usb_comm);
				hdlr->discovered = true;
				hdlr->discovered = true;
				break;
				break;
			}
			}
@@ -2070,7 +2074,10 @@ static void handle_vdm_rx(struct usbpd *pd, struct rx_msg *rx_msg)
				if (svid) {
				if (svid) {
					handler = find_svid_handler(pd, svid);
					handler = find_svid_handler(pd, svid);
					if (handler) {
					if (handler) {
						handler->connect(handler);
						usbpd_dbg(&pd->dev, "Notify SVID: 0x%04x connect\n",
							handler->svid);
						handler->connect(handler,
							pd->peer_usb_comm);
						handler->discovered = true;
						handler->discovered = true;
					}
					}
				}
				}
Loading