Skip to content

Commit 2d5bd41

Browse files
committed
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk fixes from Stephen Boyd: "Fixes to the Allwinner and Renesas clk drivers: - Do the math properly in Allwinner's ccu_mp_recalc_rate() so clk rates aren't bogus - Fix a clock domain regression on Renesas R-Car M1A, R-Car H1, and RZ/A1 by registering the domain after the pmdomain bus is registered instead of before" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: sunxi-ng: mp: Fix dual-divider clock rate readback clk: renesas: mstp: Add genpd OF provider at postcore_initcall()
2 parents f975f08 + 764c921 commit 2d5bd41

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

drivers/clk/renesas/clk-mstp.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ void cpg_mstp_detach_dev(struct generic_pm_domain *unused, struct device *dev)
303303
pm_clk_destroy(dev);
304304
}
305305

306+
static struct device_node *cpg_mstp_pd_np __initdata = NULL;
307+
static struct generic_pm_domain *cpg_mstp_pd_genpd __initdata = NULL;
308+
306309
void __init cpg_mstp_add_clk_domain(struct device_node *np)
307310
{
308311
struct generic_pm_domain *pd;
@@ -324,5 +327,20 @@ void __init cpg_mstp_add_clk_domain(struct device_node *np)
324327
pd->detach_dev = cpg_mstp_detach_dev;
325328
pm_genpd_init(pd, &pm_domain_always_on_gov, false);
326329

327-
of_genpd_add_provider_simple(np, pd);
330+
cpg_mstp_pd_np = of_node_get(np);
331+
cpg_mstp_pd_genpd = pd;
332+
}
333+
334+
static int __init cpg_mstp_pd_init_provider(void)
335+
{
336+
int error;
337+
338+
if (!cpg_mstp_pd_np)
339+
return -ENODEV;
340+
341+
error = of_genpd_add_provider_simple(cpg_mstp_pd_np, cpg_mstp_pd_genpd);
342+
343+
of_node_put(cpg_mstp_pd_np);
344+
return error;
328345
}
346+
postcore_initcall(cpg_mstp_pd_init_provider);

drivers/clk/sunxi-ng/ccu_mp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static unsigned long ccu_mp_recalc_rate(struct clk_hw *hw,
185185
p &= (1 << cmp->p.width) - 1;
186186

187187
if (cmp->common.features & CCU_FEATURE_DUAL_DIV)
188-
rate = (parent_rate / p) / m;
188+
rate = (parent_rate / (p + cmp->p.offset)) / m;
189189
else
190190
rate = (parent_rate >> p) / m;
191191

0 commit comments

Comments
 (0)