From: john.tobias.ph@gmail.com (John Tobias)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/2] cpufreq: imx6q: add of_init_opp_table
Date: Thu, 19 Dec 2013 20:15:29 -0800 [thread overview]
Message-ID: <1387512929-7304-2-git-send-email-john.tobias.ph@gmail.com> (raw)
In-Reply-To: <1387512929-7304-1-git-send-email-john.tobias.ph@gmail.com>
Add a routine check to see if the platform supplied the OPP table.
Incase there's not OPP table exist, it will try to get it.
Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
---
drivers/cpufreq/imx6q-cpufreq.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 4b3f18e..f261a88 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -187,12 +187,25 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
goto put_node;
}
- /* We expect an OPP table supplied by platform */
+ /* We expect an OPP table supplied by platform.
+ * Just, incase the platform did not supply the OPP
+ * table, it will try to get it.
+ */
num = dev_pm_opp_get_opp_count(cpu_dev);
if (num < 0) {
- ret = num;
- dev_err(cpu_dev, "no OPP table is found: %d\n", ret);
- goto put_node;
+ ret = of_init_opp_table(cpu_dev);
+ if (ret < 0) {
+ dev_err(cpu_dev, "failed to init OPP table\n");
+ ret = -ENODEV;
+ goto put_node;
+ }
+
+ num = dev_pm_opp_get_opp_count(cpu_dev);
+ if (num < 0) {
+ ret = num;
+ dev_err(cpu_dev, "no OPP table is found: %d\n", ret);
+ goto put_node;
+ }
}
ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
--
1.8.3.2
next prev parent reply other threads:[~2013-12-20 4:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 4:15 [PATCH v3 1/2] ARM: imx6sl: Add cpu frequency scaling support John Tobias
2013-12-20 4:15 ` John Tobias [this message]
2013-12-20 6:06 ` [PATCH v3 2/2] cpufreq: imx6q: add of_init_opp_table Shawn Guo
2013-12-20 5:56 ` [PATCH v3 1/2] ARM: imx6sl: Add cpu frequency scaling support Shawn Guo
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=1387512929-7304-2-git-send-email-john.tobias.ph@gmail.com \
--to=john.tobias.ph@gmail.com \
--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).