Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-blackfin/dpmc.h - Miscellaneous IOCTL commands for Dynamic Power |
| 3 | * Management Controller Driver. |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 4 | * Copyright (C) 2004-2008 Analog Device Inc. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 5 | * |
| 6 | */ |
| 7 | #ifndef _BLACKFIN_DPMC_H_ |
| 8 | #define _BLACKFIN_DPMC_H_ |
| 9 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 10 | #ifdef __KERNEL__ |
Michael Hennerich | 1efc80b | 2008-07-19 16:57:32 +0800 | [diff] [blame] | 11 | #ifndef __ASSEMBLY__ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 12 | |
Michael Hennerich | cfefe3c | 2008-02-09 04:12:37 +0800 | [diff] [blame] | 13 | void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 14 | void deep_sleep(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 15 | void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
| 16 | void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2); |
Michael Hennerich | 1efc80b | 2008-07-19 16:57:32 +0800 | [diff] [blame] | 17 | void do_hibernate(int wakeup); |
| 18 | void set_dram_srfs(void); |
| 19 | void unset_dram_srfs(void); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 20 | |
Michael Hennerich | 1efc80b | 2008-07-19 16:57:32 +0800 | [diff] [blame] | 21 | #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 22 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 23 | struct bfin_dpmc_platform_data { |
| 24 | const unsigned int *tuple_tab; |
| 25 | unsigned short tabsize; |
| 26 | unsigned short vr_settling_time; /* in us */ |
| 27 | }; |
| 28 | |
Michael Hennerich | 1efc80b | 2008-07-19 16:57:32 +0800 | [diff] [blame] | 29 | #else |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 30 | |
Michael Hennerich | 1efc80b | 2008-07-19 16:57:32 +0800 | [diff] [blame] | 31 | #define PM_PUSH(x) \ |
| 32 | R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\ |
| 33 | [--SP] = R0;\ |
| 34 | |
| 35 | #define PM_POP(x) \ |
| 36 | R0 = [SP++];\ |
| 37 | [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\ |
| 38 | |
| 39 | #define PM_SYS_PUSH(x) \ |
| 40 | R0 = [P0 + (x - PLL_CTL)];\ |
| 41 | [--SP] = R0;\ |
| 42 | |
| 43 | #define PM_SYS_POP(x) \ |
| 44 | R0 = [SP++];\ |
| 45 | [P0 + (x - PLL_CTL)] = R0;\ |
| 46 | |
| 47 | #define PM_SYS_PUSH16(x) \ |
| 48 | R0 = w[P0 + (x - PLL_CTL)];\ |
| 49 | [--SP] = R0;\ |
| 50 | |
| 51 | #define PM_SYS_POP16(x) \ |
| 52 | R0 = [SP++];\ |
| 53 | w[P0 + (x - PLL_CTL)] = R0;\ |
| 54 | |
| 55 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 56 | #endif /* __KERNEL__ */ |
| 57 | |
| 58 | #endif /*_BLACKFIN_DPMC_H_*/ |