2017-12-25 20:54:33 +01:00
/* SPDX-License-Identifier: GPL-2.0 */
/*
2009-03-10 18:19:35 +00:00
* Copyright 2008 Openmoko , Inc .
* Copyright 2008 Simtec Electronics
* Ben Dooks < ben @ simtec . co . uk >
* http : //armlinux.simtec.co.uk/
*
* S3C64XX - PM core support for arch / arm / plat - s3c / pm . c
*/
2012-07-19 14:42:10 +09:00
# ifndef __MACH_S3C64XX_PM_CORE_H
# define __MACH_S3C64XX_PM_CORE_H __FILE__
2014-03-21 02:57:18 +09:00
# include <linux/serial_s3c.h>
2015-12-16 16:32:24 +01:00
# include <linux/delay.h>
2014-03-21 02:57:18 +09:00
2019-09-02 18:37:30 +02:00
# include "regs-gpio.h"
# include "regs-clock.h"
# include "map.h"
2009-03-10 18:19:35 +00:00
static inline void s3c_pm_debug_init_uart ( void )
{
}
static inline void s3c_pm_arch_prepare_irqs ( void )
{
/* VIC should have already been taken care of */
/* clear any pending EINT0 interrupts */
__raw_writel ( __raw_readl ( S3C64XX_EINT0PEND ) , S3C64XX_EINT0PEND ) ;
}
static inline void s3c_pm_arch_stop_clocks ( void )
{
}
static inline void s3c_pm_arch_show_resume_irqs ( void )
{
}
/* make these defines, we currently do not have any need to change
* the IRQ wake controls depending on the CPU we are running on */
2015-12-16 18:07:49 +01:00
# ifdef CONFIG_PM_SLEEP
2009-03-10 18:19:35 +00:00
# define s3c_irqwake_eintallow ((1 << 28) - 1)
2011-06-01 10:44:51 +01:00
# define s3c_irqwake_intallow (~0)
2015-12-16 18:07:49 +01:00
# else
# define s3c_irqwake_eintallow 0
# define s3c_irqwake_intallow 0
# endif
2009-03-10 18:19:35 +00:00
2011-06-01 10:44:50 +01:00
static inline void s3c_pm_restored_gpios ( void )
{
/* ensure sleep mode has been cleared from the system */
__raw_writel ( 0 , S3C64XX_SLPEN ) ;
}
2011-08-30 20:47:32 +09:00
static inline void samsung_pm_saved_gpios ( void )
2011-06-01 10:44:50 +01:00
{
/* turn on the sleep mode and keep it there, as it seems that during
* suspend the xCON registers get re - set and thus you can end up with
* problems between going to sleep and resuming .
*/
__raw_writel ( S3C64XX_SLPEN_USE_xSLP , S3C64XX_SLPEN ) ;
}
2012-07-19 14:42:10 +09:00
# endif /* __MACH_S3C64XX_PM_CORE_H */