2007-02-11 17:31:01 +00:00
|
|
|
/* linux/include/asm-arm/plat-s3c24xx/pm.h
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Simtec Electronics
|
2008-12-12 00:24:06 +00:00
|
|
|
* http://armlinux.simtec.co.uk/
|
2005-04-16 22:20:36 +00:00
|
|
|
* Written by Ben Dooks, <ben@simtec.co.uk>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* s3c2410_pm_init
|
|
|
|
*
|
|
|
|
* called from board at initialisation time to setup the power
|
|
|
|
* management
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
|
|
|
|
extern __init int s3c2410_pm_init(void);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
static inline int s3c2410_pm_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* configuration for the IRQ mask over sleep */
|
|
|
|
extern unsigned long s3c_irqwake_intmask;
|
|
|
|
extern unsigned long s3c_irqwake_eintmask;
|
|
|
|
|
|
|
|
/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
|
|
|
|
extern unsigned long s3c_irqwake_intallow;
|
|
|
|
extern unsigned long s3c_irqwake_eintallow;
|
|
|
|
|
2006-09-19 08:51:32 +00:00
|
|
|
/* per-cpu sleep functions */
|
|
|
|
|
|
|
|
extern void (*pm_cpu_prep)(void);
|
|
|
|
extern void (*pm_cpu_sleep)(void);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Flags for PM Control */
|
|
|
|
|
|
|
|
extern unsigned long s3c_pm_flags;
|
|
|
|
|
|
|
|
/* from sleep.S */
|
|
|
|
|
2006-09-15 23:04:23 +00:00
|
|
|
extern int s3c2410_cpu_save(unsigned long *saveblk);
|
|
|
|
extern void s3c2410_cpu_suspend(void);
|
2005-04-16 22:20:36 +00:00
|
|
|
extern void s3c2410_cpu_resume(void);
|
|
|
|
|
2008-12-12 00:24:06 +00:00
|
|
|
extern unsigned long s3c_sleep_save_phys;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* sleep save info */
|
|
|
|
|
2008-12-12 00:24:06 +00:00
|
|
|
/**
|
|
|
|
* struct sleep_save - save information for shared peripherals.
|
|
|
|
* @reg: Pointer to the register to save.
|
|
|
|
* @val: Holder for the value saved from reg.
|
|
|
|
*
|
|
|
|
* This describes a list of registers which is used by the pm core and
|
|
|
|
* other subsystem to save and restore register values over suspend.
|
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
struct sleep_save {
|
|
|
|
void __iomem *reg;
|
|
|
|
unsigned long val;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SAVE_ITEM(x) \
|
|
|
|
{ .reg = (x) }
|
|
|
|
|
2008-12-12 00:24:06 +00:00
|
|
|
/* helper functions to save/restore lists of registers. */
|
|
|
|
|
|
|
|
extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
|
|
|
|
extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);
|
|
|
|
extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
|
2006-09-15 23:01:39 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
|
|
|
|
extern int s3c24xx_irq_resume(struct sys_device *dev);
|
|
|
|
#else
|
|
|
|
#define s3c24xx_irq_suspend NULL
|
|
|
|
#define s3c24xx_irq_resume NULL
|
|
|
|
#endif
|
2008-12-12 00:24:06 +00:00
|
|
|
|
|
|
|
/* PM debug functions */
|
|
|
|
|
|
|
|
#ifdef CONFIG_S3C2410_PM_DEBUG
|
|
|
|
/**
|
|
|
|
* s3c_pm_dbg() - low level debug function for use in suspend/resume.
|
|
|
|
* @msg: The message to print.
|
|
|
|
*
|
|
|
|
* This function is used mainly to debug the resume process before the system
|
|
|
|
* can rely on printk/console output. It uses the low-level debugging output
|
|
|
|
* routine printascii() to do its work.
|
|
|
|
*/
|
|
|
|
extern void s3c_pm_dbg(const char *msg, ...);
|
|
|
|
|
|
|
|
#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
|
|
|
|
#else
|
|
|
|
#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
|
|
|
|
#endif
|