1 /* linux/include/asm-arm/plat-s3c24xx/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
20 extern __init int s3c2410_pm_init(void);
24 static inline int s3c2410_pm_init(void)
30 /* configuration for the IRQ mask over sleep */
31 extern unsigned long s3c_irqwake_intmask;
32 extern unsigned long s3c_irqwake_eintmask;
34 /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
35 extern unsigned long s3c_irqwake_intallow;
36 extern unsigned long s3c_irqwake_eintallow;
38 /* per-cpu sleep functions */
40 extern void (*pm_cpu_prep)(void);
41 extern void (*pm_cpu_sleep)(void);
43 /* Flags for PM Control */
45 extern unsigned long s3c_pm_flags;
49 extern int s3c2410_cpu_save(unsigned long *saveblk);
50 extern void s3c2410_cpu_suspend(void);
51 extern void s3c2410_cpu_resume(void);
53 extern unsigned long s3c_sleep_save_phys;
58 * struct sleep_save - save information for shared peripherals.
59 * @reg: Pointer to the register to save.
60 * @val: Holder for the value saved from reg.
62 * This describes a list of registers which is used by the pm core and
63 * other subsystem to save and restore register values over suspend.
70 #define SAVE_ITEM(x) \
73 /* helper functions to save/restore lists of registers. */
75 extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
76 extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);
77 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
80 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
81 extern int s3c24xx_irq_resume(struct sys_device *dev);
83 #define s3c24xx_irq_suspend NULL
84 #define s3c24xx_irq_resume NULL
87 /* PM debug functions */
89 #ifdef CONFIG_S3C2410_PM_DEBUG
91 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
92 * @msg: The message to print.
94 * This function is used mainly to debug the resume process before the system
95 * can rely on printk/console output. It uses the low-level debugging output
96 * routine printascii() to do its work.
98 extern void s3c_pm_dbg(const char *msg, ...);
100 #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
102 #define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
105 /* suspend memory checking */
107 #ifdef CONFIG_S3C2410_PM_CHECK
108 extern void s3c_pm_check_prepare(void);
109 extern void s3c_pm_check_restore(void);
110 extern void s3c_pm_check_store(void);
112 #define s3c_pm_check_prepare() do { } while(0)
113 #define s3c_pm_check_restore() do { } while(0)
114 #define s3c_pm_check_store() do { } while(0)
118 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
120 * Setup all the necessary GPIO pins for waking the system on external
123 extern void s3c_pm_configure_extint(void);
126 * s3c_pm_restore_gpios() - restore the state of the gpios after sleep.
128 * Restore the state of the GPIO pins after sleep, which may involve ensuring
129 * that we do not glitch the state of the pins from that the bootloader's
130 * resume code has done.
132 extern void s3c_pm_restore_gpios(void);
135 * s3c_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
137 * Save the GPIO states for resotration on resume. See s3c_pm_restore_gpios().
139 extern void s3c_pm_save_gpios(void);
141 extern void s3c_pm_save_core(void);
142 extern void s3c_pm_restore_core(void);