diff --git a/drivers/video/fbdev/msm/mdss_dsi_phy.h b/drivers/video/fbdev/msm/mdss_dsi_phy.h index 5fff3123b63f..03df17d81f69 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_phy.h +++ b/drivers/video/fbdev/msm/mdss_dsi_phy.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-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 @@ -115,4 +115,13 @@ int mdss_dsi_phy_v3_wait_for_lanes_stop_state(struct mdss_dsi_ctrl_pdata *ctrl, * assumes that the link and core clocks are already on. */ int mdss_dsi_phy_v3_ulps_config(struct mdss_dsi_ctrl_pdata *ctrl, bool enable); + +/** + * mdss_dsi_phy_v3_idle_pc_exit() - Called after Idle Power Collapse exit + * @ctrl: pointer to DSI controller structure + * + * This function is called after Idle Power Collapse, so driver + * can perform any sequence required after the Idle PC exit. + */ +void mdss_dsi_phy_v3_idle_pc_exit(struct mdss_dsi_ctrl_pdata *ctrl); #endif /* MDSS_DSI_PHY_H */ diff --git a/drivers/video/fbdev/msm/mdss_dsi_phy_v3.c b/drivers/video/fbdev/msm/mdss_dsi_phy_v3.c index 992fd51606ca..bb9dbfa32e4e 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_phy_v3.c +++ b/drivers/video/fbdev/msm/mdss_dsi_phy_v3.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-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 @@ -327,6 +327,7 @@ int mdss_dsi_phy_v3_ulps_config(struct mdss_dsi_ctrl_pdata *ctrl, bool enable) */ DSI_PHY_W32(ctrl->phy_io.base, CMN_DSI_LANE_CTRL3, active_lanes); + usleep_range(5, 15); DSI_PHY_W32(ctrl->phy_io.base, CMN_DSI_LANE_CTRL3, 0); @@ -340,6 +341,20 @@ error: return rc; } +void mdss_dsi_phy_v3_idle_pc_exit(struct mdss_dsi_ctrl_pdata *ctrl) +{ + u32 val = BIT(5); + u32 data; + + /* Reset phy pll after idle pc exit */ + data = DSI_PHY_R32(ctrl->phy_io.base, CMN_CTRL_1); + DSI_PHY_W32(ctrl->phy_io.base, CMN_CTRL_1, data | val); + usleep_range(10, 15); + + data = DSI_PHY_R32(ctrl->phy_io.base, CMN_CTRL_1); + data &= ~(BIT(5)); + DSI_PHY_W32(ctrl->phy_io.base, CMN_CTRL_1, data); +} int mdss_dsi_phy_v3_shutdown(struct mdss_dsi_ctrl_pdata *ctrl) { diff --git a/drivers/video/fbdev/msm/msm_mdss_io_8974.c b/drivers/video/fbdev/msm/msm_mdss_io_8974.c index c81d45b57f8d..690d74fa5271 100644 --- a/drivers/video/fbdev/msm/msm_mdss_io_8974.c +++ b/drivers/video/fbdev/msm/msm_mdss_io_8974.c @@ -2136,6 +2136,20 @@ error: return ret; } +/** + * mdss_dsi_phy_idle_pc_exit() - Called after exit Idle PC + * @ctrl: pointer to DSI controller structure + * + * Perform any programming needed after Idle PC exit. + */ +static int mdss_dsi_phy_idle_pc_exit(struct mdss_dsi_ctrl_pdata *ctrl) +{ + if (ctrl->shared_data->phy_rev == DSI_PHY_REV_30) + mdss_dsi_phy_v3_idle_pc_exit(ctrl); + + return 0; +} + /** * mdss_dsi_clamp_ctrl_default() - Program DSI clamps * @ctrl: pointer to DSI controller structure @@ -2700,5 +2714,10 @@ int mdss_dsi_pre_clkon_cb(void *priv, } } + if ((clk_type & MDSS_DSI_LINK_CLK) && + (new_state == MDSS_DSI_CLK_ON) && + !ctrl->panel_data.panel_info.cont_splash_enabled) + mdss_dsi_phy_idle_pc_exit(ctrl); + return rc; }