cpufreq: tegra194: get consistent cpuinfo_cur_freq
authorSumit Gupta <sumitg@nvidia.com>
Wed, 14 Oct 2020 09:36:11 +0000 (15:06 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Mon, 7 Dec 2020 07:32:37 +0000 (13:02 +0530)
commit68b9cd7270f0191bd51b635f8f4778951ee3811a
tree7eae5b3e7b406878fe2412544fab370b6855313f
parent75118c8ef9d16ecbb56e37547061515c75bb91b4
cpufreq: tegra194: get consistent cpuinfo_cur_freq

Frequency returned by 'cpuinfo_cur_freq' using counters is not fixed
and keeps changing slightly. This change returns a consistent value
from freq_table. If the reconstructed frequency has acceptable delta
from the last written value, then return the frequency corresponding
to the last written ndiv value from freq_table. Otherwise, print a
warning and return the reconstructed freq.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/tegra194-cpufreq.c