arm64: dts: rockchip: amend usb-otg related nodes for rk3368-tb
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / cpuidle.c
index 19d17f51db37a798c797b125795844b7a5d99e92..9047cab68fd3494ebf1c634f137fddcfde955932 100644 (file)
 #include <asm/cpuidle.h>
 #include <asm/cpu_ops.h>
 
-int cpu_init_idle(unsigned int cpu)
+int __init arm_cpuidle_init(unsigned int cpu)
 {
        int ret = -EOPNOTSUPP;
-       struct device_node *cpu_node = of_cpu_device_node_get(cpu);
-
-       if (!cpu_node)
-               return -ENODEV;
 
        if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_init_idle)
-               ret = cpu_ops[cpu]->cpu_init_idle(cpu_node, cpu);
+               ret = cpu_ops[cpu]->cpu_init_idle(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 arm_cpuidle_suspend(int index)
+{
+       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(index);
+}