diff --git a/drivers/video/msm/mdss/mdss_dsi.c b/drivers/video/msm/mdss/mdss_dsi.c index 77e4e5cccfd5..9b3a966d3dce 100644 --- a/drivers/video/msm/mdss/mdss_dsi.c +++ b/drivers/video/msm/mdss/mdss_dsi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "mdss.h" #include "mdss_panel.h" @@ -36,6 +37,30 @@ /* Master structure to hold all the information about the DSI/panel */ static struct mdss_dsi_data *mdss_dsi_res; +#define DSI_DISABLE_PC_LATENCY 100 +#define DSI_ENABLE_PC_LATENCY PM_QOS_DEFAULT_VALUE + +static struct pm_qos_request mdss_dsi_pm_qos_request; + +static void mdss_dsi_pm_qos_add_request(void) +{ + pr_debug("%s: add request", __func__); + pm_qos_add_request(&mdss_dsi_pm_qos_request, PM_QOS_CPU_DMA_LATENCY, + PM_QOS_DEFAULT_VALUE); +} + +static void mdss_dsi_pm_qos_remove_request(void) +{ + pr_debug("%s: remove request", __func__); + pm_qos_remove_request(&mdss_dsi_pm_qos_request); +} + +static void mdss_dsi_pm_qos_update_request(int val) +{ + pr_debug("%s: update request %d", __func__, val); + pm_qos_update_request(&mdss_dsi_pm_qos_request, val); +} + static int mdss_dsi_pinctrl_set_state(struct mdss_dsi_ctrl_pdata *ctrl_pdata, bool active); @@ -1342,6 +1367,8 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata) pr_debug("%s+: ctrl=%p ndx=%d cur_blank_state=%d\n", __func__, ctrl_pdata, ctrl_pdata->ndx, pdata->panel_info.blank_state); + mdss_dsi_pm_qos_update_request(DSI_DISABLE_PC_LATENCY); + mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 1); if (pdata->panel_info.blank_state == MDSS_PANEL_BLANK_LOW_POWER) { @@ -1372,6 +1399,9 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata) error: mdss_dsi_clk_ctrl(ctrl_pdata, DSI_ALL_CLKS, 0); + + mdss_dsi_pm_qos_update_request(DSI_ENABLE_PC_LATENCY); + pr_debug("%s-:\n", __func__); return ret; @@ -2329,6 +2359,8 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&ctrl_pdata->dba_work, mdss_dsi_dba_work); + mdss_dsi_pm_qos_add_request(); + pr_debug("%s: Dsi Ctrl->%d initialized\n", __func__, index); return 0; @@ -2695,6 +2727,8 @@ static int mdss_dsi_ctrl_remove(struct platform_device *pdev) return -ENODEV; } + mdss_dsi_pm_qos_remove_request(); + if (msm_dss_config_vreg(&pdev->dev, ctrl_pdata->panel_power_data.vreg_config, ctrl_pdata->panel_power_data.num_vreg, 1) < 0)