linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: linux-kernel@vger.kernel.org,
	"Mike Turquette" <mturquette@linaro.org>,
	"Javier Martinez Canillas" <javier.martinez@collabora.co.uk>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Tony Lindgren" <tony@atomide.com>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Boris Brezillon" <boris.brezillon@free-electrons.com>,
	"Emilio López" <emilio@elopez.com.ar>,
	"Maxime Ripard" <maxime.ripard@free-electrons.com>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Manuel Lauss" <manuel.lauss@gmail.com>,
	"Alex Elder" <elder@linaro.org>,
	"Matt Porter" <mporter@linaro.org>,
	"Zhangfei Gao" <zhangfei.gao@linaro.org>,
	"Haojian Zhuang" <haojian.zhuang@linaro.org>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Bintian Wang" <bintian.wang@huawei.com>,
	"Chao Xie" <chao.xie@marvell.com>,
	linux-doc@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-mips@linux-m
Subject: Re: [PATCH v9 3/3] clk: Add floor and ceiling constraints to clock rates
Date: Mon, 19 Jan 2015 16:00:19 -0800	[thread overview]
Message-ID: <20150120000019.GD27202@codeaurora.org> (raw)
In-Reply-To: <1421688067-24426-4-git-send-email-tomeu.vizoso@collabora.com>

On 01/19, Tomeu Vizoso wrote:
> Adds a way for clock consumers to set maximum and minimum rates. This can be
> used for thermal drivers to set ceiling rates, or by misc. drivers to set
> floor rates to assure a minimum performance level.
> 
> Changes the signature of the determine_rate callback by adding the
> parameters floor_rate and ceiling_rate.

Commit text needs the s/floor/min and s/ceiling/max treatment
too.

> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index f2a1ff3..55b3124 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1026,6 +1051,28 @@ static unsigned long clk_core_round_rate_nolock(struct clk_core *clk,
>  	else
>  		return clk->rate;
>  }
> +unsigned long __clk_determine_rate(struct clk_hw *hw,
> +				   unsigned long rate,
> +				   unsigned long min_rate,
> +				   unsigned long max_rate)
> +{
> +	unsigned long parent_rate = 0;
> +	struct clk_core *core = hw->core;
> +	struct clk_hw *parent_hw;
> +
> +	if (!core->ops->determine_rate)
> +		return 0;
> +
> +	if (core->parent) {
> +		parent_rate = core->parent->rate;
> +		parent_hw = core->parent->hw;
> +	}
> +
> +	return core->ops->determine_rate(core->hw, rate,
> +					min_rate, max_rate,
> +					&parent_rate, &parent_hw);
> +}
> +EXPORT_SYMBOL_GPL(__clk_determine_rate);

Maybe I misled you with the API name. I was thinking more along
the lines of clk_round_rate() and this new function ending up
calling clk_core_round_rate(), but clk_round_rate() would call it
with whatever range the clock is constrained to while this new
function would allow driver authors to specify the range. It
should be easy enough to add min/max to clk_core_round_rate()
given that it's a private API in this file.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2015-01-20  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1421688067-24426-1-git-send-email-tomeu.vizoso@collabora.com>
2015-01-19 17:20 ` [PATCH v9 2/3] clk: Make clk API return per-user struct clk instances Tomeu Vizoso
2015-01-19 20:59   ` Stephen Boyd
2015-01-20 10:14     ` Tomeu Vizoso
2015-01-19 17:21 ` [PATCH v9 3/3] clk: Add floor and ceiling constraints to clock rates Tomeu Vizoso
2015-01-20  0:00   ` Stephen Boyd [this message]
2015-01-20 13:04     ` Tomeu Vizoso

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=20150120000019.GD27202@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=bintian.wang@huawei.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=chao.xie@marvell.com \
    --cc=corbet@lwn.net \
    --cc=elder@linaro.org \
    --cc=emilio@elopez.com.ar \
    --cc=haojian.zhuang@linaro.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jh80.chung@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-m \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=manuel.lauss@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mporter@linaro.org \
    --cc=mturquette@linaro.org \
    --cc=ralf@linux-mips.org \
    --cc=t-kristo@ti.com \
    --cc=tomeu.vizoso@collabora.com \
    --cc=tony@atomide.com \
    --cc=zhangfei.gao@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).