cpufreq: dt: Implement online/offline() callbacks 83/199783/2
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 12 Feb 2019 07:06:47 +0000 (12:36 +0530)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 18 Feb 2019 04:54:43 +0000 (04:54 +0000)
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>
[pending patch for mainline]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I02a01f0f4d5c24102bcc58089937c371cc126b65

drivers/cpufreq/cpufreq-dt.c

index ca6ee9f..1648806 100644 (file)
@@ -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,