Merge branch 'cpufreq/scmi' into cpufreq/arm/linux-next
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 8 Dec 2020 05:52:17 +0000 (11:22 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 8 Dec 2020 05:52:17 +0000 (11:22 +0530)
1  2 
drivers/cpufreq/scmi-cpufreq.c

@@@ -8,7 -8,6 +8,7 @@@
  
  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  
 +#include <linux/clk-provider.h>
  #include <linux/cpu.h>
  #include <linux/cpufreq.h>
  #include <linux/cpumask.h>
@@@ -126,6 -125,7 +126,7 @@@ static int scmi_cpufreq_init(struct cpu
        struct scmi_data *priv;
        struct cpufreq_frequency_table *freq_table;
        struct em_data_callback em_cb = EM_DATA_CB(scmi_get_cpu_power);
+       bool power_scale_mw;
  
        cpu_dev = get_cpu_device(policy->cpu);
        if (!cpu_dev) {
        policy->fast_switch_possible =
                handle->perf_ops->fast_switch_possible(handle, cpu_dev);
  
-       em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus);
+       power_scale_mw = handle->perf_ops->power_scale_mw_get(handle);
+       em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
+                                   power_scale_mw);
  
        return 0;
  
@@@ -229,22 -231,15 +232,22 @@@ static struct cpufreq_driver scmi_cpufr
  static int scmi_cpufreq_probe(struct scmi_device *sdev)
  {
        int ret;
 +      struct device *dev = &sdev->dev;
  
        handle = sdev->handle;
  
        if (!handle || !handle->perf_ops)
                return -ENODEV;
  
 +#ifdef CONFIG_COMMON_CLK
 +      /* dummy clock provider as needed by OPP if clocks property is used */
 +      if (of_find_property(dev->of_node, "#clock-cells", NULL))
 +              devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
 +#endif
 +
        ret = cpufreq_register_driver(&scmi_cpufreq_driver);
        if (ret) {
 -              dev_err(&sdev->dev, "%s: registering cpufreq failed, err: %d\n",
 +              dev_err(dev, "%s: registering cpufreq failed, err: %d\n",
                        __func__, ret);
        }