~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-s3c24xx/pm-s3c2416.c

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* linux/arch/arm/mach-s3c2416/pm.c
  2  *
  3  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4  *              http://www.samsung.com
  5  *
  6  * S3C2416 - PM support (Based on Ben Dooks' S3C2412 PM support)
  7  *
  8  * This program is free software; you can redistribute it and/or modify
  9  * it under the terms of the GNU General Public License version 2 as
 10  * published by the Free Software Foundation.
 11 */
 12 
 13 #include <linux/device.h>
 14 #include <linux/syscore_ops.h>
 15 #include <linux/io.h>
 16 
 17 #include <asm/cacheflush.h>
 18 
 19 #include <mach/regs-s3c2443-clock.h>
 20 
 21 #include <plat/cpu.h>
 22 #include <plat/pm.h>
 23 
 24 #include "s3c2412-power.h"
 25 
 26 #ifdef CONFIG_PM_SLEEP
 27 extern void s3c2412_sleep_enter(void);
 28 
 29 static int s3c2416_cpu_suspend(unsigned long arg)
 30 {
 31         /* enable wakeup sources regardless of battery state */
 32         __raw_writel(S3C2443_PWRCFG_SLEEP, S3C2443_PWRCFG);
 33 
 34         /* set the mode as sleep, 2BED represents "Go to BED" */
 35         __raw_writel(0x2BED, S3C2443_PWRMODE);
 36 
 37         s3c2412_sleep_enter();
 38 
 39         pr_info("Failed to suspend the system\n");
 40         return 1; /* Aborting suspend */
 41 }
 42 
 43 static void s3c2416_pm_prepare(void)
 44 {
 45         /*
 46          * write the magic value u-boot uses to check for resume into
 47          * the INFORM0 register, and ensure INFORM1 is set to the
 48          * correct address to resume from.
 49          */
 50         __raw_writel(0x2BED, S3C2412_INFORM0);
 51         __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
 52 }
 53 
 54 static int s3c2416_pm_add(struct device *dev, struct subsys_interface *sif)
 55 {
 56         pm_cpu_prep = s3c2416_pm_prepare;
 57         pm_cpu_sleep = s3c2416_cpu_suspend;
 58 
 59         return 0;
 60 }
 61 
 62 static struct subsys_interface s3c2416_pm_interface = {
 63         .name           = "s3c2416_pm",
 64         .subsys         = &s3c2416_subsys,
 65         .add_dev        = s3c2416_pm_add,
 66 };
 67 
 68 static __init int s3c2416_pm_init(void)
 69 {
 70         return subsys_interface_register(&s3c2416_pm_interface);
 71 }
 72 
 73 arch_initcall(s3c2416_pm_init);
 74 #endif
 75 
 76 static void s3c2416_pm_resume(void)
 77 {
 78         /* unset the return-from-sleep amd inform flags */
 79         __raw_writel(0x0, S3C2443_PWRMODE);
 80         __raw_writel(0x0, S3C2412_INFORM0);
 81         __raw_writel(0x0, S3C2412_INFORM1);
 82 }
 83 
 84 struct syscore_ops s3c2416_pm_syscore_ops = {
 85         .resume         = s3c2416_pm_resume,
 86 };
 87 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp