cpufreq: dt: Allow platform specific intermediate callbacks
authorPeng Fan <peng.fan@nxp.com>
Wed, 19 Feb 2020 07:59:53 +0000 (15:59 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 12 Mar 2020 10:13:52 +0000 (15:43 +0530)
Platforms may need to implement platform specific get_intermediate and
target_intermediate hooks.

Update cpufreq-dt driver's platform data to contain those for such
platforms.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq-dt.c
drivers/cpufreq/cpufreq-dt.h

index d2b5f06..26fe8df 100644 (file)
@@ -363,6 +363,10 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
                dt_cpufreq_driver.resume = data->resume;
                if (data->suspend)
                        dt_cpufreq_driver.suspend = data->suspend;
+               if (data->get_intermediate) {
+                       dt_cpufreq_driver.target_intermediate = data->target_intermediate;
+                       dt_cpufreq_driver.get_intermediate = data->get_intermediate;
+               }
        }
 
        ret = cpufreq_register_driver(&dt_cpufreq_driver);
index a5a45b5..28c8af7 100644 (file)
@@ -14,6 +14,10 @@ struct cpufreq_policy;
 struct cpufreq_dt_platform_data {
        bool have_governor_per_policy;
 
+       unsigned int    (*get_intermediate)(struct cpufreq_policy *policy,
+                                           unsigned int index);
+       int             (*target_intermediate)(struct cpufreq_policy *policy,
+                                              unsigned int index);
        int (*suspend)(struct cpufreq_policy *policy);
        int (*resume)(struct cpufreq_policy *policy);
 };