summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-10-27 23:40:15 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:28:55 +0800
commitae4cd299d229b8debe8223a1569ffef42b938f6a (patch)
tree46432a1d84d8daecd1b3e0eb432c0213cc11eb7a /drivers/cpufreq
parent1eeaf729d3be0e919cac87b21810f2e0a9dec30a (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 a55b3399e6ca..1200726bea6d 100644
--- a/drivers/cpufreq/imx8mq-cpufreq.c
+++ b/drivers/cpufreq/imx8mq-cpufreq.c
@@ -149,7 +149,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) {
@@ -178,10 +178,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);