Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221165
b: refs/heads/master
c: 6436b6a
h: refs/heads/master
i:
  221163: 2f05cbb
v: v3
  • Loading branch information
Abhilash Kesavan authored and Kukjin Kim committed Oct 20, 2010
1 parent ed36ce8 commit e2f4099
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0e451ea092915fa683e5fe7a9e52df33726a5ac
refs/heads/master: 6436b6a7a64f946c5a5f3d8a8c0e6404e2bda8d5
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
#define S3C2443_SCLKCON_UARTCLK (1<<8)
#define S3C2443_SCLKCON_USBHOST (1<<1)

#define S3C2443_PWRCFG_SLEEP (1<<15)

#include <asm/div64.h>

static inline unsigned int
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-s3c2416/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ config S3C2416_DMA
help
Internal config node for S3C2416 DMA support

config S3C2416_PM
bool
help
Internal config node to apply S3C2416 power management

menu "S3C2416 Machines"

config MACH_SMDK2416
Expand All @@ -33,6 +38,7 @@ config MACH_SMDK2416
select S3C_DEV_FB
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC1
select S3C2416_PM if PM
help
Say Y here if you are using an SMDK2416

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-s3c2416/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ obj- :=

obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o
obj-$(CONFIG_CPU_S3C2416) += irq.o

obj-$(CONFIG_S3C2416_PM) += pm.o
#obj-$(CONFIG_S3C2416_DMA) += dma.o

# Machine support
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-s3c2416/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)

static struct sysdev_driver s3c2416_irq_driver = {
.add = s3c2416_irq_add,
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};

static int __init s3c2416_irq_init(void)
Expand Down
84 changes: 84 additions & 0 deletions trunk/arch/arm/mach-s3c2416/pm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* linux/arch/arm/mach-s3c2416/pm.c
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* S3C2416 - PM support (Based on Ben Dooks' S3C2412 PM support)
*
* 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/sysdev.h>
#include <linux/io.h>

#include <asm/cacheflush.h>

#include <mach/regs-power.h>
#include <mach/regs-s3c2443-clock.h>

#include <plat/cpu.h>
#include <plat/pm.h>

extern void s3c2412_sleep_enter(void);

static void s3c2416_cpu_suspend(void)
{
flush_cache_all();

/* 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();
}

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(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
}

static int s3c2416_pm_add(struct sys_device *sysdev)
{
pm_cpu_prep = s3c2416_pm_prepare;
pm_cpu_sleep = s3c2416_cpu_suspend;

return 0;
}

static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state)
{
return 0;
}

static int s3c2416_pm_resume(struct sys_device *dev)
{
/* unset the return-from-sleep amd inform flags */
__raw_writel(0x0, S3C2443_PWRMODE);
__raw_writel(0x0, S3C2412_INFORM0);
__raw_writel(0x0, S3C2412_INFORM1);

return 0;
}

static struct sysdev_driver s3c2416_pm_driver = {
.add = s3c2416_pm_add,
.suspend = s3c2416_pm_suspend,
.resume = s3c2416_pm_resume,
};

static __init int s3c2416_pm_init(void)
{
return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);
}

arch_initcall(s3c2416_pm_init);

0 comments on commit e2f4099

Please sign in to comment.