cpufreq: mediatek: Link CCI device to CPU
authorRex-BC Chen <rex-bc.chen@mediatek.com>
Thu, 5 May 2022 11:52:22 +0000 (19:52 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 12 May 2022 05:09:31 +0000 (10:39 +0530)
commit0daa47325baee6bb1412498462fd0a0477c32cc6
tree0f2145def718101e67c631849b49ed3902a76de7
parent818c8321d8def50971188b8b33ef2a43ca1e2511
cpufreq: mediatek: Link CCI device to CPU

In some MediaTek SoCs, like MT8183, CPU and CCI share the same power
supplies. Cpufreq needs to check if CCI devfreq exists and wait until
CCI devfreq ready before scaling frequency.

Before CCI devfreq is ready, we record the voltage when booting to
kernel and use the max(cpu target voltage, booting voltage) to
prevent cpufreq adjust to the lower voltage which will cause the CCI
crash because of high frequency and low voltage.

- Add is_ccifreq_ready() to link CCI device to CPI, and CPU will start
  DVFS when CCI is ready.
- Add platform data for MT8183.

Signed-off-by: Jia-Wei Chang <jia-wei.chang@mediatek.com>
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/mediatek-cpufreq.c