summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAravind Venkateswaran <aravindh@codeaurora.org>2014-08-14 13:54:44 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:33:14 -0700
commit86660ffa87e6fb20878b152646b3967bdec13d65 (patch)
treee8528210abccd01c4baa47257e34dcb8036490e9
parent9fbb70c820c785d8cb88eddd57227c426cb6e177 (diff)
msm: mdss: fix DSI clock handling for split display configuration
In split display mode, the clocks for both the DSI controllers are sourced out of a single PLL (typically the left controller). In the current implementation, the clocks are independently controlled whenever the broadcast mode is not enabled. However, it is possible that if the clocks for right controller alone are turned on, the left controller's phy could already be clamped, leading to that PLL not getting locked. Fix this issue by ensuring that the clocks for the master controller (left controller) are always turned on whenever the clocks for the right controller (or the slave controller) are turned on. Change-Id: I941865feef44951efe6c55e632938db79e5596ad Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.h28
-rw-r--r--drivers/video/fbdev/msm/msm_mdss_io_8974.c16
2 files changed, 42 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h
index 0061a2cc1ae9..9ac4bb5808b6 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.h
+++ b/drivers/video/fbdev/msm/mdss_dsi.h
@@ -256,6 +256,8 @@ enum {
#define DSI_CTRL_LEFT DSI_CTRL_0
#define DSI_CTRL_RIGHT DSI_CTRL_1
+#define DSI_CTRL_CLK_SLAVE DSI_CTRL_RIGHT
+#define DSI_CTRL_CLK_MASTER DSI_CTRL_LEFT
#define DSI_BUS_CLKS BIT(0)
#define DSI_LINK_CLKS BIT(1)
@@ -454,6 +456,16 @@ static inline const char *__mdss_dsi_pm_supply_node_name(
}
}
+static inline bool mdss_dsi_split_display_enabled(void)
+{
+ /*
+ * currently the only supported mode is split display.
+ * So, if both controllers are initialized, then assume that
+ * split display mode is enabled.
+ */
+ return ctrl_list[DSI_CTRL_LEFT] && ctrl_list[DSI_CTRL_RIGHT];
+}
+
static inline bool mdss_dsi_sync_wait_enable(struct mdss_dsi_ctrl_pdata *ctrl)
{
return ctrl->cmd_sync_wait_broadcast;
@@ -492,6 +504,22 @@ static inline struct mdss_dsi_ctrl_pdata *mdss_dsi_get_ctrl_by_index(int ndx)
return ctrl_list[ndx];
}
+static inline bool mdss_dsi_is_ctrl_clk_slave(struct mdss_dsi_ctrl_pdata *ctrl)
+{
+ return mdss_dsi_split_display_enabled() &&
+ (ctrl->ndx == DSI_CTRL_CLK_SLAVE);
+}
+
+static inline struct mdss_dsi_ctrl_pdata *mdss_dsi_get_ctrl_clk_master(void)
+{
+ return ctrl_list[DSI_CTRL_CLK_MASTER];
+}
+
+static inline struct mdss_dsi_ctrl_pdata *mdss_dsi_get_ctrl_clk_slave(void)
+{
+ return ctrl_list[DSI_CTRL_CLK_SLAVE];
+}
+
static inline bool mdss_dsi_is_panel_off(struct mdss_panel_data *pdata)
{
return mdss_panel_is_power_off(pdata->panel_info.panel_power_state);
diff --git a/drivers/video/fbdev/msm/msm_mdss_io_8974.c b/drivers/video/fbdev/msm/msm_mdss_io_8974.c
index 37667801a29d..979666b6951b 100644
--- a/drivers/video/fbdev/msm/msm_mdss_io_8974.c
+++ b/drivers/video/fbdev/msm/msm_mdss_io_8974.c
@@ -1305,12 +1305,24 @@ int mdss_dsi_clk_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
/*
* In sync_wait_broadcast mode, we need to enable clocks
* for the other controller as well when enabling clocks
- * for the trigger controller
+ * for the trigger controller.
+ *
+ * If sync wait_broadcase mode is not enabled, but if split display
+ * mode is enabled where both DSI controller's branch clocks are
+ * sourced out of a single PLL, then we need to ensure that the
+ * controller associated with that PLL also has it's clocks turned
+ * on. This is required to make sure that if that controller's PLL/PHY
+ * are clamped then they can be removed.
*/
if (mdss_dsi_sync_wait_trigger(ctrl)) {
mctrl = mdss_dsi_get_other_ctrl(ctrl);
if (!mctrl)
- pr_warn("%s: Unable to get left control\n", __func__);
+ pr_warn("%s: Unable to get other control\n", __func__);
+ } else if (mdss_dsi_is_ctrl_clk_slave(ctrl)) {
+ mctrl = mdss_dsi_get_ctrl_clk_master();
+ if (!mctrl)
+ pr_warn("%s: Unable to get clk master control\n",
+ __func__);
}
pr_debug("%s++: ndx=%d clk_type=%d bus_clk_cnt=%d link_clk_cnt=%d\n",