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

Commit 230fc263 authored by Sandeep Panda's avatar Sandeep Panda Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dsi-staging: handle panel init failure properly



Currently in driver even if panel init command transfer fails,
then driver is still setting panel init flag to true. This
causes subsequent failures and flooding of log when other panel
commands like backlight update, lp mode transition also fails
to transfer. Fix this by properly handling the panel init error.

Change-Id: I66d0e20aface67eb612420636ddfeb1f6a25cb86
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent 92f4c23f
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -3654,10 +3654,14 @@ int dsi_panel_set_lp1(struct dsi_panel *panel)
	}

	mutex_lock(&panel->panel_lock);
	if (!panel->panel_initialized)
		goto exit;

	rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_LP1);
	if (rc)
		pr_err("[%s] failed to send DSI_CMD_SET_LP1 cmd, rc=%d\n",
		       panel->name, rc);
exit:
	mutex_unlock(&panel->panel_lock);
	return rc;
}
@@ -3672,10 +3676,14 @@ int dsi_panel_set_lp2(struct dsi_panel *panel)
	}

	mutex_lock(&panel->panel_lock);
	if (!panel->panel_initialized)
		goto exit;

	rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_LP2);
	if (rc)
		pr_err("[%s] failed to send DSI_CMD_SET_LP2 cmd, rc=%d\n",
		       panel->name, rc);
exit:
	mutex_unlock(&panel->panel_lock);
	return rc;
}
@@ -3690,10 +3698,14 @@ int dsi_panel_set_nolp(struct dsi_panel *panel)
	}

	mutex_lock(&panel->panel_lock);
	if (!panel->panel_initialized)
		goto exit;

	rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_NOLP);
	if (rc)
		pr_err("[%s] failed to send DSI_CMD_SET_NOLP cmd, rc=%d\n",
		       panel->name, rc);
exit:
	mutex_unlock(&panel->panel_lock);
	return rc;
}
@@ -3942,10 +3954,10 @@ int dsi_panel_enable(struct dsi_panel *panel)
	mutex_lock(&panel->panel_lock);

	rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_ON);
	if (rc) {
	if (rc)
		pr_err("[%s] failed to send DSI_CMD_SET_ON cmds, rc=%d\n",
		       panel->name, rc);
	}
	else
		panel->panel_initialized = true;
	mutex_unlock(&panel->panel_lock);
	return rc;