drm/msm/mdp4: add mdp axi clk
authorRob Clark <robdclark@gmail.com>
Mon, 30 Jun 2014 22:50:51 +0000 (18:50 -0400)
committerRob Clark <robdclark@gmail.com>
Mon, 4 Aug 2014 15:55:28 +0000 (11:55 -0400)
Downstream kernel holds this clk via a fake-parent relationship.
Upstream clock framework requires that we hold it explicitly.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.h

index 5a7bfd452252e5e76ef91446d4f814141fd6ab21..4a08655b2bfcda4a3e86dc55d79f7ee6ac8816f7 100644 (file)
@@ -176,6 +176,8 @@ int mdp4_disable(struct mdp4_kms *mdp4_kms)
        if (mdp4_kms->pclk)
                clk_disable_unprepare(mdp4_kms->pclk);
        clk_disable_unprepare(mdp4_kms->lut_clk);
+       if (mdp4_kms->axi_clk)
+               clk_disable_unprepare(mdp4_kms->axi_clk);
 
        return 0;
 }
@@ -188,6 +190,8 @@ int mdp4_enable(struct mdp4_kms *mdp4_kms)
        if (mdp4_kms->pclk)
                clk_prepare_enable(mdp4_kms->pclk);
        clk_prepare_enable(mdp4_kms->lut_clk);
+       if (mdp4_kms->axi_clk)
+               clk_prepare_enable(mdp4_kms->axi_clk);
 
        return 0;
 }
@@ -335,6 +339,13 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
                goto fail;
        }
 
+       mdp4_kms->axi_clk = devm_clk_get(&pdev->dev, "mdp_axi_clk");
+       if (IS_ERR(mdp4_kms->axi_clk)) {
+               dev_err(dev->dev, "failed to get axi_clk\n");
+               ret = PTR_ERR(mdp4_kms->axi_clk);
+               goto fail;
+       }
+
        clk_set_rate(mdp4_kms->clk, config->max_clk);
        clk_set_rate(mdp4_kms->lut_clk, config->max_clk);
 
index 715520c54cdec48f93750da0843213878aaabf86..3225da804c613f4f9fce06960862bb6bb345b406 100644 (file)
@@ -42,6 +42,7 @@ struct mdp4_kms {
        struct clk *clk;
        struct clk *pclk;
        struct clk *lut_clk;
+       struct clk *axi_clk;
 
        struct mdp_irq error_handler;