summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-10-27 23:40:15 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commita296cf6511cd645732f11db2b7f9a2364305824c (patch)
tree8a53a986bbb3616e63948e310be2bda03f832082 /drivers/cpufreq
parentaae8cb1487fc2b2d03c07d50dc3a15d9bd98ff66 (diff)
MLK-16710 cpufreq: imx8mq: avoid duplicated OPP table initialization
On i.MX8MQ, since the OPP table is initialized in cpu-freq platform device register according to chip type, so no need to redo the OPP table initialization in cpu-freq driver, this patch adds check for OPP table initialization to avoid below warning during boot up: [ 1.468378] cpu cpu0: _opp_add: duplicate OPPs detected. Existing: freq: 1501 [ 1.468388] cpu cpu0: _opp_add: duplicate OPPs detected. Existing: freq: 1301 [ 1.468417] cpu cpu0: _of_add_opp_table_v1: Failed to add OPP 1300000000 [ 1.468425] cpu cpu0: _opp_add: duplicate OPPs detected. Existing: freq: 1001 [ 1.468434] cpu cpu0: _opp_add: duplicate OPPs detected. Existing: freq: 8001 [ 1.468443] cpu cpu0: _of_add_opp_table_v1: Failed to add OPP 800000000 Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/imx8mq-cpufreq.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/cpufreq/imx8mq-cpufreq.c b/drivers/cpufreq/imx8mq-cpufreq.c
index 16feb3fb86b5..ee3725db048b 100644
--- a/drivers/cpufreq/imx8mq-cpufreq.c
+++ b/drivers/cpufreq/imx8mq-cpufreq.c
@@ -150,7 +150,7 @@ static struct cpufreq_driver imx8mq_cpufreq_driver = {
static int imx8mq_cpufreq_probe(struct platform_device *pdev)
{
struct device_node *np;
- int ret;
+ int ret, num;
cpu_dev = get_cpu_device(0);
if (!cpu_dev) {
@@ -179,10 +179,18 @@ static int imx8mq_cpufreq_probe(struct platform_device *pdev)
dc_reg = regulator_get_optional(cpu_dev, "dc");
- ret = dev_pm_opp_of_add_table(cpu_dev);
- if (ret < 0) {
- dev_err(cpu_dev, "failed to init OPP table: %d\n", ret);
- goto put_clk;
+ /*
+ * 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 = dev_pm_opp_of_add_table(cpu_dev);
+ if (ret < 0) {
+ dev_err(cpu_dev, "failed to init OPP table: %d\n", ret);
+ goto put_clk;
+ }
}
ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);