pm-imx3.c 1006 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * The code contained herein is licensed under the GNU General Public
  5. * License. You may obtain a copy of the GNU General Public License
  6. * Version 2 or later at the following locations:
  7. *
  8. * http://www.opensource.org/licenses/gpl-license.html
  9. * http://www.gnu.org/copyleft/gpl.html
  10. */
  11. #include <linux/io.h>
  12. #include <mach/common.h>
  13. #include <mach/hardware.h>
  14. #include <mach/devices-common.h>
  15. #include "crmregs-imx3.h"
  16. /*
  17. * Set cpu low power mode before WFI instruction. This function is called
  18. * mx3 because it can be used for mx31 and mx35.
  19. * Currently only WAIT_MODE is supported.
  20. */
  21. void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode)
  22. {
  23. int reg = __raw_readl(MXC_CCM_CCMR);
  24. reg &= ~MXC_CCM_CCMR_LPM_MASK;
  25. switch (mode) {
  26. case MX3_WAIT:
  27. if (cpu_is_mx35())
  28. reg |= MXC_CCM_CCMR_LPM_WAIT_MX35;
  29. __raw_writel(reg, MXC_CCM_CCMR);
  30. break;
  31. default:
  32. pr_err("Unknown cpu power mode: %d\n", mode);
  33. return;
  34. }
  35. }