summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-cs2000-cp.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2017-04-18 04:20:03 +0200
committerStephen Boyd <sboyd@codeaurora.org>2017-04-19 19:18:55 +0200
commitb3da896e2f325f8fef29f698d9cbdbb0e821a474 (patch)
tree1845f621e3f819ffaf7ab5151edcaf40b8cb6784 /drivers/clk/clk-cs2000-cp.c
parentclk: cs2000: tidyup DEVICE_CFG2 settings (diff)
downloadlinux-b3da896e2f325f8fef29f698d9cbdbb0e821a474.tar.xz
linux-b3da896e2f325f8fef29f698d9cbdbb0e821a474.zip
clk: cs2000: select 12.20 High Accuracy on LFRatioCfg
cs2000 can select Static/Dynamic ratio based Frequency Synthesizer Mode, it can select 20.12 High Multiplier interpret for 32-bit User Defined Ratio if Dynamic ratio mode. Otherwise it should select 12.20 High Accuracy mode. Current cs2000 is supporting Static ratio mode only, so it should select 12.20 High Accuracy mode, not 20.12 High Multiplier mode. This patch fixes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk-cs2000-cp.c')
-rw-r--r--drivers/clk/clk-cs2000-cp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c
index f3ab0cad2c9d..c54baede4d68 100644
--- a/drivers/clk/clk-cs2000-cp.c
+++ b/drivers/clk/clk-cs2000-cp.c
@@ -60,6 +60,11 @@
#define REFCLKDIV(x) (((x) & 0x3) << 3)
#define REFCLKDIV_MASK REFCLKDIV(0x3)
+/* FUNC_CFG2 */
+#define LFRATIO_MASK (1 << 3)
+#define LFRATIO_20_12 (0 << 3)
+#define LFRATIO_12_20 (1 << 3)
+
#define CH_SIZE_ERR(ch) ((ch < 0) || (ch >= CH_MAX))
#define hw_to_priv(_hw) container_of(_hw, struct cs2000_priv, hw)
#define priv_to_client(priv) (priv->client)
@@ -130,6 +135,12 @@ static int cs2000_enable_dev_config(struct cs2000_priv *priv, bool enable)
if (ret < 0)
return ret;
+ /* FIXME: for Static ratio mode */
+ ret = cs2000_bset(priv, FUNC_CFG2, LFRATIO_MASK,
+ LFRATIO_12_20);
+ if (ret < 0)
+ return ret;
+
return 0;
}