summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmanabhan Komanduru <pkomandu@codeaurora.org>2017-01-12 18:14:17 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-30 04:27:01 -0800
commit5c575fbbbdcef4b782da14e0a9a0f8967eec75e9 (patch)
treef7bf24610c188d85ae9bd9df87c71f4130669362
parentc9deb68c63e3ca36a71473ed336e03aea07a0c99 (diff)
msm: mdss: add support to set the parent of DP pixel clock RCG
DP pixel RCG clock has multiple parents as per the clock plan and doesn't have a fixed frequency table defined in the common clock driver. For targets which use common clock framework like SDM660, the parent of such RCGs need to be set by the client itself. Add support to set the parent of DP pixel RCG clock. Change-Id: I00ec66725ab40de28db84593c111d402a7bd7ac8 Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dp.c21
-rw-r--r--drivers/video/fbdev/msm/mdss_dp.h4
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dp.c b/drivers/video/fbdev/msm/mdss_dp.c
index c932384ebad0..2199f923260f 100644
--- a/drivers/video/fbdev/msm/mdss_dp.c
+++ b/drivers/video/fbdev/msm/mdss_dp.c
@@ -338,7 +338,25 @@ static int mdss_dp_clk_init(struct mdss_dp_drv_pdata *dp_drv,
goto ctrl_get_error;
}
+ dp_drv->pixel_clk_rcg = devm_clk_get(dev, "pixel_clk_rcg");
+ if (IS_ERR(dp_drv->pixel_clk_rcg)) {
+ pr_debug("%s: Unable to get DP pixel clk RCG\n",
+ __func__);
+ dp_drv->pixel_clk_rcg = NULL;
+ }
+
+ dp_drv->pixel_parent = devm_clk_get(dev,
+ "pixel_parent");
+ if (IS_ERR(dp_drv->pixel_parent)) {
+ pr_debug("%s: Unable to get DP pixel RCG parent\n",
+ __func__);
+ dp_drv->pixel_parent = NULL;
+ }
} else {
+ if (dp_drv->pixel_parent)
+ devm_clk_put(dev, dp_drv->pixel_parent);
+ if (dp_drv->pixel_clk_rcg)
+ devm_clk_put(dev, dp_drv->pixel_clk_rcg);
msm_dss_put_clk(ctrl_power_data->clk_config,
ctrl_power_data->num_clk);
msm_dss_put_clk(core_power_data->clk_config,
@@ -1258,6 +1276,9 @@ static int mdss_dp_enable_mainlink_clocks(struct mdss_dp_drv_pdata *dp)
{
int ret = 0;
+ if (dp->pixel_clk_rcg && dp->pixel_parent)
+ clk_set_parent(dp->pixel_clk_rcg, dp->pixel_parent);
+
mdss_dp_set_clock_rate(dp, "ctrl_link_clk",
(dp->link_rate * DP_LINK_RATE_MULTIPLIER) / DP_KHZ_TO_HZ);
diff --git a/drivers/video/fbdev/msm/mdss_dp.h b/drivers/video/fbdev/msm/mdss_dp.h
index 0ff2522a2195..d6f5d160aef2 100644
--- a/drivers/video/fbdev/msm/mdss_dp.h
+++ b/drivers/video/fbdev/msm/mdss_dp.h
@@ -489,6 +489,10 @@ struct mdss_dp_drv_pdata {
struct edp_edid edid;
struct dpcd_cap dpcd;
+ /* DP Pixel clock RCG and PLL parent */
+ struct clk *pixel_clk_rcg;
+ struct clk *pixel_parent;
+
/* regulators */
struct dss_module_power power_data[DP_MAX_PM];
struct dp_pinctrl_res pin_res;