Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / mach-s3c / pm.h
blobeed61e5854576ebe637860a3044715d0d7ac9ae3
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (c) 2004 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Written by Ben Dooks, <ben@simtec.co.uk>
6 */
8 /* s3c_pm_init
10 * called from board at initialisation time to setup the power
11 * management
14 #include "pm-common.h"
16 struct device;
18 #ifdef CONFIG_SAMSUNG_PM
20 extern __init int s3c_pm_init(void);
21 extern __init int s3c64xx_pm_init(void);
23 #else
25 static inline int s3c_pm_init(void)
27 return 0;
30 static inline int s3c64xx_pm_init(void)
32 return 0;
34 #endif
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;
49 /* from sleep.S */
51 extern int s3c2410_cpu_suspend(unsigned long);
53 #ifdef CONFIG_PM_SLEEP
54 extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
55 extern void s3c_cpu_resume(void);
56 #else
57 #define s3c_irq_wake NULL
58 #define s3c_cpu_resume NULL
59 #endif
61 #ifdef CONFIG_SAMSUNG_PM
62 extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
63 #else
64 #define s3c_irqext_wake NULL
65 #endif
67 #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
68 /**
69 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs
70 * @set: set bits for the state of the LEDs
71 * @clear: clear bits for the state of the LEDs.
73 extern void s3c_pm_debug_smdkled(u32 set, u32 clear);
75 #else
76 static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { }
77 #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */
79 /**
80 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
82 * Setup all the necessary GPIO pins for waking the system on external
83 * interrupt.
85 extern void s3c_pm_configure_extint(void);
87 #ifdef CONFIG_GPIO_SAMSUNG
88 /**
89 * samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
91 * Restore the state of the GPIO pins after sleep, which may involve ensuring
92 * that we do not glitch the state of the pins from that the bootloader's
93 * resume code has done.
95 extern void samsung_pm_restore_gpios(void);
97 /**
98 * samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
100 * Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
102 extern void samsung_pm_save_gpios(void);
103 #else
104 static inline void samsung_pm_restore_gpios(void) {}
105 static inline void samsung_pm_save_gpios(void) {}
106 #endif
108 extern void s3c_pm_save_core(void);
109 extern void s3c_pm_restore_core(void);