1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2004 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Written by Ben Dooks, <ben@simtec.co.uk>
10 * called from board at initialisation time to setup the power
14 #include "pm-common.h"
18 #ifdef CONFIG_SAMSUNG_PM
20 extern __init
int s3c_pm_init(void);
21 extern __init
int s3c64xx_pm_init(void);
25 static inline int s3c_pm_init(void)
30 static inline int s3c64xx_pm_init(void)
36 /* configuration for the IRQ mask over sleep */
37 extern unsigned long s3c_irqwake_intmask
;
38 extern unsigned long s3c_irqwake_eintmask
;
40 /* per-cpu sleep functions */
42 extern void (*pm_cpu_prep
)(void);
43 extern int (*pm_cpu_sleep
)(unsigned long);
45 /* Flags for PM Control */
47 extern unsigned long s3c_pm_flags
;
51 #ifdef CONFIG_PM_SLEEP
52 extern int s3c_irq_wake(struct irq_data
*data
, unsigned int state
);
53 extern void s3c_cpu_resume(void);
55 #define s3c_irq_wake NULL
56 #define s3c_cpu_resume NULL
59 #ifdef CONFIG_SAMSUNG_PM
60 extern int s3c_irqext_wake(struct irq_data
*data
, unsigned int state
);
62 #define s3c_irqext_wake NULL
66 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
68 * Setup all the necessary GPIO pins for waking the system on external
71 extern void s3c_pm_configure_extint(void);
73 #ifdef CONFIG_GPIO_SAMSUNG
75 * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
77 * Restore the state of the GPIO pins after sleep, which may involve ensuring
78 * that we do not glitch the state of the pins from that the bootloader's
79 * resume code has done.
81 extern void samsung_pm_restore_gpios(void);
84 * samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
86 * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
88 extern void samsung_pm_save_gpios(void);
90 static inline void samsung_pm_restore_gpios(void) {}
91 static inline void samsung_pm_save_gpios(void) {}
94 extern void s3c_pm_save_core(void);
95 extern void s3c_pm_restore_core(void);