linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor)
Date: Fri, 5 Jun 2015 18:12:25 -0700	[thread overview]
Message-ID: <20150606011225.GF29237@codeaurora.org> (raw)
In-Reply-To: <5571D7F5.1030405@arm.com>

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

  reply	other threads:[~2015-06-06  1:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27  9:53 [PATCH v3 0/5] ARM64: juno: add SCPI mailbox protocol, clock and CPUFreq support Sudeep Holla
2015-05-27  9:53 ` [PATCH v3 1/5] Documentation: add DT binding for ARM System Control and Power Interface(SCPI) protocol Sudeep Holla
2015-05-27 13:37   ` Mark Rutland
2015-05-27 14:52     ` Sudeep Holla
2015-05-27  9:53 ` [PATCH v3 2/5] firmware: add support " Sudeep Holla
2015-05-27  9:53 ` [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor) Sudeep Holla
2015-06-04 20:20   ` Stephen Boyd
2015-06-05  9:36     ` Sudeep Holla
2015-06-05 17:10       ` Sudeep Holla
2015-06-06  1:12         ` Stephen Boyd [this message]
2015-05-27  9:53 ` [PATCH v3 4/5] clk: scpi: add support for cpufreq virtual device Sudeep Holla
2015-06-04 21:19   ` Stephen Boyd
2015-06-05  9:13     ` Sudeep Holla
2015-05-27  9:53 ` [PATCH v3 5/5] cpufreq: arm_big_little: add SCPI interface driver Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150606011225.GF29237@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).