Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[linux-2.6.git] / arch / blackfin / include / asm / dpmc.h
1 /*
2  * Miscellaneous IOCTL commands for Dynamic Power Management Controller Driver
3  *
4  * Copyright (C) 2004-2008 Analog Device Inc.
5  *
6  * Licensed under the GPL-2
7  */
8
9 #ifndef _BLACKFIN_DPMC_H_
10 #define _BLACKFIN_DPMC_H_
11
12 #ifdef __KERNEL__
13 #ifndef __ASSEMBLY__
14
15 void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
16 void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
17 void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
18 void do_hibernate(int wakeup);
19 void set_dram_srfs(void);
20 void unset_dram_srfs(void);
21
22 #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
23
24 struct bfin_dpmc_platform_data {
25         const unsigned int *tuple_tab;
26         unsigned short tabsize;
27         unsigned short vr_settling_time; /* in us */
28 };
29
30 #else
31
32 #define PM_PUSH(x) \
33         R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\
34         [--SP] =  R0;\
35
36 #define PM_POP(x) \
37         R0 = [SP++];\
38         [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\
39
40 #define PM_SYS_PUSH(x) \
41         R0 = [P0 + (x - PLL_CTL)];\
42         [--SP] =  R0;\
43
44 #define PM_SYS_POP(x) \
45         R0 = [SP++];\
46         [P0 + (x - PLL_CTL)] = R0;\
47
48 #define PM_SYS_PUSH16(x) \
49         R0 = w[P0 + (x - PLL_CTL)];\
50         [--SP] =  R0;\
51
52 #define PM_SYS_POP16(x) \
53         R0 = [SP++];\
54         w[P0 + (x - PLL_CTL)] = R0;\
55
56 #endif
57 #endif  /* __KERNEL__ */
58
59 #endif  /*_BLACKFIN_DPMC_H_*/