1 /* arch/arm/plat-samsung/include/plat/pm.h
3 * Copyright (c) 2004 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Written by Ben Dooks, <ben@simtec.co.uk>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
14 * called from board at initialisation time to setup the power
18 #include <plat/pm-common.h>
22 #ifdef CONFIG_SAMSUNG_PM
24 extern __init
int s3c_pm_init(void);
25 extern __init
int s3c64xx_pm_init(void);
29 static inline int s3c_pm_init(void)
34 static inline int s3c64xx_pm_init(void)
40 /* configuration for the IRQ mask over sleep */
41 extern unsigned long s3c_irqwake_intmask
;
42 extern unsigned long s3c_irqwake_eintmask
;
44 /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
45 extern unsigned long s3c_irqwake_intallow
;
46 #ifdef CONFIG_PM_SLEEP
47 extern unsigned long s3c_irqwake_eintallow
;
49 #define s3c_irqwake_eintallow 0
52 /* per-cpu sleep functions */
54 extern void (*pm_cpu_prep
)(void);
55 extern int (*pm_cpu_sleep
)(unsigned long);
57 /* Flags for PM Control */
59 extern unsigned long s3c_pm_flags
;
63 extern int s3c2410_cpu_suspend(unsigned long);
65 #ifdef CONFIG_PM_SLEEP
66 extern int s3c_irq_wake(struct irq_data
*data
, unsigned int state
);
67 extern void s3c_cpu_resume(void);
69 #define s3c_irq_wake NULL
70 #define s3c_cpu_resume NULL
73 #ifdef CONFIG_SAMSUNG_PM
74 extern int s3c_irqext_wake(struct irq_data
*data
, unsigned int state
);
76 #define s3c_irqext_wake NULL
79 #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
81 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs
82 * @set: set bits for the state of the LEDs
83 * @clear: clear bits for the state of the LEDs.
85 extern void s3c_pm_debug_smdkled(u32 set
, u32 clear
);
88 static inline void s3c_pm_debug_smdkled(u32 set
, u32 clear
) { }
89 #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */
92 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
94 * Setup all the necessary GPIO pins for waking the system on external
97 extern void s3c_pm_configure_extint(void);
99 #ifdef CONFIG_GPIO_SAMSUNG
101 * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
103 * Restore the state of the GPIO pins after sleep, which may involve ensuring
104 * that we do not glitch the state of the pins from that the bootloader's
105 * resume code has done.
107 extern void samsung_pm_restore_gpios(void);
110 * samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
112 * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
114 extern void samsung_pm_save_gpios(void);
116 static inline void samsung_pm_restore_gpios(void) {}
117 static inline void samsung_pm_save_gpios(void) {}
120 extern void s3c_pm_save_core(void);
121 extern void s3c_pm_restore_core(void);