Release 4.11 arch/arm/mach-s3c24xx/pm-s3c2412.c
/* linux/arch/arm/mach-s3c2412/pm.c
*
* Copyright (c) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* http://armlinux.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.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/syscore_ops.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <asm/cacheflush.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <mach/regs-gpio.h>
#include <plat/cpu.h>
#include <plat/pm.h>
#include <plat/wakeup-mask.h>
#include "regs-dsc.h"
#include "s3c2412-power.h"
extern void s3c2412_sleep_enter(void);
static int s3c2412_cpu_suspend(unsigned long arg)
{
unsigned long tmp;
/* set our standby method to sleep */
tmp = __raw_readl(S3C2412_PWRCFG);
tmp |= S3C2412_PWRCFG_STANDBYWFI_SLEEP;
__raw_writel(tmp, S3C2412_PWRCFG);
s3c2412_sleep_enter();
pr_info("Failed to suspend the system\n");
return 1; /* Aborting suspend */
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 32 | 71.11% | 2 | 40.00% |
Russell King | 7 | 15.56% | 2 | 40.00% |
Abhilash Kesavan | 6 | 13.33% | 1 | 20.00% |
Total | 45 | 100.00% | 5 | 100.00% |
/* mapping of interrupts to parts of the wakeup mask */
static const struct samsung_wakeup_mask wake_irqs[] = {
{ .irq = IRQ_RTC, .bit = S3C2412_PWRCFG_RTC_MASKIRQ, },
};
static void s3c2412_pm_prepare(void)
{
samsung_sync_wakemask(S3C2412_PWRCFG,
wake_irqs, ARRAY_SIZE(wake_irqs));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Heiko Stübner | 14 | 70.00% | 1 | 50.00% |
Ben Dooks | 6 | 30.00% | 1 | 50.00% |
Total | 20 | 100.00% | 2 | 100.00% |
static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)
{
pm_cpu_prep = s3c2412_pm_prepare;
pm_cpu_sleep = s3c2412_cpu_suspend;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 20 | 74.07% | 1 | 33.33% |
Heiko Stübner | 5 | 18.52% | 1 | 33.33% |
Kay Sievers | 2 | 7.41% | 1 | 33.33% |
Total | 27 | 100.00% | 3 | 100.00% |
static struct sleep_save s3c2412_sleep[] = {
SAVE_ITEM(S3C2412_DSC0),
SAVE_ITEM(S3C2412_DSC1),
SAVE_ITEM(S3C2413_GPJDAT),
SAVE_ITEM(S3C2413_GPJCON),
SAVE_ITEM(S3C2413_GPJUP),
/* save the PWRCFG to get back to original sleep method */
SAVE_ITEM(S3C2412_PWRCFG),
/* save the sleep configuration anyway, just in case these
* get damaged during wakeup */
SAVE_ITEM(S3C2412_GPBSLPCON),
SAVE_ITEM(S3C2412_GPCSLPCON),
SAVE_ITEM(S3C2412_GPDSLPCON),
SAVE_ITEM(S3C2412_GPFSLPCON),
SAVE_ITEM(S3C2412_GPGSLPCON),
SAVE_ITEM(S3C2412_GPHSLPCON),
SAVE_ITEM(S3C2413_GPJSLPCON),
};
static struct subsys_interface s3c2412_pm_interface = {
.name = "s3c2412_pm",
.subsys = &s3c2412_subsys,
.add_dev = s3c2412_pm_add,
};
static __init int s3c2412_pm_init(void)
{
return subsys_interface_register(&s3c2412_pm_interface);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rafael J. Wysocki | 14 | 87.50% | 1 | 33.33% |
Kay Sievers | 1 | 6.25% | 1 | 33.33% |
Kukjin Kim | 1 | 6.25% | 1 | 33.33% |
Total | 16 | 100.00% | 3 | 100.00% |
arch_initcall(s3c2412_pm_init);
static int s3c2412_pm_suspend(void)
{
s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 20 | 95.24% | 2 | 66.67% |
Rafael J. Wysocki | 1 | 4.76% | 1 | 33.33% |
Total | 21 | 100.00% | 3 | 100.00% |
static void s3c2412_pm_resume(void)
{
unsigned long tmp;
tmp = __raw_readl(S3C2412_PWRCFG);
tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE;
__raw_writel(tmp, S3C2412_PWRCFG);
s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 43 | 95.56% | 2 | 66.67% |
Rafael J. Wysocki | 2 | 4.44% | 1 | 33.33% |
Total | 45 | 100.00% | 3 | 100.00% |
struct syscore_ops s3c2412_pm_syscore_ops = {
.suspend = s3c2412_pm_suspend,
.resume = s3c2412_pm_resume,
};
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Dooks | 263 | 69.21% | 6 | 31.58% |
Heiko Stübner | 43 | 11.32% | 2 | 10.53% |
Rafael J. Wysocki | 36 | 9.47% | 1 | 5.26% |
Kay Sievers | 18 | 4.74% | 1 | 5.26% |
Russell King | 9 | 2.37% | 4 | 21.05% |
Abhilash Kesavan | 6 | 1.58% | 1 | 5.26% |
Kukjin Kim | 4 | 1.05% | 3 | 15.79% |
Krzysztof Kozlowski | 1 | 0.26% | 1 | 5.26% |
Total | 380 | 100.00% | 19 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.