diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-04-17 22:19:37 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-04-19 13:18:53 -0400 |
commit | b295a015cdfdbf36ce87076dbac8a490f2797cad (patch) | |
tree | 96cfdd282da07931dd2e23b5492372254d4f6699 /drivers/clk | |
parent | d127967a7b18598b8922bf9a4b984fae899787dc (diff) |
clk: cs2000: tidyup DEVICE_CFG2 settings
DEVICE_CFG2 can select ratio from user defined ratio and LOCKCLK is
for it. But current driver sets fixed 0 value. This patch fixes it.
Note is that current cs2000 driver is using/supporting only ratio0
(= ch0) now.
DEVICE_CFG2 can select STATIC/DYNAMIC ratio mode, and current cs2000
driver is selecting STATIC mode, but it was not understandable on
current code. This patch also solve this issue.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-cs2000-cp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index a8fa6bdd0e55..f3ab0cad2c9d 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c | |||
@@ -48,7 +48,9 @@ | |||
48 | #define AUTORMOD (1 << 3) | 48 | #define AUTORMOD (1 << 3) |
49 | #define LOCKCLK(x) (((x) & 0x3) << 1) | 49 | #define LOCKCLK(x) (((x) & 0x3) << 1) |
50 | #define LOCKCLK_MASK LOCKCLK(0x3) | 50 | #define LOCKCLK_MASK LOCKCLK(0x3) |
51 | #define FRACNSRC (1 << 0) | 51 | #define FRACNSRC_MASK (1 << 0) |
52 | #define FRACNSRC_STATIC (0 << 0) | ||
53 | #define FRACNSRC_DYNAMIC (1 << 1) | ||
52 | 54 | ||
53 | /* GLOBAL_CFG */ | 55 | /* GLOBAL_CFG */ |
54 | #define ENDEV2 (0x1) | 56 | #define ENDEV2 (0x1) |
@@ -267,8 +269,8 @@ static int cs2000_ratio_select(struct cs2000_priv *priv, int ch) | |||
267 | return ret; | 269 | return ret; |
268 | 270 | ||
269 | ret = cs2000_bset(priv, DEVICE_CFG2, | 271 | ret = cs2000_bset(priv, DEVICE_CFG2, |
270 | (AUTORMOD | LOCKCLK_MASK | FRACNSRC), | 272 | (AUTORMOD | LOCKCLK_MASK | FRACNSRC_MASK), |
271 | 0); | 273 | (LOCKCLK(ch) | FRACNSRC_STATIC)); |
272 | if (ret < 0) | 274 | if (ret < 0) |
273 | return ret; | 275 | return ret; |
274 | 276 | ||