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

Commit 9b145944 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: initialize host on configure call



Some sinks set HPD high only after the source host
is initialized. Once the PD communication is completed,
initialize the host on configure call so that such sinks
can set HPD high on cable connection.

Change-Id: Ic1ba6be09e71abf286021533fdb6f4dc68531d35
CRs-Fixed: 2326085
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: default avatarAbhijith Desai <desaia@codeaurora.org>
parent 82feaaa3
Loading
Loading
Loading
Loading
+20 −16
Original line number Diff line number Diff line
@@ -603,10 +603,11 @@ static void dp_display_host_init(struct dp_display_private *dp)
	bool flip = false;
	bool reset;

	if (dp->core_initialized) {
		pr_debug("DP core already initialized\n");
	if (dp->core_initialized)
		return;
	}

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch)
		dp->aux->aux_switch(dp->aux, true, dp->hpd->orientation);

	if (dp->hpd->orientation == ORIENTATION_CC2)
		flip = true;
@@ -618,38 +619,39 @@ static void dp_display_host_init(struct dp_display_private *dp)
	dp->aux->init(dp->aux, dp->parser->aux_cfg);
	enable_irq(dp->irq);
	dp->core_initialized = true;

	/* log this as it results from user action of cable connection */
	pr_info("[OK]\n");
}

static void dp_display_host_deinit(struct dp_display_private *dp)
{
	if (!dp->core_initialized) {
		pr_debug("DP core already off\n");
	if (!dp->core_initialized)
		return;
	}

	if (dp->active_stream_cnt) {
		pr_debug("active stream present\n");
		return;
	}

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch)
		dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE);

	dp->aux->deinit(dp->aux);
	dp->ctrl->deinit(dp->ctrl);
	dp->power->deinit(dp->power);
	disable_irq(dp->irq);
	dp->core_initialized = false;
	dp->aux->state = 0;

	/* log this as it results from user action of cable dis-connection */
	pr_info("[OK]\n");
}

static int dp_display_process_hpd_high(struct dp_display_private *dp)
{
	int rc = 0;

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch) {
		rc = dp->aux->aux_switch(dp->aux, true, dp->hpd->orientation);
		if (rc)
			goto end;
	}

	dp->is_connected = true;

	dp->dp_display.max_pclk_khz = dp->parser->max_pclk_khz;
@@ -765,6 +767,8 @@ static int dp_display_usbpd_configure_cb(struct device *dev)
		goto end;
	}

	dp_display_host_init(dp);

	/* check for hpd high and framework ready */
	if (dp->hpd->hpd_high && dp_display_framework_ready(dp))
		queue_delayed_work(dp->wq, &dp->connect_work, 0);
@@ -858,9 +862,6 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)
	cancel_work(&dp->attention_work);
	flush_workqueue(dp->wq);

	if (!dp->debug->sim_mode && !dp->parser->no_aux_switch)
		dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE);

	dp_display_handle_disconnect(dp);

	/* Reset abort value to allow future connections */
@@ -979,7 +980,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev)
		return -ENODEV;
	}

	DP_MST_DEBUG("mst: hpd_irq:%d, hpd_high:%d, power_on:%d\n",
	pr_debug("hpd_irq:%d, hpd_high:%d, power_on:%d\n",
			dp->hpd->hpd_irq, dp->hpd->hpd_high,
			dp->power_on);

@@ -1562,6 +1563,9 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
	}

	dp->power_on = false;

	/* log this as it results from user action of cable dis-connection */
	pr_info("[OK]\n");
end:
	dp_panel->deinit(dp_panel);
	mutex_unlock(&dp->session_lock);