-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 137506 b: refs/heads/master c: 6419711 h: refs/heads/master v: v3
- Loading branch information
Ben Dooks
committed
Mar 8, 2009
1 parent
1afb0a5
commit d69a683
Showing
10 changed files
with
172 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: a3f66351b3cc89011e8a34068c245b413ce696d6 | ||
refs/heads/master: 6419711a164ba1304fa8fbb75ae9485455e04dcd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* linux/arch/arm/plat-s3c/pm.c | ||
* | ||
* Copyright 2008 Openmoko, Inc. | ||
* Copyright 2004,2006,2008 Simtec Electronics | ||
* Ben Dooks <ben@simtec.co.uk> | ||
* http://armlinux.simtec.co.uk/ | ||
* | ||
* S3C common power management (suspend to ram) 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/init.h> | ||
#include <linux/suspend.h> | ||
#include <linux/errno.h> | ||
#include <linux/io.h> | ||
|
||
#include <plat/pm.h> | ||
|
||
/* for external use */ | ||
|
||
unsigned long s3c_pm_flags; | ||
|
||
#ifdef CONFIG_S3C2410_PM_DEBUG | ||
extern void printascii(const char *); | ||
|
||
void s3c_pm_dbg(const char *fmt, ...) | ||
{ | ||
va_list va; | ||
char buff[256]; | ||
|
||
va_start(va, fmt); | ||
vsprintf(buff, fmt, va); | ||
va_end(va); | ||
|
||
printascii(buff); | ||
} | ||
#endif /* CONFIG_S3C2410_PM_DEBUG */ | ||
|
||
|
||
/* helper functions to save and restore register state */ | ||
|
||
/** | ||
* s3c_pm_do_save() - save a set of registers for restoration on resume. | ||
* @ptr: Pointer to an array of registers. | ||
* @count: Size of the ptr array. | ||
* | ||
* Run through the list of registers given, saving their contents in the | ||
* array for later restoration when we wakeup. | ||
*/ | ||
void s3c_pm_do_save(struct sleep_save *ptr, int count) | ||
{ | ||
for (; count > 0; count--, ptr++) { | ||
ptr->val = __raw_readl(ptr->reg); | ||
S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val); | ||
} | ||
} | ||
|
||
/** | ||
* s3c_pm_do_restore() - restore register values from the save list. | ||
* @ptr: Pointer to an array of registers. | ||
* @count: Size of the ptr array. | ||
* | ||
* Restore the register values saved from s3c_pm_do_save(). | ||
* | ||
* Note, we do not use S3C_PMDBG() in here, as the system may not have | ||
* restore the UARTs state yet | ||
*/ | ||
|
||
void s3c_pm_do_restore(struct sleep_save *ptr, int count) | ||
{ | ||
for (; count > 0; count--, ptr++) { | ||
printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n", | ||
ptr->reg, ptr->val, __raw_readl(ptr->reg)); | ||
|
||
__raw_writel(ptr->val, ptr->reg); | ||
} | ||
} | ||
|
||
/** | ||
* s3c_pm_do_restore_core() - early restore register values from save list. | ||
* | ||
* This is similar to s3c_pm_do_restore() except we try and minimise the | ||
* side effects of the function in case registers that hardware might need | ||
* to work has been restored. | ||
* | ||
* WARNING: Do not put any debug in here that may effect memory or use | ||
* peripherals, as things may be changing! | ||
*/ | ||
|
||
void s3c_pm_do_restore_core(struct sleep_save *ptr, int count) | ||
{ | ||
for (; count > 0; count--, ptr++) | ||
__raw_writel(ptr->val, ptr->reg); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.