dpmc.h 1.2 KB
Newer Older
B
Bryan Wu 已提交
1 2 3
/*
 * include/asm-blackfin/dpmc.h -  Miscellaneous IOCTL commands for Dynamic Power
 *   			 	Management Controller Driver.
4
 * Copyright (C) 2004-2008 Analog Device Inc.
B
Bryan Wu 已提交
5 6 7 8 9 10
 *
 */
#ifndef _BLACKFIN_DPMC_H_
#define _BLACKFIN_DPMC_H_

#ifdef __KERNEL__
11
#ifndef __ASSEMBLY__
B
Bryan Wu 已提交
12

13 14 15
void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
16 17 18
void do_hibernate(int wakeup);
void set_dram_srfs(void);
void unset_dram_srfs(void);
B
Bryan Wu 已提交
19

20
#define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
B
Bryan Wu 已提交
21

22 23 24 25 26 27
struct bfin_dpmc_platform_data {
	const unsigned int *tuple_tab;
	unsigned short tabsize;
	unsigned short vr_settling_time; /* in us */
};

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#else

#define PM_PUSH(x) \
	R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\
	[--SP] =  R0;\

#define PM_POP(x) \
	R0 = [SP++];\
	[P0 + (x - SRAM_BASE_ADDRESS)] = R0;\

#define PM_SYS_PUSH(x) \
	R0 = [P0 + (x - PLL_CTL)];\
	[--SP] =  R0;\

#define PM_SYS_POP(x) \
	R0 = [SP++];\
	[P0 + (x - PLL_CTL)] = R0;\

#define PM_SYS_PUSH16(x) \
	R0 = w[P0 + (x - PLL_CTL)];\
	[--SP] =  R0;\

#define PM_SYS_POP16(x) \
	R0 = [SP++];\
	w[P0 + (x - PLL_CTL)] = R0;\
53

54
#endif
B
Bryan Wu 已提交
55 56 57
#endif	/* __KERNEL__ */

#endif	/*_BLACKFIN_DPMC_H_*/