power.c 539 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2017 Intel Corporation.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <zephyr.h>
  7. #include <pm/pm.h>
  8. #include <soc.h>
  9. #include <arch/arm/aarch32/cortex_m/cmsis.h>
  10. /* Invoke Low Power/System Off specific Tasks */
  11. void pm_power_state_set(struct pm_state_info info)
  12. {
  13. if(!pm_is_sleep_state(info.state))
  14. soc_enter_deep_sleep();
  15. else
  16. soc_enter_light_sleep();
  17. }
  18. /* Handle SOC specific activity after Low Power Mode Exit */
  19. void pm_power_state_exit_post_ops(struct pm_state_info info)
  20. {
  21. irq_unlock(0);
  22. }