question about clk notifier in common clock tree

From: zhoujie wu <hidden>
Date: 2013-09-04 06:59:34
Subsystem: common clk framework, the rest · Maintainers: Stephen Boyd, Brian Masney, Jerome Brunet, Linus Torvalds

Hi Mike,

Now in our platform, we are using clk notifer to adjust voltage before
clock rate change or after rate change.

But for some clock modules, it even have to adjust voltage when clock
enable and disable.
For example, when it is working(clock enabled), it requires voltage
1.2V. When it finished its work, it could release it's voltage
requirement.
Do you think if it is ok we also send out notifier in __clk_prepare
and __clk_unprepare as below?

Thanks.
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 54a191c..2f64f1e 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -34,6 +34,9 @@ static HLIST_HEAD(clk_root_list);
 static HLIST_HEAD(clk_orphan_list);
 static LIST_HEAD(clk_notifier_list);

+static int __clk_notify(struct clk *clk, unsigned long msg,
+ unsigned long old_rate, unsigned long new_rate);
+
 /***           locking             ***/
 static void clk_prepare_lock(void)
 {
@@ -697,6 +700,9 @@ void __clk_unprepare(struct clk *clk)
  if (clk->ops->unprepare)
  clk->ops->unprepare(clk->hw);

+ /* send out notifier for dvfs */
+ __clk_notify(clk, POST_RATE_CHANGE, clk->rate, 0);
+
  __clk_unprepare(clk->parent);
 }
@@ -738,6 +744,9 @@ int __clk_prepare(struct clk *clk)
  return ret;
  }
  }
+
+ /* send out notifier for dvfs */
+ __clk_notify(clk, PRE_RATE_CHANGE, 0, clk->rate);
  }

  clk->prepare_count++;

-- 
Zhoujie Wu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help