clk: mpll: fix audio not sound issue
authorShunzhou Jiang <shunzhou.jiang@amlogic.com>
Mon, 20 Aug 2018 02:14:10 +0000 (10:14 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 20 Aug 2018 03:01:26 +0000 (20:01 -0700)
PD#170386: clk: fix audio not sound

Change-Id: I0396c6e2447162995964914fa7adb9f35ff651f0
Signed-off-by: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
drivers/amlogic/clk/clk-mpll.c

index de5946b..435055b 100644 (file)
@@ -121,7 +121,7 @@ static int mpll_set_rate(struct clk_hw *hw, unsigned long rate,
        do_div(rate64, rate);
        n2 = rate64;
 
-       rate64 = (parent_rate - n2 * rate) * SDM_MAX;
+       rate64 = (parent_rate - n2 * rate) * SDM_MAX + rate - 1;
        do_div(rate64, rate);
        sdm = rate64;
        pr_debug("%s: sdm: %lu n2: %lu rate: %lu\n", __func__, sdm, n2, rate);