[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5376696F.9090006@wwwdotorg.org>
Date: Fri, 16 May 2014 13:39:27 -0600
From: Stephen Warren <swarren@...dotorg.org>
To: Viresh Kumar <viresh.kumar@...aro.org>, rjw@...ysocki.net
CC: linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, arvind.chauhan@....com,
swarren@...dia.com, nicolas.pitre@...aro.org,
dianders@...omium.org, linux@....linux.org.uk,
thomas.abraham@...aro.org, pdeschrijver@...dia.com
Subject: Re: [PATCH V2 3/3] cpufreq: Tegra: implement intermediate frequency
callbacks
On 05/16/2014 03:07 AM, Viresh Kumar wrote:
> Tegra had always been switching to intermediate frequency (pll_p_clk) since
> ever. CPUFreq core has better support for handling notifications for these
> frequencies and so we can adapt Tegra's driver to it.
You need to squash in the patch below in order for this series to work.
Once that's done,
Tested-by: Stephen Warren <swarren@...dia.com>
> Signed-off-by: Stephen Warren <swarren@...dia.com>
>
> diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
> index 10b29ec99bdc..c04fec02ac6a 100644
> --- a/drivers/cpufreq/tegra-cpufreq.c
> +++ b/drivers/cpufreq/tegra-cpufreq.c
> @@ -49,13 +49,22 @@ static struct clk *emc_clk;
> static unsigned int
> tegra_get_intermediate(struct cpufreq_policy *policy, unsigned int index)
> {
> - return clk_get_rate(pll_p_clk);
> + return clk_get_rate(pll_p_clk) / 1000; /* kHz */
> }
>
> static int
> tegra_target_intermediate(struct cpufreq_policy *policy, unsigned int frequency)
> {
> + WARN_ON(frequency != clk_get_rate(pll_p_clk) / 1000);
> +
> + /*
> + * Take an extra reference to the main pll so it doesn't turn
> + * off when we move the cpu off of it
> + */
> + clk_prepare_enable(pll_x_clk);
> +
> return clk_set_parent(cpu_clk, pll_p_clk);
> + /* FIXME: if error, remove pll_x reference */
> }
>
> static int tegra_target(struct cpufreq_policy *policy, unsigned int index)
> @@ -74,16 +83,10 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index)
> else
> clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */
>
> - /*
> - * Take an extra reference to the main pll so it doesn't turn
> - * off when we move the cpu off of it
> - */
> - clk_prepare_enable(pll_x_clk);
> -
> if (rate == clk_get_rate(pll_p_clk))
> goto out;
>
> - ret = clk_set_rate(pll_x_clk, rate);
> + ret = clk_set_rate(pll_x_clk, rate * 1000);
> if (ret) {
> pr_err("Failed to change pll_x to %lu\n", rate);
> goto out;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists