rc = mdss_dsi_reconfig(pdata, mode);
break;
case MDSS_EVENT_DSI_PANEL_STATUS:
- if (ctrl_pdata->check_status)
- rc = ctrl_pdata->check_status(ctrl_pdata);
- else
- rc = true;
+ rc = mdss_dsi_check_panel_status(ctrl_pdata, arg);
break;
case MDSS_EVENT_PANEL_TIMING_SWITCH:
rc = mdss_dsi_panel_timing_switch(ctrl_pdata, arg);
void mdss_dsi_set_reg(struct mdss_dsi_ctrl_pdata *ctrl, int off,
u32 mask, u32 val);
int mdss_dsi_phy_pll_reset_status(struct mdss_dsi_ctrl_pdata *ctrl);
+int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg);
static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
{
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
static int32_t dsi_status_disable = DSI_STATUS_CHECK_INIT;
struct dsi_status_data *pstatus_data;
+int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg)
+{
+ struct mdss_mdp_ctl *ctl = NULL;
+ struct msm_fb_data_type *mfd = arg;
+ int ret = 0;
+
+ if (!mfd)
+ return -EINVAL;
+
+ ctl = mfd_to_ctl(mfd);
+
+ if (!ctl || !ctrl)
+ return -EINVAL;
+
+ mutex_lock(&ctl->offlock);
+ /*
+ * if check_status method is not defined
+ * then no need to fail this function,
+ * instead return a positive value.
+ */
+ if (ctrl->check_status)
+ ret = ctrl->check_status(ctrl);
+ else
+ ret = 1;
+ mutex_unlock(&ctl->offlock);
+
+ return ret;
+}
+
/*
* check_dsi_ctrl_status() - Reads MFD structure and
* calls platform specific DSI ctrl Status function.
ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n", "suspend");
} else {
panel_status = mdss_fb_send_panel_event(mfd,
- MDSS_EVENT_DSI_PANEL_STATUS, NULL);
+ MDSS_EVENT_DSI_PANEL_STATUS, mfd);
ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n",
panel_status > 0 ? "alive" : "dead");
}