cpuidle.c 724 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * ARM64 CPU idle arch support
  3. *
  4. * Copyright (C) 2014 ARM Ltd.
  5. * Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/of.h>
  12. #include <linux/of_device.h>
  13. #include <asm/cpuidle.h>
  14. #include <asm/cpu_ops.h>
  15. int cpu_init_idle(unsigned int cpu)
  16. {
  17. int ret = -EOPNOTSUPP;
  18. struct device_node *cpu_node = of_cpu_device_node_get(cpu);
  19. if (!cpu_node)
  20. return -ENODEV;
  21. if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_init_idle)
  22. ret = cpu_ops[cpu]->cpu_init_idle(cpu_node, cpu);
  23. of_node_put(cpu_node);
  24. return ret;
  25. }