Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1159806

Re: [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor)

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor)
Date 2015-06-06 03:20 +0200
Message-ID <pyaWe-1km-11@gated-at.bofh.it> (permalink)
References <puGhY-8hz-3@gated-at.bofh.it> <puGhY-8hz-25@gated-at.bofh.it> <pxJW2-3gL-17@gated-at.bofh.it> <pxWgz-4vk-7@gated-at.bofh.it> <py3rI-6FY-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 06/05, Sudeep Holla wrote:
> 
> 
> On 05/06/15 10:36, Sudeep Holla wrote:
> >
> >
> >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.
> >
> 
> I found that the framework already provides clk_set_rate_range for this
> purpose. Sorry for missing this earlier(seems like that's added quite
> recently in v4.0). I think I still need to retain round_rate as the core
> framework insists.

Sure, or use determine_rate if you want to limit the min/max from
the clk provider itself.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v3 3/5] clk: add support for clocks provided by  SCP(System Control Processor) Stephen Boyd <sboyd@codeaurora.org> - 2015-06-06 03:20 +0200

csiph-web