Lines Matching refs:freq
82 struct imx8m_ddrc_freq *freq; in imx8m_ddrc_find_freq() local
91 freq = &priv->freq_table[i]; in imx8m_ddrc_find_freq()
92 if (freq->rate == rate || in imx8m_ddrc_find_freq()
93 freq->rate + 1 == rate || in imx8m_ddrc_find_freq()
94 freq->rate - 1 == rate) in imx8m_ddrc_find_freq()
95 return freq; in imx8m_ddrc_find_freq()
128 static int imx8m_ddrc_set_freq(struct device *dev, struct imx8m_ddrc_freq *freq) in imx8m_ddrc_set_freq() argument
143 priv->dram_core, freq->dram_core_parent_index - 1); in imx8m_ddrc_set_freq()
148 if (freq->dram_alt_parent_index) { in imx8m_ddrc_set_freq()
151 freq->dram_alt_parent_index - 1); in imx8m_ddrc_set_freq()
159 if (freq->dram_apb_parent_index) { in imx8m_ddrc_set_freq()
162 freq->dram_apb_parent_index - 1); in imx8m_ddrc_set_freq()
190 imx8m_ddrc_smc_set_freq(freq->smcarg); in imx8m_ddrc_set_freq()
230 static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags) in imx8m_ddrc_target() argument
238 new_opp = devfreq_recommended_opp(dev, freq, flags); in imx8m_ddrc_target()
247 if (*freq == old_freq) in imx8m_ddrc_target()
250 freq_info = imx8m_ddrc_find_freq(priv, *freq); in imx8m_ddrc_target()
263 *freq, old_freq, ret, new_freq); in imx8m_ddrc_target()
264 else if (*freq != new_freq) in imx8m_ddrc_target()
266 *freq, old_freq, new_freq); in imx8m_ddrc_target()
269 *freq, old_freq); in imx8m_ddrc_target()
274 static int imx8m_ddrc_get_cur_freq(struct device *dev, unsigned long *freq) in imx8m_ddrc_get_cur_freq() argument
278 *freq = clk_get_rate(priv->dram_core); in imx8m_ddrc_get_cur_freq()
298 struct imx8m_ddrc_freq *freq = &priv->freq_table[index]; in imx8m_ddrc_init_freq_info() local
306 freq->rate = res.a0; in imx8m_ddrc_init_freq_info()
307 freq->smcarg = index; in imx8m_ddrc_init_freq_info()
308 freq->dram_core_parent_index = res.a1; in imx8m_ddrc_init_freq_info()
309 freq->dram_alt_parent_index = res.a2; in imx8m_ddrc_init_freq_info()
310 freq->dram_apb_parent_index = res.a3; in imx8m_ddrc_init_freq_info()
313 if (freq->dram_core_parent_index != 1 && in imx8m_ddrc_init_freq_info()
314 freq->dram_core_parent_index != 2) in imx8m_ddrc_init_freq_info()
317 if (freq->dram_alt_parent_index > 8 || in imx8m_ddrc_init_freq_info()
318 freq->dram_apb_parent_index > 8) in imx8m_ddrc_init_freq_info()
321 if (freq->dram_core_parent_index == 2 && in imx8m_ddrc_init_freq_info()
322 freq->dram_alt_parent_index == 0) in imx8m_ddrc_init_freq_info()
334 unsigned long freq; in imx8m_ddrc_check_opps() local
341 for (i = 0, freq = 0; i < opp_count; ++i, ++freq) { in imx8m_ddrc_check_opps()
342 opp = dev_pm_opp_find_freq_ceil(dev, &freq); in imx8m_ddrc_check_opps()
350 freq_info = imx8m_ddrc_find_freq(priv, freq); in imx8m_ddrc_check_opps()
353 freq, DIV_ROUND_CLOSEST(freq, 250000)); in imx8m_ddrc_check_opps()
354 dev_pm_opp_disable(dev, freq); in imx8m_ddrc_check_opps()