summaryrefslogtreecommitdiff
path: root/drivers/clk/bcm/clk-iproc-pll.c
diff options
context:
space:
mode:
authorJon Mason <jonmason@broadcom.com>2015-10-15 22:48:29 +0300
committerStephen Boyd <sboyd@codeaurora.org>2015-10-22 03:02:57 +0300
commitf713c6bf32092a259d6baf2be24f9c3dbf2462c3 (patch)
tree175ddb6a03c3187d358f50f201f22076fc47db46 /drivers/clk/bcm/clk-iproc-pll.c
parent7968d24107f5a50a11792f8a7f011877e7470dfa (diff)
downloadlinux-f713c6bf32092a259d6baf2be24f9c3dbf2462c3.tar.xz
clk: iproc: Split off dig_filter
The PLL loop filter/gain can be located in a separate register on some SoCs. Split these off into a separate variable, so that an offset can be added if necessary. Also, make the necessary modifications to the Cygnus and NSP drivers for this change. Signed-off-by: Jon Mason <jonmason@broadcom.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/bcm/clk-iproc-pll.c')
-rw-r--r--drivers/clk/bcm/clk-iproc-pll.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c
index bfa28ba1394e..2be93955262e 100644
--- a/drivers/clk/bcm/clk-iproc-pll.c
+++ b/drivers/clk/bcm/clk-iproc-pll.c
@@ -224,13 +224,17 @@ static void __pll_bring_out_reset(struct iproc_pll *pll, unsigned int kp,
u32 val;
const struct iproc_pll_ctrl *ctrl = pll->ctrl;
const struct iproc_pll_reset_ctrl *reset = &ctrl->reset;
+ const struct iproc_pll_dig_filter_ctrl *dig_filter = &ctrl->dig_filter;
+
+ val = readl(pll->pll_base + dig_filter->offset);
+ val &= ~(bit_mask(dig_filter->ki_width) << dig_filter->ki_shift |
+ bit_mask(dig_filter->kp_width) << dig_filter->kp_shift |
+ bit_mask(dig_filter->ka_width) << dig_filter->ka_shift);
+ val |= ki << dig_filter->ki_shift | kp << dig_filter->kp_shift |
+ ka << dig_filter->ka_shift;
+ iproc_pll_write(pll, pll->pll_base, dig_filter->offset, val);
val = readl(pll->pll_base + reset->offset);
- val &= ~(bit_mask(reset->ki_width) << reset->ki_shift |
- bit_mask(reset->kp_width) << reset->kp_shift |
- bit_mask(reset->ka_width) << reset->ka_shift);
- val |= ki << reset->ki_shift | kp << reset->kp_shift |
- ka << reset->ka_shift;
val |= 1 << reset->reset_shift | 1 << reset->p_reset_shift;
iproc_pll_write(pll, pll->pll_base, reset->offset, val);
}