diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-09-02 17:47:55 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-20 21:00:15 +0200 |
commit | 71b9114d2c13a648fbe6523dd859e611c316ad90 (patch) | |
tree | c380a723099f776736779319be913f8c0900989e /arch/arm/mach-s3c24xx/pm-s3c2416.c | |
parent | ARM: s3c24xx: stop including mach/hardware.h from mach/io.h (diff) | |
download | linux-71b9114d2c13a648fbe6523dd859e611c316ad90.tar.xz linux-71b9114d2c13a648fbe6523dd859e611c316ad90.zip |
ARM: s3c: move into a common directory
s3c24xx and s3c64xx have a lot in common, but are split across three
separate directories, which makes the interaction of the header files
more complicated than necessary.
Move all three directories into a new mach-s3c, with a minimal
set of changes to each file.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[krzk: Rebase, add s3c24xx and s3c64xx suffix to several files, add SPDX
headers to new files, remove plat-samsung from MAINTAINERS]
Co-developed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
https://lore.kernel.org/r/20200806182059.2431-39-krzk@kernel.org
Diffstat (limited to 'arch/arm/mach-s3c24xx/pm-s3c2416.c')
-rw-r--r-- | arch/arm/mach-s3c24xx/pm-s3c2416.c | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/arch/arm/mach-s3c24xx/pm-s3c2416.c b/arch/arm/mach-s3c24xx/pm-s3c2416.c deleted file mode 100644 index 9a2f05e279d4..000000000000 --- a/arch/arm/mach-s3c24xx/pm-s3c2416.c +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// -// Copyright (c) 2010 Samsung Electronics Co., Ltd. -// http://www.samsung.com -// -// S3C2416 - PM support (Based on Ben Dooks' S3C2412 PM support) - -#include <linux/device.h> -#include <linux/syscore_ops.h> -#include <linux/io.h> - -#include <asm/cacheflush.h> - -#include <mach/regs-s3c2443-clock.h> - -#include <plat/cpu.h> -#include <plat/pm.h> - -#include "s3c2412-power.h" - -#ifdef CONFIG_PM_SLEEP -extern void s3c2412_sleep_enter(void); - -static int s3c2416_cpu_suspend(unsigned long arg) -{ - /* enable wakeup sources regardless of battery state */ - __raw_writel(S3C2443_PWRCFG_SLEEP, S3C2443_PWRCFG); - - /* set the mode as sleep, 2BED represents "Go to BED" */ - __raw_writel(0x2BED, S3C2443_PWRMODE); - - s3c2412_sleep_enter(); - - pr_info("Failed to suspend the system\n"); - return 1; /* Aborting suspend */ -} - -static void s3c2416_pm_prepare(void) -{ - /* - * write the magic value u-boot uses to check for resume into - * the INFORM0 register, and ensure INFORM1 is set to the - * correct address to resume from. - */ - __raw_writel(0x2BED, S3C2412_INFORM0); - __raw_writel(__pa_symbol(s3c_cpu_resume), S3C2412_INFORM1); -} - -static int s3c2416_pm_add(struct device *dev, struct subsys_interface *sif) -{ - pm_cpu_prep = s3c2416_pm_prepare; - pm_cpu_sleep = s3c2416_cpu_suspend; - - return 0; -} - -static struct subsys_interface s3c2416_pm_interface = { - .name = "s3c2416_pm", - .subsys = &s3c2416_subsys, - .add_dev = s3c2416_pm_add, -}; - -static __init int s3c2416_pm_init(void) -{ - return subsys_interface_register(&s3c2416_pm_interface); -} - -arch_initcall(s3c2416_pm_init); -#endif - -static void s3c2416_pm_resume(void) -{ - /* unset the return-from-sleep amd inform flags */ - __raw_writel(0x0, S3C2443_PWRMODE); - __raw_writel(0x0, S3C2412_INFORM0); - __raw_writel(0x0, S3C2412_INFORM1); -} - -struct syscore_ops s3c2416_pm_syscore_ops = { - .resume = s3c2416_pm_resume, -}; |