pm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* linux/include/asm-arm/plat-s3c24xx/pm.h
  2. *
  3. * Copyright (c) 2004 Simtec Electronics
  4. * Written by Ben Dooks, <ben@simtec.co.uk>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. /* s3c2410_pm_init
  11. *
  12. * called from board at initialisation time to setup the power
  13. * management
  14. */
  15. #ifdef CONFIG_PM
  16. extern __init int s3c2410_pm_init(void);
  17. #else
  18. static inline int s3c2410_pm_init(void)
  19. {
  20. return 0;
  21. }
  22. #endif
  23. /* configuration for the IRQ mask over sleep */
  24. extern unsigned long s3c_irqwake_intmask;
  25. extern unsigned long s3c_irqwake_eintmask;
  26. /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
  27. extern unsigned long s3c_irqwake_intallow;
  28. extern unsigned long s3c_irqwake_eintallow;
  29. /* per-cpu sleep functions */
  30. extern void (*pm_cpu_prep)(void);
  31. extern void (*pm_cpu_sleep)(void);
  32. /* Flags for PM Control */
  33. extern unsigned long s3c_pm_flags;
  34. /* from sleep.S */
  35. extern int s3c2410_cpu_save(unsigned long *saveblk);
  36. extern void s3c2410_cpu_suspend(void);
  37. extern void s3c2410_cpu_resume(void);
  38. extern unsigned long s3c2410_sleep_save_phys;
  39. /* sleep save info */
  40. struct sleep_save {
  41. void __iomem *reg;
  42. unsigned long val;
  43. };
  44. #define SAVE_ITEM(x) \
  45. { .reg = (x) }
  46. extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
  47. extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
  48. #ifdef CONFIG_PM_CPU_MODE
  49. #define PM_CPU_DEVICE_MODE_SUSPEND 0
  50. #define PM_CPU_MODE_STOP 1
  51. #define PM_CPU_MODE_DEEP_STOP 2
  52. #define PM_CPU_MODE_IDLE 3
  53. #define PM_CPU_MODE_SLEEP 4
  54. #endif
  55. #ifdef CONFIG_PM
  56. extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
  57. extern int s3c24xx_irq_resume(struct sys_device *dev);
  58. #else
  59. #define s3c24xx_irq_suspend NULL
  60. #define s3c24xx_irq_resume NULL
  61. #endif