aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2013-08-20 17:58:48 -0400
committerMike Turquette <mturquette@linaro.org>2013-08-20 17:58:48 -0400
commitbddbd13453d838a30baf84869c56076c8ce2b211 (patch)
tree024bbb15ed230f23caace4d0178e19c461fb8af8
parente366fdd72529c545ccf327569ee250c1673be221 (diff)
parent353dc6c47d67c83f7cc20334f8deb251674e6864 (diff)
Merge tag 'zynq-clk-for-3.12' of git://git.xilinx.com/linux-xlnx into clk-next
arm: Xilinx Zynq clock changes for v3.12 Just small two changes where the first fixes documentation and the second improves code readability.
-rw-r--r--drivers/clk/zynq/pll.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/clk/zynq/pll.c b/drivers/clk/zynq/pll.c
index 47e307c25a7b..3226f54fa595 100644
--- a/drivers/clk/zynq/pll.c
+++ b/drivers/clk/zynq/pll.c
@@ -50,6 +50,9 @@ struct zynq_pll {
50#define PLLCTRL_RESET_MASK 1 50#define PLLCTRL_RESET_MASK 1
51#define PLLCTRL_RESET_SHIFT 0 51#define PLLCTRL_RESET_SHIFT 0
52 52
53#define PLL_FBDIV_MIN 13
54#define PLL_FBDIV_MAX 66
55
53/** 56/**
54 * zynq_pll_round_rate() - Round a clock frequency 57 * zynq_pll_round_rate() - Round a clock frequency
55 * @hw: Handle between common and hardware-specific interfaces 58 * @hw: Handle between common and hardware-specific interfaces
@@ -63,10 +66,10 @@ static long zynq_pll_round_rate(struct clk_hw *hw, unsigned long rate,
63 u32 fbdiv; 66 u32 fbdiv;
64 67
65 fbdiv = DIV_ROUND_CLOSEST(rate, *prate); 68 fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
66 if (fbdiv < 13) 69 if (fbdiv < PLL_FBDIV_MIN)
67 fbdiv = 13; 70 fbdiv = PLL_FBDIV_MIN;
68 else if (fbdiv > 66) 71 else if (fbdiv > PLL_FBDIV_MAX)
69 fbdiv = 66; 72 fbdiv = PLL_FBDIV_MAX;
70 73
71 return *prate * fbdiv; 74 return *prate * fbdiv;
72} 75}
@@ -182,7 +185,13 @@ static const struct clk_ops zynq_pll_ops = {
182 185
183/** 186/**
184 * clk_register_zynq_pll() - Register PLL with the clock framework 187 * clk_register_zynq_pll() - Register PLL with the clock framework
185 * @np Pointer to the DT device node 188 * @name PLL name
189 * @parent Parent clock name
190 * @pll_ctrl Pointer to PLL control register
191 * @pll_status Pointer to PLL status register
192 * @lock_index Bit index to this PLL's lock status bit in @pll_status
193 * @lock Register lock
194 * Returns handle to the registered clock.
186 */ 195 */
187struct clk *clk_register_zynq_pll(const char *name, const char *parent, 196struct clk *clk_register_zynq_pll(const char *name, const char *parent,
188 void __iomem *pll_ctrl, void __iomem *pll_status, u8 lock_index, 197 void __iomem *pll_ctrl, void __iomem *pll_status, u8 lock_index,