]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm64/kernel/cpuidle.c
arm64: kernel: remove ARM64_CPU_SUSPEND config option
[karo-tx-linux.git] / arch / arm64 / kernel / cpuidle.c
index 19d17f51db37a798c797b125795844b7a5d99e92..5c0896647fd14e83e3d410e450e7085894c24484 100644 (file)
@@ -29,3 +29,23 @@ int cpu_init_idle(unsigned int cpu)
        of_node_put(cpu_node);
        return ret;
 }
+
+/**
+ * cpu_suspend() - function to enter a low-power idle state
+ * @arg: argument to pass to CPU suspend operations
+ *
+ * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
+ * operations back-end error code otherwise.
+ */
+int cpu_suspend(unsigned long arg)
+{
+       int cpu = smp_processor_id();
+
+       /*
+        * If cpu_ops have not been registered or suspend
+        * has not been initialized, cpu_suspend call fails early.
+        */
+       if (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend)
+               return -EOPNOTSUPP;
+       return cpu_ops[cpu]->cpu_suspend(arg);
+}