Merge branch 'cpufreq-scpi'

* cpufreq-scpi:
  cpufreq: scpi: Fix incorrect arm_big_little config dependency
  cpufreq: scpi: invoke frequency-invariance setter function
This commit is contained in:
Rafael J. Wysocki 2018-03-02 10:44:44 +01:00
commit b61e070305
2 changed files with 15 additions and 7 deletions

View File

@ -44,10 +44,10 @@ config ARM_DT_BL_CPUFREQ
config ARM_SCPI_CPUFREQ config ARM_SCPI_CPUFREQ
tristate "SCPI based CPUfreq driver" tristate "SCPI based CPUfreq driver"
depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI depends on ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI
help help
This adds the CPUfreq driver support for ARM big.LITTLE platforms This adds the CPUfreq driver support for ARM platforms using SCPI
using SCPI protocol for CPU power management. protocol for CPU power management.
This driver uses SCPI Message Protocol driver to interact with the This driver uses SCPI Message Protocol driver to interact with the
firmware providing the CPU DVFS functionality. firmware providing the CPU DVFS functionality.

View File

@ -51,15 +51,23 @@ static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
static int static int
scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
{ {
unsigned long freq = policy->freq_table[index].frequency;
struct scpi_data *priv = policy->driver_data; struct scpi_data *priv = policy->driver_data;
u64 rate = policy->freq_table[index].frequency * 1000; u64 rate = freq * 1000;
int ret; int ret;
ret = clk_set_rate(priv->clk, rate); ret = clk_set_rate(priv->clk, rate);
if (!ret && (clk_get_rate(priv->clk) != rate))
ret = -EIO;
return ret; if (ret)
return ret;
if (clk_get_rate(priv->clk) != rate)
return -EIO;
arch_set_freq_scale(policy->related_cpus, freq,
policy->cpuinfo.max_freq);
return 0;
} }
static int static int