// SPDX-License-Identifier: GPL-2.0+ // // Copyright (c) 2004-2006 Simtec Electronics // Ben Dooks // // S3C24XX Power Manager (Suspend-To-RAM) support // // See Documentation/arm/samsung-s3c24xx/suspend.rst for more information // // Parts based on arch/arm/mach-pxa/pm.c // // Thanks to Dimitry Andric for debugging #include #include #include #include #include #include #include #include #include #include "regs-clock.h" #include "regs-gpio.h" #include "regs-irq.h" #include "gpio-samsung.h" #include #include "gpio-cfg.h" #include "pm.h" #include "regs-mem-s3c24xx.h" #define PFX "s3c24xx-pm: " #ifdef CONFIG_PM_SLEEP static struct sleep_save core_save[] = { /* we restore the timings here, with the proviso that the board * brings the system up in an slower, or equal frequency setting * to the original system. * * if we cannot guarantee this, then things are going to go very * wrong here, as we modify the refresh and both pll settings. */ SAVE_ITEM(S3C2410_BWSCON), SAVE_ITEM(S3C2410_BANKCON0), SAVE_ITEM(S3C2410_BANKCON1), SAVE_ITEM(S3C2410_BANKCON2), SAVE_ITEM(S3C2410_BANKCON3), SAVE_ITEM(S3C2410_BANKCON4), SAVE_ITEM(S3C2410_BANKCON5), }; #endif /* s3c_pm_check_resume_pin * * check to see if the pin is configured correctly for sleep mode, and * make any necessary adjustments if it is not */ static void s3c_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs) { unsigned long irqstate; unsigned long pinstate; int irq = gpio_to_irq(pin); if (irqoffs < 4) irqstate = s3c_irqwake_intmask & (1L<