From: pi-cheng.chen@linaro.org (pi-cheng.chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] cpufreq-dt: check CPU clock/power domain during initializing
Date: Fri, 9 Jan 2015 17:54:50 +0800 [thread overview]
Message-ID: <1420797291-15972-2-git-send-email-pi-cheng.chen@linaro.org> (raw)
In-Reply-To: <1420797291-15972-1-git-send-email-pi-cheng.chen@linaro.org>
Currently the DT based cpufreq driver is missing some way to check which
CPUs share clocks. In the 1st patch, CPU clock/power domain information is
added to the platform_data of cpufreq-dt so that cpufreq-dt driver could
check which CPUs share clock/power.
Signed-off-by: pi-cheng.chen <pi-cheng.chen@linaro.org>
---
drivers/cpufreq/cpufreq-dt.c | 15 +++++++++++++++
include/linux/cpufreq-dt.h | 6 ++++++
2 files changed, 21 insertions(+)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index fde97d6..ff8c266 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -296,6 +296,21 @@ static int cpufreq_init(struct cpufreq_policy *policy)
pd = cpufreq_get_driver_data();
if (!pd || !pd->independent_clocks)
cpumask_setall(policy->cpus);
+ else if (pd && !list_empty(&pd->domain_list)) {
+ struct list_head *domain_node;
+
+ list_for_each(domain_node, &pd->domain_list) {
+ struct cpufreq_cpu_domain *domain;
+
+ domain = container_of(domain_node,
+ struct cpufreq_cpu_domain, node);
+ if (!cpumask_test_cpu(policy->cpu, &domain->cpus))
+ continue;
+
+ cpumask_copy(policy->cpus, &domain->cpus);
+ break;
+ }
+ }
of_node_put(np);
diff --git a/include/linux/cpufreq-dt.h b/include/linux/cpufreq-dt.h
index 0414009..92bffd3 100644
--- a/include/linux/cpufreq-dt.h
+++ b/include/linux/cpufreq-dt.h
@@ -10,6 +10,11 @@
#ifndef __CPUFREQ_DT_H__
#define __CPUFREQ_DT_H__
+struct cpufreq_cpu_domain {
+ struct list_head node;
+ cpumask_t cpus;
+};
+
struct cpufreq_dt_platform_data {
/*
* True when each CPU has its own clock to control its
@@ -17,6 +22,7 @@ struct cpufreq_dt_platform_data {
* clock.
*/
bool independent_clocks;
+ struct list_head domain_list;
};
#endif /* __CPUFREQ_DT_H__ */
--
1.9.1
next prev parent reply other threads:[~2015-01-09 9:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 9:54 [PATCH 0/2] cpufreq: add cpufreq driver for Mediatek MT8173 SoC pi-cheng.chen
2015-01-09 9:54 ` pi-cheng.chen [this message]
2015-01-19 8:00 ` [PATCH 1/2] cpufreq-dt: check CPU clock/power domain during initializing Viresh Kumar
2015-01-20 7:33 ` Pi-Cheng Chen
2015-01-20 7:39 ` Viresh Kumar
2015-01-20 8:47 ` Pi-Cheng Chen
2015-01-09 9:54 ` [PATCH 2/2] cpufreq: add cpufreq driver for Mediatek MT8173 SoC pi-cheng.chen
2015-01-14 7:43 ` Yingjoe Chen
2015-01-15 2:02 ` Pi-Cheng Chen
2015-01-19 10:42 ` Viresh Kumar
2015-01-20 7:06 ` Pi-Cheng Chen
2015-01-19 16:00 ` Mike Turquette
2015-01-20 7:18 ` Pi-Cheng Chen
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=1420797291-15972-2-git-send-email-pi-cheng.chen@linaro.org \
--to=pi-cheng.chen@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).