All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa@samsung.com>
To: Abhilash Kesavan <a.kesavan@samsung.com>,
	myungjoo.ham@samsung.com, linux-pm@vger.kernel.org,
	kgene.kim@samsung.com
Cc: rjw@sisk.pl, kesavan.abhilash@gmail.com, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 5/7] PM / devfreq: exynos5250: migrate to common-clock
Date: Wed, 16 Jul 2014 13:03:40 +0200	[thread overview]
Message-ID: <53C65C0C.10200@samsung.com> (raw)
In-Reply-To: <1405449332-26350-1-git-send-email-a.kesavan@samsung.com>

Hi Abhilash, Andrew,

Please see my comments inline.

On 15.07.2014 20:35, Abhilash Kesavan wrote:
> From: Andrew Bresticker <abrestic@chromium.org>
> 
> Use the common-clock framework to scale frequencies for the various
> peripheral clocks on the Exynos5250.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> ---
>  drivers/devfreq/exynos/exynos5_bus.c |  131 ++++++++++++++++++++++++++++++----
>  1 file changed, 119 insertions(+), 12 deletions(-)

[snip]

> +
>  static struct int_bus_opp_table exynos5_int_opp_table[] = {
>  	{LV_0, 266000, 1025000},
>  	{LV_1, 200000, 1025000},
> @@ -75,6 +85,98 @@ static struct int_bus_opp_table exynos5_int_opp_table[] = {
>  	{0, 0, 0},
>  };
>  
> +static struct int_clk_table aclk_166[] = {
> +	{LV_0, 167000},
> +	{LV_1, 111000},
> +	{LV_2,  84000},
> +	{LV_3,  84000},
> +	{LV_4,  42000},
> +};

[snip]

> +static struct int_clk_table aclk_300_gscl[] = {
> +	{LV_0, 267000},
> +	{LV_1, 267000},
> +	{LV_2, 267000},
> +	{LV_3, 200000},
> +	{LV_4, 100000},
> +};

Shouldn't you manage this using OPP framework and parse this from DT?

> +
> +#define EXYNOS5_INT_CLK(name, tbl) {		\
> +	.clk_name = name,			\
> +	.freq_table = tbl,			\
> +}

[snip]

> @@ -320,16 +427,16 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev)
>  	rcu_read_unlock();
>  	data->curr_freq = initial_freq;
>  
> -	err = clk_set_rate(data->int_clk, initial_freq * 1000);
> +	err = exynos5_int_setvolt(data, initial_volt);
> +	if (err)
> +		return err;
> +
> +	err = exynos5_int_set_rate(data, initial_freq);
>  	if (err) {
>  		dev_err(dev, "Failed to set initial frequency\n");
>  		return err;
>  	}
>  
> -	err = exynos5_int_setvolt(data, initial_volt);
> -	if (err)
> -		return err;
> -

Whether voltage or rate should be set first depends on current settings
and initial_{freq,volt}. Also it might be more convenient to simply call
exynos5_busfreq_int_target() here.

Best regards,
Tomasz

  reply	other threads:[~2014-07-16 11:04 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 17:21 [PATCH RFC v2 0/7] Devfreq support for Exynos5250/5420 Abhilash Kesavan
2014-05-22 17:21 ` Abhilash Kesavan
2014-05-22 17:21 ` [PATCH RFC v2 1/7] clk: exynos5250: add aliases for clocks used by devfreq Abhilash Kesavan
2014-05-22 17:21   ` Abhilash Kesavan
2014-07-15 18:33   ` [PATCH v3 " Abhilash Kesavan
2014-07-16 10:50     ` Tomasz Figa
2014-07-16 18:04       ` Abhilash Kesavan
2014-05-22 17:21 ` [PATCH RFC v2 2/7] clk: exynos5420: Add " Abhilash Kesavan
2014-05-22 17:21   ` Abhilash Kesavan
2014-07-15 18:34   ` [PATCH v3 " Abhilash Kesavan
2014-07-16 10:51     ` Tomasz Figa
     [not found] ` <1400779322-4410-1-git-send-email-a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-05-22 17:21   ` [PATCH RFC v2 3/7] ARM: dts: Add PPMU device tree support for Exynos5250 Abhilash Kesavan
2014-05-22 17:21     ` Abhilash Kesavan
2014-07-15 18:34     ` [PATCH v3 " Abhilash Kesavan
2014-07-16 10:55       ` Tomasz Figa
2014-07-16 18:00         ` Abhilash Kesavan
2014-07-16 10:56       ` Tomasz Figa
2014-07-16 18:01         ` Abhilash Kesavan
2014-05-22 17:22   ` [PATCH RFC v2 7/7] PM / devfreq: Add devfreq driver for Exynos5420 Abhilash Kesavan
2014-05-22 17:22     ` Abhilash Kesavan
2014-07-15 18:36     ` [PATCH v3 " Abhilash Kesavan
2014-07-16 11:55       ` Tomasz Figa
2014-07-16 17:59         ` Abhilash Kesavan
2014-07-28 12:01           ` Abhilash Kesavan
2014-05-22 17:21 ` [PATCH RFC v2 4/7] ARM: dts: Add PPMU device tree support " Abhilash Kesavan
2014-05-22 17:21   ` Abhilash Kesavan
2014-05-22 17:50   ` Sergei Shtylyov
2014-05-22 17:50     ` Sergei Shtylyov
2014-06-16  7:01     ` Abhilash Kesavan
2014-06-16  7:01       ` Abhilash Kesavan
2014-07-15 18:34   ` [PATCH v3 " Abhilash Kesavan
2014-05-22 17:22 ` [PATCH RFC v2 5/7] PM / devfreq: exynos5250: migrate to common-clock Abhilash Kesavan
2014-05-22 17:22   ` Abhilash Kesavan
2014-07-15 18:35   ` [PATCH v3 " Abhilash Kesavan
2014-07-16 11:03     ` Tomasz Figa [this message]
2014-07-16 18:00       ` Abhilash Kesavan
2014-05-22 17:22 ` [PATCH RFC v2 6/7] PM / devfreq: exynos: Fix typo in macro Abhilash Kesavan
2014-05-22 17:22   ` Abhilash Kesavan
2014-07-15 18:35   ` [PATCH v3 " Abhilash Kesavan
2014-05-23  5:08 ` [PATCH RFC v2 0/7] Devfreq support for Exynos5250/5420 Chanwoo Choi
2014-05-23  5:08   ` Chanwoo Choi
2014-06-16  6:59   ` Abhilash Kesavan
2014-06-16  6:59     ` Abhilash Kesavan
2014-07-15 18:33 ` [PATCH v3 " Abhilash Kesavan

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=53C65C0C.10200@samsung.com \
    --to=t.figa@samsung.com \
    --cc=a.kesavan@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kesavan.abhilash@gmail.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.