aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/qcom/clk-rcg2.c
diff options
context:
space:
mode:
authorArchit Taneja <architt@codeaurora.org>2015-03-04 15:19:35 +0530
committerStephen Boyd <sboyd@codeaurora.org>2015-03-23 15:48:43 -0700
commit0b21503dbbfa669dbd847b33578d4041513cddb2 (patch)
tree82c33048083ebb6e6665d019a2e543e17f79f902 /drivers/clk/qcom/clk-rcg2.c
parentMerge tag 'mvebu-clk-4.1' of git://git.infradead.org/linux-mvebu into clk-next (diff)
downloadlinux-dev-0b21503dbbfa669dbd847b33578d4041513cddb2.tar.xz
linux-dev-0b21503dbbfa669dbd847b33578d4041513cddb2.zip
clk: qcom: fix RCG M/N counter configuration
Currently, a RCG's M/N counter (used for fraction division) is set to either 'bypass' (counter disabled) or 'dual edge' (counter enabled) based on whether the corresponding rcg struct has a mnd field specified and a non-zero N. In the case where M and N are the same value, the M/N counter is still enabled by code even though no division takes place. Leaving the RCG in such a state can result in improper behavior. This was observed with the DSI pixel clock RCG when M and N were both set to 1. Add an additional check (M != N) to enable the M/N counter only when it's needed for fraction division. Signed-off-by: Archit Taneja <architt@codeaurora.org> Fixes: bcd61c0f535a (clk: qcom: Add support for root clock generators (RCGs)) Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom/clk-rcg2.c')
-rw-r--r--drivers/clk/qcom/clk-rcg2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 742acfa18d63..381f27469a9c 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -243,7 +243,7 @@ static int clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
mask |= CFG_SRC_SEL_MASK | CFG_MODE_MASK;
cfg = f->pre_div << CFG_SRC_DIV_SHIFT;
cfg |= rcg->parent_map[f->src] << CFG_SRC_SEL_SHIFT;
- if (rcg->mnd_width && f->n)
+ if (rcg->mnd_width && f->n && (f->m != f->n))
cfg |= CFG_MODE_DUAL_EDGE;
ret = regmap_update_bits(rcg->clkr.regmap,
rcg->cmd_rcgr + CFG_REG, mask, cfg);