From: Viresh Kumar Date: Tue, 12 Feb 2019 07:06:47 +0000 (+0530) Subject: cpufreq: dt: Implement online/offline() callbacks X-Git-Tag: submit/tizen/20190329.020226~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85d986cd0f071770713d94ff5eb4adcaff24fecf;p=platform%2Fkernel%2Flinux-exynos.git 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 [pending patch for mainline] Signed-off-by: Marek Szyprowski Change-Id: I02a01f0f4d5c24102bcc58089937c371cc126b65 --- diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index ca6ee9f389b6..16488065ebaf 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; @@ -352,6 +367,8 @@ static struct cpufreq_driver dt_cpufreq_driver = { .init = cpufreq_init, .exit = cpufreq_exit, .ready = cpufreq_ready, + .online = cpufreq_online, + .offline = cpufreq_offline, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend,