clk: axg: fix 32bit set mpll clk overflow
authorShunzhou Jiang <shunzhou.jiang@amlogic.com>
Mon, 15 Oct 2018 02:47:51 +0000 (10:47 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 16 Oct 2018 05:44:07 +0000 (22:44 -0700)
PD#SWPL-394

Problem:
32bit system clk overflow

Solution:
let mpll clock not overflow

Verify:
gxl

Change-Id: I90c99c026264bb4d6820cd988bd5f8828456e0f6
Signed-off-by: shunzhou.jiang <shunzhou.jiang@amlogic.com>
drivers/amlogic/clk/clk-mpll.c
drivers/amlogic/clk/gxl/clk_misc.c

index 435055b..66bd875 100644 (file)
@@ -28,7 +28,7 @@
 #include "clkc.h"
 /* #undef pr_debug */
 /* #define pr_debug pr_info */
-#define SDM_MAX 16384
+#define SDM_MAX 16384ULL
 #define MAX_RATE       500000000
 #define MIN_RATE       5000000
 
index 774bf09..26e495c 100644 (file)
@@ -100,6 +100,7 @@ static struct clk_divider amclk_div = {
        .shift = 0,
        .width = 8,
        .lock = &clk_lock,
+       .flags = CLK_DIVIDER_ROUND_CLOSEST,
        .hw.init = &(struct clk_init_data){
                .name = "amclk_div",
                .ops = &clk_divider_ops,