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

Commit 25f64653 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: hdmi: update power module state during probe"

parents ce5de2e2 ba4bf05d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1140,6 +1140,9 @@ static int mdss_fb_probe(struct platform_device *pdev)
	if (rc)
		return rc;

	mdss_fb_create_sysfs(mfd);
	mdss_fb_send_panel_event(mfd, MDSS_EVENT_FB_REGISTERED, fbi);

	if (mfd->mdp.init_fnc) {
		rc = mfd->mdp.init_fnc(mfd);
		if (rc) {
@@ -1165,9 +1168,6 @@ static int mdss_fb_probe(struct platform_device *pdev)

	mdss_fb_init_panel_modes(mfd, pdata);

	mdss_fb_create_sysfs(mfd);
	mdss_fb_send_panel_event(mfd, MDSS_EVENT_FB_REGISTERED, fbi);

	mfd->mdp_sync_pt_data.fence_name = "mdp-fence";
	if (mfd->mdp_sync_pt_data.timeline == NULL) {
		char timeline_name[16];
+69 −13
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#define DRV_NAME "hdmi-tx"
#define COMPATIBLE_NAME "qcom,hdmi-tx"

#define HDMI_TX_EVT_STR(x) #x
#define DEFAULT_VIDEO_RESOLUTION HDMI_VFRMT_640x480p60_4_3
#define DEFAULT_HDMI_PRIMARY_RESOLUTION HDMI_VFRMT_1920x1080p60_16_9

@@ -2900,13 +2901,13 @@ static int hdmi_tx_enable_power(struct hdmi_tx_ctrl *hdmi_ctrl,
		goto error;
	}

	if (enable && !hdmi_ctrl->power_data_enable[module]) {
	if (hdmi_ctrl->panel_data.panel_info.cont_splash_enabled) {
			DEV_DBG("%s: %s already eanbled by splash\n",
		DEV_DBG("%s: %s enabled by splash.\n",
				__func__, hdmi_pm_name(module));
		return 0;
	}

	if (enable && !hdmi_ctrl->power_data_enable[module]) {
		rc = msm_dss_enable_vreg(power_data->vreg_config,
			power_data->num_vreg, 1);
		if (rc) {
@@ -3560,6 +3561,12 @@ static int hdmi_tx_power_on(struct mdss_panel_data *panel_data)
		panel_info->xres, panel_info->yres,
		panel_info->cont_splash_enabled ? " (handoff underway)" : "");

	rc = hdmi_tx_core_on(hdmi_ctrl);
	if (rc) {
		DEV_ERR("%s: hdmi_msm_core_on failed\n", __func__);
		goto end;
	}

	if (hdmi_ctrl->pdata.cont_splash_enabled) {
		hdmi_ctrl->pdata.cont_splash_enabled = false;
		panel_data->panel_info.cont_splash_enabled = false;
@@ -3573,15 +3580,13 @@ static int hdmi_tx_power_on(struct mdss_panel_data *panel_data)
			if (!hdmi_tx_is_hdcp_enabled(hdmi_ctrl))
				hdmi_tx_set_audio_switch_node(hdmi_ctrl, 1);

			goto end;
		}
	}
			if (hdmi_tx_setup_scrambler(hdmi_ctrl))
				DEV_WARN("%s: Scrambler setup failed\n",
						__func__);

	rc = hdmi_tx_core_on(hdmi_ctrl);
	if (rc) {
		DEV_ERR("%s: hdmi_msm_core_on failed\n", __func__);
			goto end;
		}
	}

	rc = hdmi_tx_start(hdmi_ctrl);
	if (rc) {
@@ -4035,6 +4040,54 @@ static int hdmi_tx_hdcp_off(struct hdmi_tx_ctrl *hdmi_ctrl)
	return rc;
}

static char *hdmi_tx_get_event_name(int event)
{
	switch (event) {
	case MDSS_EVENT_RESET:
		return HDMI_TX_EVT_STR(MDSS_EVENT_RESET);
	case MDSS_EVENT_LINK_READY:
		return HDMI_TX_EVT_STR(MDSS_EVENT_LINK_READY);
	case MDSS_EVENT_UNBLANK:
		return HDMI_TX_EVT_STR(MDSS_EVENT_UNBLANK);
	case MDSS_EVENT_PANEL_ON:
		return HDMI_TX_EVT_STR(MDSS_EVENT_PANEL_ON);
	case MDSS_EVENT_BLANK:
		return HDMI_TX_EVT_STR(MDSS_EVENT_BLANK);
	case MDSS_EVENT_PANEL_OFF:
		return HDMI_TX_EVT_STR(MDSS_EVENT_PANEL_OFF);
	case MDSS_EVENT_CLOSE:
		return HDMI_TX_EVT_STR(MDSS_EVENT_CLOSE);
	case MDSS_EVENT_SUSPEND:
		return HDMI_TX_EVT_STR(MDSS_EVENT_SUSPEND);
	case MDSS_EVENT_RESUME:
		return HDMI_TX_EVT_STR(MDSS_EVENT_RESUME);
	case MDSS_EVENT_CHECK_PARAMS:
		return HDMI_TX_EVT_STR(MDSS_EVENT_CHECK_PARAMS);
	case MDSS_EVENT_CONT_SPLASH_BEGIN:
		return HDMI_TX_EVT_STR(MDSS_EVENT_CONT_SPLASH_BEGIN);
	case MDSS_EVENT_CONT_SPLASH_FINISH:
		return HDMI_TX_EVT_STR(MDSS_EVENT_CONT_SPLASH_FINISH);
	case MDSS_EVENT_PANEL_UPDATE_FPS:
		return HDMI_TX_EVT_STR(MDSS_EVENT_PANEL_UPDATE_FPS);
	case MDSS_EVENT_FB_REGISTERED:
		return HDMI_TX_EVT_STR(MDSS_EVENT_FB_REGISTERED);
	case MDSS_EVENT_PANEL_CLK_CTRL:
		return HDMI_TX_EVT_STR(MDSS_EVENT_PANEL_CLK_CTRL);
	case MDSS_EVENT_DSI_CMDLIST_KOFF:
		return HDMI_TX_EVT_STR(MDSS_EVENT_DSI_CMDLIST_KOFF);
	case MDSS_EVENT_ENABLE_PARTIAL_ROI:
		return HDMI_TX_EVT_STR(MDSS_EVENT_ENABLE_PARTIAL_ROI);
	case MDSS_EVENT_DSI_STREAM_SIZE:
		return HDMI_TX_EVT_STR(MDSS_EVENT_DSI_STREAM_SIZE);
	case MDSS_EVENT_DSI_DYNAMIC_SWITCH:
		return HDMI_TX_EVT_STR(MDSS_EVENT_DSI_DYNAMIC_SWITCH);
	case MDSS_EVENT_REGISTER_RECOVERY_HANDLER:
		return HDMI_TX_EVT_STR(MDSS_EVENT_REGISTER_RECOVERY_HANDLER);
	default:
		return "unknown";
	}
}

static int hdmi_tx_panel_event_handler(struct mdss_panel_data *panel_data,
	int event, void *arg)
{
@@ -4049,8 +4102,9 @@ static int hdmi_tx_panel_event_handler(struct mdss_panel_data *panel_data,

	mutex_lock(&hdmi_ctrl->tx_lock);

	DEV_DBG("%s: event = %d suspend=%d, hpd_feature=%d\n", __func__,
		event, hdmi_ctrl->panel_suspend, hdmi_ctrl->hpd_feature_on);
	DEV_DBG("%s: event = %s suspend=%d, hpd_feature=%d\n", __func__,
		hdmi_tx_get_event_name(event), hdmi_ctrl->panel_suspend,
		hdmi_ctrl->hpd_feature_on);

	switch (event) {
	case MDSS_EVENT_FB_REGISTERED:
@@ -4955,6 +5009,8 @@ static int hdmi_tx_probe(struct platform_device *pdev)
			msm_dss_enable_clk(
				hdmi_ctrl->pdata.power_data[i].clk_config,
				hdmi_ctrl->pdata.power_data[i].num_clk, 1);

			hdmi_ctrl->power_data_enable[i] = true;
		}
	}