From: yxj Date: Thu, 17 Apr 2014 06:16:30 +0000 (+0800) Subject: rk32 edp:add power domain support X-Git-Tag: firefly_0821_release~5533 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e2c551b8397b177819f477558b49da77524c1ee3;p=firefly-linux-kernel-4.4.55.git rk32 edp:add power domain support --- diff --git a/drivers/video/rockchip/transmitter/rk32_dp.c b/drivers/video/rockchip/transmitter/rk32_dp.c index 8de29482f241..86b596bc1607 100644 --- a/drivers/video/rockchip/transmitter/rk32_dp.c +++ b/drivers/video/rockchip/transmitter/rk32_dp.c @@ -44,6 +44,7 @@ static struct rk32_edp *rk32_edp; static int rk32_edp_clk_enable(struct rk32_edp *edp) { if (!edp->clk_on) { + clk_enable(edp->pd); clk_enable(edp->pclk); clk_enable(edp->clk_edp); clk_enable(edp->clk_24m); @@ -59,6 +60,7 @@ static int rk32_edp_clk_disable(struct rk32_edp *edp) clk_disable(edp->pclk); clk_disable(edp->clk_edp); clk_disable(edp->clk_24m); + clk_disable(edp->pd); edp->clk_on = false; } @@ -1319,6 +1321,10 @@ static int rk32_edp_probe(struct platform_device *pdev) return PTR_ERR(edp->regs); } + edp->pd = devm_clk_get(&pdev->dev,"pd_edp"); + if (IS_ERR(edp->pd)) { + dev_err(&pdev->dev, "cannot get pd\n"); + } edp->clk_edp = devm_clk_get(&pdev->dev,"clk_edp"); if (IS_ERR(edp->clk_edp)) { dev_err(&pdev->dev, "cannot get clk_edp\n"); @@ -1336,7 +1342,7 @@ static int rk32_edp_probe(struct platform_device *pdev) dev_err(&pdev->dev, "cannot get pclk\n"); return PTR_ERR(edp->pclk); } - + clk_prepare(edp->pd); clk_prepare(edp->pclk); clk_prepare(edp->clk_edp); clk_prepare(edp->clk_24m); diff --git a/drivers/video/rockchip/transmitter/rk32_dp.h b/drivers/video/rockchip/transmitter/rk32_dp.h index dc48e5c4eba5..de90cf29dc45 100644 --- a/drivers/video/rockchip/transmitter/rk32_dp.h +++ b/drivers/video/rockchip/transmitter/rk32_dp.h @@ -514,6 +514,7 @@ struct rk32_edp { struct device *dev; void __iomem *regs; unsigned int irq; + struct clk *pd; struct clk *clk_edp; /*clk for edp controller*/ struct clk *clk_24m; /*clk for edp phy*/ struct clk *pclk; /*clk for phb bus*/