devfreq hack

parent ef903bb1
......@@ -479,6 +479,9 @@ opp-100M {
opp-800M {
opp-hz = /bits/ 64 <800000000>;
};
opp-801M {
opp-hz = /bits/ 64 <800000001>;
};
};
};
......
......@@ -1252,6 +1252,9 @@ opp-133M {
opp-400M {
opp-hz = /bits/ 64 <400000000>;
};
opp-401M {
opp-hz = /bits/ 64 <400000001>;
};
opp-800M {
opp-hz = /bits/ 64 <800000000>;
};
......
......@@ -244,7 +244,7 @@ static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags)
dev_pm_opp_put(new_opp);
old_freq = clk_get_rate(priv->dram_core);
if (*freq == old_freq)
if (DIV_ROUND_CLOSEST(*freq, 250000) == DIV_ROUND_CLOSEST(old_freq, 250000))
return 0;
freq_info = imx8m_ddrc_find_freq(priv, *freq);
......@@ -261,7 +261,7 @@ static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags)
if (ret)
dev_err(dev, "ddrc failed freq switch to %lu from %lu: error %d. now at %lu\n",
*freq, old_freq, ret, new_freq);
else if (*freq != new_freq)
else if (DIV_ROUND_CLOSEST(*freq, 250000) != DIV_ROUND_CLOSEST(new_freq, 250000))
dev_err(dev, "ddrc failed freq update to %lu from %lu, now at %lu\n",
*freq, old_freq, new_freq);
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment