Vitaly Wool | a5a5030 | 2006-05-16 11:54:36 +0100 | [diff] [blame^] | 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 | |
| 14 | #ifndef __ASM_ARCH_PNX4008_PM_H |
| 15 | #define __ASM_ARCH_PNX4008_PM_H |
| 16 | |
| 17 | #ifndef __ASSEMBLER__ |
| 18 | #include "irq.h" |
| 19 | #include "irqs.h" |
| 20 | #include "clock.h" |
| 21 | |
| 22 | extern void pnx4008_pm_idle(void); |
| 23 | extern void pnx4008_pm_suspend(void); |
| 24 | extern unsigned int pnx4008_cpu_suspend_sz; |
| 25 | extern void pnx4008_cpu_suspend(void); |
| 26 | extern unsigned int pnx4008_cpu_standby_sz; |
| 27 | extern void pnx4008_cpu_standby(void); |
| 28 | |
| 29 | extern int pnx4008_startup_pll(struct clk *); |
| 30 | extern int pnx4008_shutdown_pll(struct clk *); |
| 31 | |
| 32 | static inline void start_int_umask(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 | |
| 38 | static inline void start_int_mask(u8 irq) |
| 39 | { |
| 40 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) & |
| 41 | ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); |
| 42 | } |
| 43 | |
| 44 | static inline void start_int_ack(u8 irq) |
| 45 | { |
| 46 | __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq)); |
| 47 | } |
| 48 | |
| 49 | static inline void start_int_set_falling_edge(u8 irq) |
| 50 | { |
| 51 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) & |
| 52 | ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); |
| 53 | } |
| 54 | |
| 55 | static inline void start_int_set_rising_edge(u8 irq) |
| 56 | { |
| 57 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) | |
| 58 | START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); |
| 59 | } |
| 60 | |
| 61 | #endif /* ASSEMBLER */ |
| 62 | #endif /* __ASM_ARCH_PNX4008_PM_H */ |