On 04/06/15 21:20, Stephen Boyd wrote:
On 05/27, Sudeep Holla wrote:
+
+static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct scpi_clk *clk = to_scpi_clk(hw);
+
+ return scpi_ops->clk_get_val(clk->id);
+}
+
+static long scpi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long *parent_rate)
+{
+ struct scpi_clk *clk = to_scpi_clk(hw);
+
+ if (WARN_ON(clk->rate_min && rate < clk->rate_min))
+ rate = clk->rate_min;
+ if (WARN_ON(clk->rate_max && rate > clk->rate_max))
+ rate = clk->rate_max;
+
+ return rate;
+}
Hm.. this seems really generic. It might be better to support a
way to tell the framework to limit the min/max rate that's
accepted for a clk. That could be done later though.
True, framework have some boundary checks in place. I will check if
I can use it with minimum changes to the core. If not, we can take this
up later as you suggested.