[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE=gft7pVnhbEtOyR7Q8n_WuL_RsttrxN+sp=_EPyR=D3NPv9g@mail.gmail.com>
Date: Mon, 16 Jul 2018 16:02:33 -0700
From: Evan Green <evgreen@...gle.com>
To: tdas@...eaurora.org
Cc: rjw@...ysocki.net, viresh.kumar@...aro.org,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
sboyd@...nel.org, Rajendra Nayak <rnayak@...eaurora.org>,
anischal@...eaurora.org, devicetree@...r.kernel.org,
robh@...nel.org, Saravana Kannan <skannan@...eaurora.org>,
amit.kucheria@...aro.org
Subject: Re: [PATCH v5 2/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver
Hi Taniya,
On Thu, Jul 12, 2018 at 11:06 AM Taniya Das <tdas@...eaurora.org> wrote:
>
> The CPUfreq HW present in some QCOM chipsets offloads the steps necessary
> for changing the frequency of CPUs. The driver implements the cpufreq
> driver interface for this hardware engine.
>
> Signed-off-by: Saravana Kannan <skannan@...eaurora.org>
> Signed-off-by: Taniya Das <tdas@...eaurora.org>
> ---
> drivers/cpufreq/Kconfig.arm | 10 ++
> drivers/cpufreq/Makefile | 1 +
> drivers/cpufreq/qcom-cpufreq-hw.c | 344 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 355 insertions(+)
> create mode 100644 drivers/cpufreq/qcom-cpufreq-hw.c
>
...
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
> new file mode 100644
> index 0000000..fa25a95
> --- /dev/null
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
...
> +static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
> +{
> + struct cpufreq_qcom *c;
> +
> + c = qcom_freq_domain_map[policy->cpu];
> + if (!c) {
> + pr_err("No scaling support for CPU%d\n", policy->cpu);
> + return -ENODEV;
> + }
> +
> + cpumask_copy(policy->cpus, &c->related_cpus);
> +
> + policy->fast_switch_possible = true;
> + policy->freq_table = c->table;
> + policy->driver_data = c;
> +
> + return 0;
I haven't looked at this driver in detail, but I have tested it.
Instead of the line above, I needed:
return cpufreq_table_validate_and_show(policy, c->table);
Without this the framework thinks that the min and max frequencies are
zero, and then you get a warning about an invalid table. I also
removed "policy->freq_table = c->table", since validate_and_show does
this.
-Evan
Powered by blists - more mailing lists