Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137519
b: refs/heads/master
c: aa8aba6
h: refs/heads/master
i:
  137517: 33c60ec
  137515: dd68fec
  137511: ba4a522
  137503: b9fedce
v: v3
  • Loading branch information
Ben Dooks committed Mar 8, 2009
1 parent 052b0cf commit 38476fc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 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: 663a83048c602d5176c23489b4e29598d753e42b
refs/heads/master: aa8aba6944203a17a7e941b42d8415153c649660
2 changes: 2 additions & 0 deletions trunk/arch/arm/plat-s3c/include/plat/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ extern void s3c_pm_dbg(const char *msg, ...);
#ifdef CONFIG_S3C2410_PM_CHECK
extern void s3c_pm_check_prepare(void);
extern void s3c_pm_check_restore(void);
extern void s3c_pm_check_cleanup(void);
extern void s3c_pm_check_store(void);
#else
#define s3c_pm_check_prepare() do { } while(0)
#define s3c_pm_check_restore() do { } while(0)
#define s3c_pm_check_cleanup() do { } while(0)
#define s3c_pm_check_store() do { } while(0)
#endif

Expand Down
20 changes: 16 additions & 4 deletions trunk/arch/arm/plat-s3c/pm-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,21 @@ static u32 *s3c_pm_runcheck(struct resource *res, u32 *val)
*/
void s3c_pm_check_restore(void)
{
if (crcs != NULL) {
if (crcs != NULL)
s3c_pm_run_sysram(s3c_pm_runcheck, crcs);
kfree(crcs);
crcs = NULL;
}
}

/**
* s3c_pm_check_cleanup() - free memory resources
*
* Free the resources that where allocated by the suspend
* memory check code. We do this separately from the
* s3c_pm_check_restore() function as we cannot call any
* functions that might sleep during that resume.
*/
void s3c_pm_check_cleanup(void)
{
kfree(crcs);
crcs = NULL;
}

19 changes: 15 additions & 4 deletions trunk/arch/arm/plat-s3c/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ static int s3c_pm_enter(suspend_state_t state)
return -EINVAL;
}

/* prepare check area if configured */

s3c_pm_check_prepare();

/* store the physical address of the register recovery block */

s3c_sleep_save_phys = virt_to_phys(regs_save);
Expand Down Expand Up @@ -329,8 +325,23 @@ static int s3c_pm_enter(suspend_state_t state)
return 0;
}

static int s3c_pm_prepare(void)
{
/* prepare check area if configured */

s3c_pm_check_prepare();
return 0;
}

static void s3c_pm_finish(void)
{
s3c_pm_check_cleanup();
}

static struct platform_suspend_ops s3c_pm_ops = {
.enter = s3c_pm_enter,
.prepare = s3c_pm_prepare,
.finish = s3c_pm_finish,
.valid = suspend_valid_only_mem,
};

Expand Down

0 comments on commit 38476fc

Please sign in to comment.