diff options
author | Michael Turquette <mturquette@baylibre.com> | 2015-12-24 00:08:56 +0300 |
---|---|---|
committer | Michael Turquette <mturquette@baylibre.com> | 2015-12-24 00:08:56 +0300 |
commit | a915e30dd26ea5f3cc2e2c044aba38ee5973d3fa (patch) | |
tree | 0de1e6e8ea64b9a675a135722882cab4768b5002 /drivers/clk/clk.c | |
parent | ce6dd266d535d66ac90abdd0241e7e5be4890568 (diff) | |
parent | b0158bb27c7b6e9843f541c17b24dbd964b76db6 (diff) | |
download | linux-a915e30dd26ea5f3cc2e2c044aba38ee5973d3fa.tar.xz |
Merge branch 'clk-rockchip' into clk-next
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 9352a13395c8..b4db67a446c8 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1443,6 +1443,15 @@ static void clk_change_rate(struct clk_core *core) else if (core->parent) best_parent_rate = core->parent->rate; + if (core->flags & CLK_SET_RATE_UNGATE) { + unsigned long flags; + + clk_core_prepare(core); + flags = clk_enable_lock(); + clk_core_enable(core); + clk_enable_unlock(flags); + } + if (core->new_parent && core->new_parent != core->parent) { old_parent = __clk_set_parent_before(core, core->new_parent); trace_clk_set_parent(core, core->new_parent); @@ -1469,6 +1478,15 @@ static void clk_change_rate(struct clk_core *core) core->rate = clk_recalc(core, best_parent_rate); + if (core->flags & CLK_SET_RATE_UNGATE) { + unsigned long flags; + + flags = clk_enable_lock(); + clk_core_disable(core); + clk_enable_unlock(flags); + clk_core_unprepare(core); + } + if (core->notifier_count && old_rate != core->rate) __clk_notify(core, POST_RATE_CHANGE, old_rate, core->rate); |