Skip to content

Commit 1f737ff

Browse files
jbrun3tsuperna9999
authored andcommitted
clk: meson: mpll: fix mpll0 fractional part ignored
mpll0 clock is special compared to the other mplls. It needs another bit (ssen) to be set to activate the fractional part the mpll divider Fixes: 007e6e5 ("clk: meson: mpll: add rw operation") Signed-off-by: Jerome Brunet <[email protected]> Signed-off-by: Neil Armstrong <[email protected]>
1 parent 5771a8c commit 1f737ff

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

drivers/clk/meson/clk-mpll.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ static int mpll_set_rate(struct clk_hw *hw,
161161
reg = PARM_SET(p->width, p->shift, reg, 1);
162162
writel(reg, mpll->base + p->reg_off);
163163

164+
p = &mpll->ssen;
165+
if (p->width != 0) {
166+
reg = readl(mpll->base + p->reg_off);
167+
reg = PARM_SET(p->width, p->shift, reg, 1);
168+
writel(reg, mpll->base + p->reg_off);
169+
}
170+
164171
p = &mpll->n2;
165172
reg = readl(mpll->base + p->reg_off);
166173
reg = PARM_SET(p->width, p->shift, reg, n2);

drivers/clk/meson/clkc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct meson_clk_mpll {
118118
struct parm sdm_en;
119119
struct parm n2;
120120
struct parm en;
121+
struct parm ssen;
121122
spinlock_t *lock;
122123
};
123124

drivers/clk/meson/gxbb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,11 @@ static struct meson_clk_mpll gxbb_mpll0 = {
528528
.shift = 14,
529529
.width = 1,
530530
},
531+
.ssen = {
532+
.reg_off = HHI_MPLL_CNTL,
533+
.shift = 25,
534+
.width = 1,
535+
},
531536
.lock = &clk_lock,
532537
.hw.init = &(struct clk_init_data){
533538
.name = "mpll0",

drivers/clk/meson/meson8b.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ static struct meson_clk_mpll meson8b_mpll0 = {
267267
.shift = 14,
268268
.width = 1,
269269
},
270+
.ssen = {
271+
.reg_off = HHI_MPLL_CNTL,
272+
.shift = 25,
273+
.width = 1,
274+
},
270275
.lock = &clk_lock,
271276
.hw.init = &(struct clk_init_data){
272277
.name = "mpll0",

0 commit comments

Comments
 (0)