linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Sudeep Holla <Sudeep.Holla@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	"Jon Medhurst (Tixy)" <tixy@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>, Kevin Hilman <khilman@kernel.org>,
	Olof Johansson <olof@lixom.net>,
	Mike Turquette <mturquette@linaro.org>
Subject: Re: [PATCH v3 3/5] clk: add support for clocks provided by SCP(System Control Processor)
Date: Fri, 05 Jun 2015 18:10:13 +0100	[thread overview]
Message-ID: <5571D7F5.1030405@arm.com> (raw)
In-Reply-To: <55716DA4.2090003@arm.com>



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.

Regards,
Sudeep

  reply	other threads:[~2015-06-05 17:10 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 [this message]
2015-06-06  1:12         ` Stephen Boyd
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=5571D7F5.1030405@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=arnd@arndb.de \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=olof@lixom.net \
    --cc=sboyd@codeaurora.org \
    --cc=tixy@linaro.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).