From 67c492d7bcbd1009775e85a4d7ecb5a651006427 Mon Sep 17 00:00:00 2001 From: merge Date: Wed, 3 Dec 2008 11:37:28 +0000 Subject: MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-repair-broken-include-patch-1228304201 pending-tracking-hist top was MERGE-via-stable-tracking-repair-broken-include-patch-1228304201 / 63bf64cf29947936235ade35a4faf33dc8919b68 ... parent commitmessage: From: merge MERGE-via-stable-tracking-hist-repair-broken-include-patch stable-tracking-hist top was repair-broken-include-patch / aab327f537d98b0bd48be4b7f61811f9b60ddd02 ... parent commitmessage: From: Andy Green repair-broken-include.patch Signed-off-by: Andy Green --- arch/arm/plat-s3c/include/plat/pm.h | 122 +++++++++++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 8 deletions(-) (limited to 'arch/arm/plat-s3c/include') diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-s3c/include/plat/pm.h index c384d02d4cf..9b9a88592ee 100644 --- a/arch/arm/plat-s3c/include/plat/pm.h +++ b/arch/arm/plat-s3c/include/plat/pm.h @@ -1,6 +1,7 @@ /* linux/include/asm-arm/plat-s3c24xx/pm.h * * Copyright (c) 2004 Simtec Electronics + * http://armlinux.simtec.co.uk/ * Written by Ben Dooks, * * This program is free software; you can redistribute it and/or modify @@ -10,7 +11,7 @@ #include -/* s3c2410_pm_init +/* s3c_pm_init * * called from board at initialisation time to setup the power * management @@ -18,11 +19,11 @@ #ifdef CONFIG_PM -extern __init int s3c2410_pm_init(void); +extern __init int s3c_pm_init(void); #else -static inline int s3c2410_pm_init(void) +static inline int s3c_pm_init(void) { return 0; } @@ -45,16 +46,27 @@ extern void (*pm_cpu_sleep)(void); extern unsigned long s3c_pm_flags; +extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ + /* from sleep.S */ -extern int s3c2410_cpu_save(unsigned long *saveblk); +extern int s3c_cpu_save(unsigned long *saveblk); +extern void s3c_cpu_resume(void); + extern void s3c2410_cpu_suspend(void); -extern void s3c2410_cpu_resume(void); -extern unsigned long s3c2410_sleep_save_phys; +extern unsigned long s3c_sleep_save_phys; /* sleep save info */ +/** + * 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. + */ struct sleep_save { void __iomem *reg; unsigned long val; @@ -63,13 +75,107 @@ struct sleep_save { #define SAVE_ITEM(x) \ { .reg = (x) } -extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count); -extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count); +/** + * struct pm_uart_save - save block for core UART + * @ulcon: Save value for S3C2410_ULCON + * @ucon: Save value for S3C2410_UCON + * @ufcon: Save value for S3C2410_UFCON + * @umcon: Save value for S3C2410_UMCON + * @ubrdiv: Save value for S3C2410_UBRDIV + * + * Save block for UART registers to be held over sleep and restored if they + * are needed (say by debug). +*/ +struct pm_uart_save { + u32 ulcon; + u32 ucon; + u32 ufcon; + u32 umcon; + u32 ubrdiv; + u32 udivslot; +}; + +/* 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); #ifdef CONFIG_PM +extern int s3c_irqext_wake(unsigned int irqno, unsigned int state); extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); extern int s3c24xx_irq_resume(struct sys_device *dev); #else +#define s3c_irqext_wake NULL #define s3c24xx_irq_suspend NULL #define s3c24xx_irq_resume NULL #endif + +/* 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 + +#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK +/** + * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs + * @set: set bits for the state of the LEDs + * @clear: clear bits for the state of the LEDs. + */ +extern void s3c_pm_debug_smdkled(u32 set, u32 clear); + +#else +static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { } +#endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */ + +/* suspend memory checking */ + +#ifdef CONFIG_S3C2410_PM_CHECK +extern void s3c_pm_check_prepare(void); +extern void s3c_pm_check_restore(void); +extern void s3c_pm_check_store(void); +#else +#define s3c_pm_check_prepare() do { } while(0) +#define s3c_pm_check_restore() do { } while(0) +#define s3c_pm_check_store() do { } while(0) +#endif + +/** + * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ + * + * Setup all the necessary GPIO pins for waking the system on external + * interrupt. + */ +extern void s3c_pm_configure_extint(void); + +/** + * s3c_pm_restore_gpios() - restore the state of the gpios after sleep. + * + * Restore the state of the GPIO pins after sleep, which may involve ensuring + * that we do not glitch the state of the pins from that the bootloader's + * resume code has done. +*/ +extern void s3c_pm_restore_gpios(void); + +/** + * s3c_pm_save_gpios() - save the state of the GPIOs for restoring after sleep. + * + * Save the GPIO states for resotration on resume. See s3c_pm_restore_gpios(). + */ +extern void s3c_pm_save_gpios(void); + +extern void s3c_pm_save_core(void); +extern void s3c_pm_restore_core(void); -- cgit v1.2.3