2010-01-29 17:02:12 +08:00
|
|
|
/* arch/arm/plat-samsung/include/plat/pm.h
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Simtec Electronics
|
2008-12-12 08:24:06 +08:00
|
|
|
* http://armlinux.simtec.co.uk/
|
2005-04-17 06:20:36 +08: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.
|
|
|
|
*/
|
|
|
|
|
2008-12-12 08:24:18 +08:00
|
|
|
/* s3c_pm_init
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* called from board at initialisation time to setup the power
|
|
|
|
* management
|
|
|
|
*/
|
|
|
|
|
2014-03-18 06:28:09 +08:00
|
|
|
#include <plat/pm-common.h>
|
2010-12-02 13:35:38 +08:00
|
|
|
|
2011-12-22 08:01:38 +08:00
|
|
|
struct device;
|
2011-02-07 09:51:04 +08:00
|
|
|
|
2013-07-24 13:06:13 +08:00
|
|
|
#ifdef CONFIG_SAMSUNG_PM
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-12-12 08:24:18 +08:00
|
|
|
extern __init int s3c_pm_init(void);
|
2011-12-09 06:27:48 +08:00
|
|
|
extern __init int s3c64xx_pm_init(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2008-12-12 08:24:18 +08:00
|
|
|
static inline int s3c_pm_init(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2011-12-09 06:27:48 +08:00
|
|
|
|
|
|
|
static inline int s3c64xx_pm_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* configuration for the IRQ mask over sleep */
|
|
|
|
extern unsigned long s3c_irqwake_intmask;
|
|
|
|
extern unsigned long s3c_irqwake_eintmask;
|
|
|
|
|
2006-09-19 16:51:32 +08:00
|
|
|
/* per-cpu sleep functions */
|
|
|
|
|
|
|
|
extern void (*pm_cpu_prep)(void);
|
2011-07-02 16:54:01 +08:00
|
|
|
extern int (*pm_cpu_sleep)(unsigned long);
|
2006-09-19 16:51:32 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Flags for PM Control */
|
|
|
|
|
|
|
|
extern unsigned long s3c_pm_flags;
|
|
|
|
|
|
|
|
/* from sleep.S */
|
|
|
|
|
2011-07-02 16:54:01 +08:00
|
|
|
extern int s3c2410_cpu_suspend(unsigned long);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2015-02-27 04:50:22 +08:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2012-11-22 13:46:21 +08:00
|
|
|
extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
|
2013-07-24 13:06:13 +08:00
|
|
|
extern void s3c_cpu_resume(void);
|
2006-09-16 07:01:39 +08:00
|
|
|
#else
|
2012-11-22 13:46:21 +08:00
|
|
|
#define s3c_irq_wake NULL
|
2013-07-24 13:06:13 +08:00
|
|
|
#define s3c_cpu_resume NULL
|
2006-09-16 07:01:39 +08:00
|
|
|
#endif
|
2008-12-12 08:24:06 +08:00
|
|
|
|
2015-02-27 04:50:22 +08:00
|
|
|
#ifdef CONFIG_SAMSUNG_PM
|
|
|
|
extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
|
|
|
|
#else
|
|
|
|
#define s3c_irqext_wake NULL
|
|
|
|
#endif
|
|
|
|
|
2009-03-11 02:19:35 +08:00
|
|
|
#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 */
|
|
|
|
|
2008-12-12 08:24:08 +08:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2013-06-19 00:22:20 +08:00
|
|
|
#ifdef CONFIG_GPIO_SAMSUNG
|
2008-12-12 08:24:08 +08:00
|
|
|
/**
|
2011-08-30 19:47:32 +08:00
|
|
|
* samsung_pm_restore_gpios() - restore the state of the gpios after sleep.
|
2008-12-12 08:24:08 +08:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2011-08-30 19:47:32 +08:00
|
|
|
extern void samsung_pm_restore_gpios(void);
|
2008-12-12 08:24:08 +08:00
|
|
|
|
|
|
|
/**
|
2011-08-30 19:47:32 +08:00
|
|
|
* samsung_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
|
2008-12-12 08:24:08 +08:00
|
|
|
*
|
2011-08-30 19:47:32 +08:00
|
|
|
* Save the GPIO states for resotration on resume. See samsung_pm_restore_gpios().
|
2008-12-12 08:24:08 +08:00
|
|
|
*/
|
2011-08-30 19:47:32 +08:00
|
|
|
extern void samsung_pm_save_gpios(void);
|
2013-06-19 00:22:20 +08:00
|
|
|
#else
|
|
|
|
static inline void samsung_pm_restore_gpios(void) {}
|
|
|
|
static inline void samsung_pm_save_gpios(void) {}
|
|
|
|
#endif
|
2008-12-12 08:24:08 +08:00
|
|
|
|
|
|
|
extern void s3c_pm_save_core(void);
|
|
|
|
extern void s3c_pm_restore_core(void);
|