dpmc.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef _BLACKFIN_DPMC_H_
  9. #define _BLACKFIN_DPMC_H_
  10. #ifdef __KERNEL__
  11. #ifndef __ASSEMBLY__
  12. void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
  13. void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
  14. void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
  15. void do_hibernate(int wakeup);
  16. void set_dram_srfs(void);
  17. void unset_dram_srfs(void);
  18. #define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
  19. struct bfin_dpmc_platform_data {
  20. const unsigned int *tuple_tab;
  21. unsigned short tabsize;
  22. unsigned short vr_settling_time; /* in us */
  23. };
  24. #else
  25. #define PM_PUSH(x) \
  26. R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\
  27. [--SP] = R0;\
  28. #define PM_POP(x) \
  29. R0 = [SP++];\
  30. [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\
  31. #define PM_SYS_PUSH(x) \
  32. R0 = [P0 + (x - PLL_CTL)];\
  33. [--SP] = R0;\
  34. #define PM_SYS_POP(x) \
  35. R0 = [SP++];\
  36. [P0 + (x - PLL_CTL)] = R0;\
  37. #define PM_SYS_PUSH16(x) \
  38. R0 = w[P0 + (x - PLL_CTL)];\
  39. [--SP] = R0;\
  40. #define PM_SYS_POP16(x) \
  41. R0 = [SP++];\
  42. w[P0 + (x - PLL_CTL)] = R0;\
  43. #endif
  44. #endif /* __KERNEL__ */
  45. #endif /*_BLACKFIN_DPMC_H_*/