summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTomasz Stanislawski <t.stanislaws@samsung.com>2013-10-15 17:59:11 +0200
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:43:45 +0900
commit23a8c31f0e3d5fb47cb235ad0a2d7590511080ac (patch)
tree2461eba5cf66a9122d85a5d36a896a338c125830 /drivers
parent3b0b039f820828ca8dea5d54a733e2193884e448 (diff)
downloadlinux-3.10-23a8c31f0e3d5fb47cb235ad0a2d7590511080ac.tar.gz
linux-3.10-23a8c31f0e3d5fb47cb235ad0a2d7590511080ac.tar.bz2
linux-3.10-23a8c31f0e3d5fb47cb235ad0a2d7590511080ac.zip
clk: propagate parent change up one level
This patch adds support for propagation of setup of clock's parent one level up. This feature is helpful when a driver changes topology of its clocks using clk_set_parent(). The problem occurs when on one platform/SoC driver's clock is located at MUX output but on the other platform/SoC there is a gated proxy clock between the MUX and driver's clock. In such a case, driver's code has to be modified to use one clock for enabling and the other clock for setup of a parent. The code updates are avoided by propagating setup of a parent up one level. Additionally, this patch adds CLK_SET_PARENT_PARENT (sorry for naming) flag to inform clk-core that clk_set_parent() should be propagated. Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Change-Id: I206d23fb86cc09bce943ef9971a710876e3a7744
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index a9abf1ba69b..ba2f31b1861 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1506,6 +1506,12 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
/* try finding the new parent index */
if (parent) {
+ if ((clk->flags & CLK_SET_PARENT_PARENT)
+ && clk->num_parents == 1) {
+ ret = clk_set_parent(clk->parent, parent);
+ goto out;
+ }
+
p_index = clk_fetch_parent_index(clk, parent);
p_rate = parent->rate;
if (p_index == clk->num_parents) {