OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e4b8a2
)
clk: sprd: fix to get a correct ibias of pll
author
Chunyan Zhang
<chunyan.zhang@unisoc.com>
Mon, 30 Mar 2020 02:16:40 +0000
(10:16 +0800)
committer
Stephen Boyd
<sboyd@kernel.org>
Fri, 3 Apr 2020 01:07:58 +0000
(18:07 -0700)
The current driver is getting a wrong ibias index of pll clocks from
number 1. This patch fix that issue, then getting ibias index from 0.
Fixes:
3e37b005580b
("clk: sprd: add adjustable pll support")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link:
https://lkml.kernel.org/r/20200330021640.14133-1-zhang.lyra@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sprd/pll.c
patch
|
blob
|
history
diff --git
a/drivers/clk/sprd/pll.c
b/drivers/clk/sprd/pll.c
index
640270f
..
1579148
100644
(file)
--- a/
drivers/clk/sprd/pll.c
+++ b/
drivers/clk/sprd/pll.c
@@
-87,11
+87,12
@@
static u32 pll_get_ibias(u64 rate, const u64 *table)
{
u32 i, num = table[0];
- for (i = 1; i < num + 1; i++)
- if (rate <= table[i])
+ /* table[0] indicates the number of items in this table */
+ for (i = 0; i < num; i++)
+ if (rate <= table[i + 1])
break;
- return
(i == num + 1) ? num
: i;
+ return
i == num ? num - 1
: i;
}
static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,