diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2019-02-12 10:06:47 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-02-13 01:48:45 +0300 |
commit | 263abfe74b5f1058887b14e7668b0d737e040e42 (patch) | |
tree | 58c4a95ac56cf963091bc30fae7e1a56eb924843 /drivers/cpufreq/cpufreq-dt.c | |
parent | 91a12e91dc39137906d929a4ff6f9c32c59697fa (diff) | |
download | linux-263abfe74b5f1058887b14e7668b0d737e040e42.tar.xz |
cpufreq: dt: Implement online/offline() callbacks
Implement the light-weight tear down and bring up helpers to reduce the
amount of work to do on CPU offline/online operation.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq-dt.c')
-rw-r--r-- | drivers/cpufreq/cpufreq-dt.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 7ba392911cd0..1aefaa1b0ca2 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -295,6 +295,21 @@ out_put_clk: return ret; } +static int cpufreq_online(struct cpufreq_policy *policy) +{ + /* We did light-weight tear down earlier, nothing to do here */ + return 0; +} + +static int cpufreq_offline(struct cpufreq_policy *policy) +{ + /* + * Preserve policy->driver_data and don't free resources on light-weight + * tear down. + */ + return 0; +} + static int cpufreq_exit(struct cpufreq_policy *policy) { struct private_data *priv = policy->driver_data; @@ -319,6 +334,8 @@ static struct cpufreq_driver dt_cpufreq_driver = { .get = cpufreq_generic_get, .init = cpufreq_init, .exit = cpufreq_exit, + .online = cpufreq_online, + .offline = cpufreq_offline, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend, |