mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
disp: msm: Report panel's probe status
Panel API need to report probe status in order for consumer to determine panel's presence Port from : 75d097728 Change-Id: I8252c0e0865780e0b0dbe5252dc663981fc16ba3 Signed-off-by: Bang Nguyen <bangnguyen@motorola.com> Reviewed-on: https://gerrit.mot.com/1697408 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
89c4956f4c
commit
5cdb58b738
1 changed files with 37 additions and 7 deletions
|
|
@ -50,6 +50,8 @@ static const struct of_device_id dsi_display_dt_match[] = {
|
|||
{}
|
||||
};
|
||||
|
||||
static void dsi_display_is_probed(int enable_idx, int probe_status);
|
||||
|
||||
bool is_skip_op_required(struct dsi_display *display)
|
||||
{
|
||||
if (!display)
|
||||
|
|
@ -6294,6 +6296,7 @@ int dsi_display_dev_probe(struct platform_device *pdev)
|
|||
int rc = 0, index = DSI_PRIMARY;
|
||||
bool firm_req = false;
|
||||
struct dsi_display_boot_param *boot_disp;
|
||||
int enable_idx;
|
||||
|
||||
if (!pdev || !pdev->dev.of_node) {
|
||||
DSI_ERR("pdev not found\n");
|
||||
|
|
@ -6332,11 +6335,15 @@ int dsi_display_dev_probe(struct platform_device *pdev)
|
|||
|
||||
display->display_type = of_get_property(pdev->dev.of_node,
|
||||
"label", NULL);
|
||||
if (!display->display_type)
|
||||
if (!display->display_type) {
|
||||
display->display_type = "primary";
|
||||
enable_idx = 0;
|
||||
}
|
||||
|
||||
if (!strcmp(display->display_type, "secondary"))
|
||||
if (!strcmp(display->display_type, "secondary")) {
|
||||
index = DSI_SECONDARY;
|
||||
enable_idx = 1;
|
||||
}
|
||||
|
||||
boot_disp = &boot_displays[index];
|
||||
node = pdev->dev.of_node;
|
||||
|
|
@ -6385,6 +6392,8 @@ int dsi_display_dev_probe(struct platform_device *pdev)
|
|||
rc = dsi_display_init(display);
|
||||
if (rc)
|
||||
goto end;
|
||||
else
|
||||
dsi_display_is_probed(enable_idx, rc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -8595,10 +8604,25 @@ static void dsi_display_panel_id_notification(struct dsi_display *display)
|
|||
/* start of MMI_STOPSHIP section */
|
||||
struct dsi_enable_status {
|
||||
struct dsi_display *display;
|
||||
int probed;
|
||||
bool enable;
|
||||
};
|
||||
|
||||
static struct dsi_enable_status enable_status[2];
|
||||
static struct dsi_enable_status enable_status[2] = {
|
||||
{
|
||||
.probed = -ENODEV,
|
||||
},
|
||||
{
|
||||
.probed = -ENODEV,
|
||||
},
|
||||
};
|
||||
|
||||
static void dsi_display_is_probed (int enable_idx, int probe_status)
|
||||
{
|
||||
enable_status[enable_idx].probed = probe_status;
|
||||
pr_debug("display->drm_conn[%d] probe set =%d\n",
|
||||
enable_idx, probe_status);
|
||||
}
|
||||
|
||||
static int dsi_display_enable_status (struct dsi_display *display, bool enable)
|
||||
{
|
||||
|
|
@ -8610,12 +8634,12 @@ static int dsi_display_enable_status (struct dsi_display *display, bool enable)
|
|||
enable_status[0].display = display;
|
||||
enable_status[0].enable = enable;
|
||||
} else if (!strncmp("DSI-2", display->drm_conn->name, 5)) {
|
||||
DSI_DEBUG("display->drm_conn->name=%s enable = %d CLI_DISPLAY\n",
|
||||
DSI_DEBUG("display->drm_conn->name=%s enable = %d CLI_DISPLAY\n",
|
||||
display->drm_conn->name, enable);
|
||||
enable_status[1].display = display;
|
||||
enable_status[1].enable = enable;
|
||||
} else {
|
||||
DSI_ERR(" Invalid display->drm_conn->name = %s\n",
|
||||
DSI_ERR("display->drm_conn: invalid name =%s\n",
|
||||
display->drm_conn->name);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
|
@ -8623,16 +8647,22 @@ static int dsi_display_enable_status (struct dsi_display *display, bool enable)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool dsi_display_is_panel_enable (int panel_index)
|
||||
bool dsi_display_is_panel_enable (int panel_index, int *probe_status)
|
||||
{
|
||||
struct dsi_display *display;
|
||||
bool enable = false;
|
||||
|
||||
if (panel_index > 1) {
|
||||
pr_err("Invalid panel index =%d\n", panel_index);
|
||||
pr_err("display->drm_conn: invalid panel index =%d\n",
|
||||
panel_index);
|
||||
if (probe_status)
|
||||
*probe_status = -ENODEV;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (probe_status)
|
||||
*probe_status = enable_status[panel_index].probed;
|
||||
|
||||
display = enable_status[panel_index].display;
|
||||
if (display) {
|
||||
mutex_lock(&display->display_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue