pm.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * include/asm-arm/arch-pnx4008/pm.h
  3. *
  4. * PNX4008 Power Management Routiness - header file
  5. *
  6. * Authors: Vitaly Wool, Dmitry Chigirev <source@mvista.com>
  7. *
  8. * 2005 (c) MontaVista Software, Inc. This file is licensed under
  9. * the terms of the GNU General Public License version 2. This program
  10. * is licensed "as is" without any warranty of any kind, whether express
  11. * or implied.
  12. */
  13. #ifndef __ASM_ARCH_PNX4008_PM_H
  14. #define __ASM_ARCH_PNX4008_PM_H
  15. #ifndef __ASSEMBLER__
  16. #include "irq.h"
  17. #include "irqs.h"
  18. #include "clock.h"
  19. extern void pnx4008_pm_idle(void);
  20. extern void pnx4008_pm_suspend(void);
  21. extern unsigned int pnx4008_cpu_suspend_sz;
  22. extern void pnx4008_cpu_suspend(void);
  23. extern unsigned int pnx4008_cpu_standby_sz;
  24. extern void pnx4008_cpu_standby(void);
  25. extern int pnx4008_startup_pll(struct clk *);
  26. extern int pnx4008_shutdown_pll(struct clk *);
  27. static inline void start_int_umask(u8 irq)
  28. {
  29. __raw_writel(__raw_readl(START_INT_ER_REG(irq)) |
  30. START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
  31. }
  32. static inline void start_int_mask(u8 irq)
  33. {
  34. __raw_writel(__raw_readl(START_INT_ER_REG(irq)) &
  35. ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq));
  36. }
  37. static inline void start_int_ack(u8 irq)
  38. {
  39. __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq));
  40. }
  41. static inline void start_int_set_falling_edge(u8 irq)
  42. {
  43. __raw_writel(__raw_readl(START_INT_APR_REG(irq)) &
  44. ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
  45. }
  46. static inline void start_int_set_rising_edge(u8 irq)
  47. {
  48. __raw_writel(__raw_readl(START_INT_APR_REG(irq)) |
  49. START_INT_REG_BIT(irq), START_INT_APR_REG(irq));
  50. }
  51. #endif /* ASSEMBLER */
  52. #endif /* __ASM_ARCH_PNX4008_PM_H */