aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2013-12-24 14:05:38 -0500
committerShawn Guo <shawn.guo@linaro.org>2013-12-30 20:36:45 -0500
commitadf15fa59695f383067e70d151b131fdeafcb489 (patch)
treeb189adbfb679dd92f08b97f88710d42856594f45 /arch/arm/mach-imx
parent5a72f10500f52f18887ce78f8edebc95cc3dfc23 (diff)
ARM: imx: add necessary interface for pfd
Common clk framework will disable unused clks in late init only if they are enabled by default and no one is using it, so we need to add is_enabled callback for clk framework to get clks' status. PFD clocks are enabled by hardware reset, so we need to add interface for common clk framework to disable those unused ones for saving power. Signed-off-by: Anson Huang <b20788@freescale.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/clk-pfd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/clk-pfd.c b/arch/arm/mach-imx/clk-pfd.c
index e2ed4160f329..0b0f6f66ec56 100644
--- a/arch/arm/mach-imx/clk-pfd.c
+++ b/arch/arm/mach-imx/clk-pfd.c
@@ -109,12 +109,23 @@ static int clk_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
109 return 0; 109 return 0;
110} 110}
111 111
112static int clk_pfd_is_enabled(struct clk_hw *hw)
113{
114 struct clk_pfd *pfd = to_clk_pfd(hw);
115
116 if (readl_relaxed(pfd->reg) & (1 << ((pfd->idx + 1) * 8 - 1)))
117 return 0;
118
119 return 1;
120}
121
112static const struct clk_ops clk_pfd_ops = { 122static const struct clk_ops clk_pfd_ops = {
113 .enable = clk_pfd_enable, 123 .enable = clk_pfd_enable,
114 .disable = clk_pfd_disable, 124 .disable = clk_pfd_disable,
115 .recalc_rate = clk_pfd_recalc_rate, 125 .recalc_rate = clk_pfd_recalc_rate,
116 .round_rate = clk_pfd_round_rate, 126 .round_rate = clk_pfd_round_rate,
117 .set_rate = clk_pfd_set_rate, 127 .set_rate = clk_pfd_set_rate,
128 .is_enabled = clk_pfd_is_enabled,
118}; 129};
119 130
120struct clk *imx_clk_pfd(const char *name, const char *parent_name, 131struct clk *imx_clk_pfd(const char *name, const char *parent_name,