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

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

Merge "drm/msm/dsi-staging: avoid ESD failure during first kickoff"

parents 0f0bb13f 3c22344d
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -401,6 +401,21 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl,
	return rc;
}

bool dsi_ctrl_validate_host_state(struct dsi_ctrl *dsi_ctrl)
{
	struct dsi_ctrl_state_info *state = &dsi_ctrl->current_state;

	if (!state) {
		pr_err("Invalid host state for DSI controller\n");
		return -EINVAL;
	}

	if (!state->host_initialized)
		return true;

	return false;
}

static void dsi_ctrl_update_state(struct dsi_ctrl *dsi_ctrl,
				  enum dsi_ctrl_driver_ops op,
				  u32 op_state)
+10 −0
Original line number Diff line number Diff line
@@ -548,6 +548,16 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl,
int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl,
				  enum dsi_engine_state state);

/**
 * dsi_ctrl_validate_host_state() - validate DSI ctrl host state
 * @dsi_ctrl:            DSI Controller handle.
 *
 * Validate DSI cotroller host state
 *
 * Return: boolean indicating whether host is not initalized.
 */
bool dsi_ctrl_validate_host_state(struct dsi_ctrl *dsi_ctrl);

/**
 * dsi_ctrl_set_vid_engine_state() - set video engine state
 * @dsi_ctrl:            DSI Controller handle.
+9 −1
Original line number Diff line number Diff line
@@ -429,9 +429,17 @@ static int dsi_display_read_status(struct dsi_display_ctrl *ctrl,
	struct dsi_cmd_desc *cmds;
	u32 flags = 0;

	if (!panel)
	if (!panel || !ctrl || !ctrl->ctrl)
		return -EINVAL;

	/*
	 * When DSI controller is not in initialized state, we do not want to
	 * report a false ESD failure and hence we defer until next read
	 * happen.
	 */
	if (dsi_ctrl_validate_host_state(ctrl->ctrl))
		return 1;

	/* acquire panel_lock to make sure no commands are in progress */
	dsi_panel_acquire_panel_lock(panel);