mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
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>
This commit is contained in:
parent
91a12e91dc
commit
263abfe74b
1 changed files with 17 additions and 0 deletions
|
@ -295,6 +295,21 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
||||||
return ret;
|
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)
|
static int cpufreq_exit(struct cpufreq_policy *policy)
|
||||||
{
|
{
|
||||||
struct private_data *priv = policy->driver_data;
|
struct private_data *priv = policy->driver_data;
|
||||||
|
@ -319,6 +334,8 @@ static struct cpufreq_driver dt_cpufreq_driver = {
|
||||||
.get = cpufreq_generic_get,
|
.get = cpufreq_generic_get,
|
||||||
.init = cpufreq_init,
|
.init = cpufreq_init,
|
||||||
.exit = cpufreq_exit,
|
.exit = cpufreq_exit,
|
||||||
|
.online = cpufreq_online,
|
||||||
|
.offline = cpufreq_offline,
|
||||||
.name = "cpufreq-dt",
|
.name = "cpufreq-dt",
|
||||||
.attr = cpufreq_dt_attr,
|
.attr = cpufreq_dt_attr,
|
||||||
.suspend = cpufreq_generic_suspend,
|
.suspend = cpufreq_generic_suspend,
|
||||||
|
|
Loading…
Reference in a new issue