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 <linux/irq.h>
24 extern __init
int s3c_pm_init(void);
28 static inline int s3c_pm_init(void)
34 /* configuration for the IRQ mask over sleep */
35 extern unsigned long s3c_irqwake_intmask
;
36 extern unsigned long s3c_irqwake_eintmask
;
38 /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
39 extern unsigned long s3c_irqwake_intallow
;
40 extern unsigned long s3c_irqwake_eintallow
;
42 /* per-cpu sleep functions */
44 extern void (*pm_cpu_prep
)(void);
45 extern void (*pm_cpu_sleep
)(void);
47 /* Flags for PM Control */
49 extern unsigned long s3c_pm_flags
;
51 extern unsigned char pm_uart_udivslot
; /* true to save UART UDIVSLOT */
55 extern int s3c_cpu_save(unsigned long *saveblk
);
56 extern void s3c_cpu_resume(void);
58 extern void s3c2410_cpu_suspend(void);
60 extern unsigned long s3c_sleep_save_phys
;
65 * struct sleep_save - save information for shared peripherals.
66 * @reg: Pointer to the register to save.
67 * @val: Holder for the value saved from reg.
69 * This describes a list of registers which is used by the pm core and
70 * other subsystem to save and restore register values over suspend.
77 #define SAVE_ITEM(x) \
81 * struct pm_uart_save - save block for core UART
82 * @ulcon: Save value for S3C2410_ULCON
83 * @ucon: Save value for S3C2410_UCON
84 * @ufcon: Save value for S3C2410_UFCON
85 * @umcon: Save value for S3C2410_UMCON
86 * @ubrdiv: Save value for S3C2410_UBRDIV
88 * Save block for UART registers to be held over sleep and restored if they
89 * are needed (say by debug).
100 /* helper functions to save/restore lists of registers. */
102 extern void s3c_pm_do_save(struct sleep_save
*ptr
, int count
);
103 extern void s3c_pm_do_restore(struct sleep_save
*ptr
, int count
);
104 extern void s3c_pm_do_restore_core(struct sleep_save
*ptr
, int count
);
107 extern int s3c_irqext_wake(struct irq_data
*data
, unsigned int state
);
108 extern int s3c24xx_irq_suspend(struct sys_device
*dev
, pm_message_t state
);
109 extern int s3c24xx_irq_resume(struct sys_device
*dev
);
111 #define s3c_irqext_wake NULL
112 #define s3c24xx_irq_suspend NULL
113 #define s3c24xx_irq_resume NULL
116 /* PM debug functions */
118 #ifdef CONFIG_SAMSUNG_PM_DEBUG
120 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
121 * @msg: The message to print.
123 * This function is used mainly to debug the resume process before the system
124 * can rely on printk/console output. It uses the low-level debugging output
125 * routine printascii() to do its work.
127 extern void s3c_pm_dbg(const char *msg
, ...);
129 #define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
131 #define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
134 #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
136 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs
137 * @set: set bits for the state of the LEDs
138 * @clear: clear bits for the state of the LEDs.
140 extern void s3c_pm_debug_smdkled(u32 set
, u32 clear
);
143 static inline void s3c_pm_debug_smdkled(u32 set
, u32 clear
) { }
144 #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */
146 /* suspend memory checking */
148 #ifdef CONFIG_SAMSUNG_PM_CHECK
149 extern void s3c_pm_check_prepare(void);
150 extern void s3c_pm_check_restore(void);
151 extern void s3c_pm_check_cleanup(void);
152 extern void s3c_pm_check_store(void);
154 #define s3c_pm_check_prepare() do { } while(0)
155 #define s3c_pm_check_restore() do { } while(0)
156 #define s3c_pm_check_cleanup() do { } while(0)
157 #define s3c_pm_check_store() do { } while(0)
161 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
163 * Setup all the necessary GPIO pins for waking the system on external
166 extern void s3c_pm_configure_extint(void);
169 * s3c_pm_restore_gpios() - restore the state of the gpios after sleep.
171 * Restore the state of the GPIO pins after sleep, which may involve ensuring
172 * that we do not glitch the state of the pins from that the bootloader's
173 * resume code has done.
175 extern void s3c_pm_restore_gpios(void);
178 * s3c_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
180 * Save the GPIO states for resotration on resume. See s3c_pm_restore_gpios().
182 extern void s3c_pm_save_gpios(void);
185 * s3c_pm_cb_flushcache - callback for assembly code
187 * Callback to issue flush_cache_all() as this call is
188 * not a directly callable object.
190 extern void s3c_pm_cb_flushcache(void);
192 extern void s3c_pm_save_core(void);
193 extern void s3c_pm_restore_core(void);
This page took 0.050802 seconds and 5 git commands to generate.