blob: 925e66cb2d49273581ec44c09b9ffe339dab19b4 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Miscellaneous IOCTL commands for Dynamic Power Management Controller Driver
3 *
Michael Hennerich14b03202008-05-07 11:41:26 +08004 * Copyright (C) 2004-2008 Analog Device Inc.
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2
Bryan Wu1394f032007-05-06 14:50:22 -07007 */
Robin Getz96f10502009-09-24 14:11:24 +00008
Bryan Wu1394f032007-05-06 14:50:22 -07009#ifndef _BLACKFIN_DPMC_H_
10#define _BLACKFIN_DPMC_H_
11
Bryan Wu1394f032007-05-06 14:50:22 -070012#ifdef __KERNEL__
Michael Hennerich1efc80b2008-07-19 16:57:32 +080013#ifndef __ASSEMBLY__
Bryan Wu1394f032007-05-06 14:50:22 -070014
Michael Hennerichcfefe3c2008-02-09 04:12:37 +080015void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
Michael Hennerichcfefe3c2008-02-09 04:12:37 +080016void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
17void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
Michael Hennerich1efc80b2008-07-19 16:57:32 +080018void do_hibernate(int wakeup);
19void set_dram_srfs(void);
20void unset_dram_srfs(void);
Bryan Wu1394f032007-05-06 14:50:22 -070021
Michael Hennerich1efc80b2008-07-19 16:57:32 +080022#define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
Bryan Wu1394f032007-05-06 14:50:22 -070023
Michael Hennerich14b03202008-05-07 11:41:26 +080024struct bfin_dpmc_platform_data {
25 const unsigned int *tuple_tab;
26 unsigned short tabsize;
27 unsigned short vr_settling_time; /* in us */
28};
29
Michael Hennerich1efc80b2008-07-19 16:57:32 +080030#else
Michael Hennerich14b03202008-05-07 11:41:26 +080031
Michael Hennerich1efc80b2008-07-19 16:57:32 +080032#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
Bryan Wu1394f032007-05-06 14:50:22 -070057#endif /* __KERNEL__ */
58
59#endif /*_BLACKFIN_DPMC_H_*/