Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59256
b: refs/heads/master
c: e176bb0
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jul 12, 2007
1 parent 6fca264 commit 135b1e5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 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: b23170c01f6e4ea043df7cd9486c2488e01f3d60
refs/heads/master: e176bb05fec4c00450302a75e81f8da3dc9e309e
26 changes: 0 additions & 26 deletions trunk/arch/arm/mach-pxa/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,29 +200,3 @@ unsigned long sleep_phys_sp(void *sp)
{
return virt_to_phys(sp);
}

/*
* Called after processes are frozen, but before we shut down devices.
*/
int pxa_pm_prepare(suspend_state_t state)
{
extern int pxa_cpu_pm_prepare(suspend_state_t state);

return pxa_cpu_pm_prepare(state);
}

EXPORT_SYMBOL_GPL(pxa_pm_prepare);

static struct pm_ops pxa_pm_ops = {
.prepare = pxa_pm_prepare,
.enter = pxa_pm_enter,
.valid = pm_valid_only_mem,
};

static int __init pxa_pm_init(void)
{
pm_set_ops(&pxa_pm_ops);
return 0;
}

device_initcall(pxa_pm_init);
20 changes: 19 additions & 1 deletion trunk/arch/arm/mach-pxa/pxa25x.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <asm/hardware.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pm.h>

#include "generic.h"

Expand Down Expand Up @@ -105,7 +106,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz);

#ifdef CONFIG_PM

int pxa_cpu_pm_prepare(suspend_state_t state)
int pxa_pm_prepare(suspend_state_t state)
{
switch (state) {
case PM_SUSPEND_MEM:
Expand Down Expand Up @@ -133,4 +134,21 @@ void pxa_cpu_pm_enter(suspend_state_t state)
}
}

static struct pm_ops pxa25x_pm_ops = {
.prepare = pxa_pm_prepare,
.enter = pxa_pm_enter,
.valid = pm_valid_only_mem,
};
#endif

static int __init pxa25x_init(void)
{
if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
#ifdef CONFIG_PM
pm_set_ops(&pxa25x_pm_ops);
#endif
}
return 0;
}

subsys_initcall(pxa25x_init);
17 changes: 15 additions & 2 deletions trunk/arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <asm/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/ohci.h>
#include <asm/arch/pm.h>

#include "generic.h"

Expand Down Expand Up @@ -122,7 +123,7 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz);

#ifdef CONFIG_PM

int pxa_cpu_pm_prepare(suspend_state_t state)
int pxa_pm_prepare(suspend_state_t state)
{
switch (state) {
case PM_SUSPEND_MEM:
Expand Down Expand Up @@ -162,6 +163,11 @@ void pxa_cpu_pm_enter(suspend_state_t state)
}
}

static struct pm_ops pxa27x_pm_ops = {
.prepare = pxa_pm_prepare,
.enter = pxa_pm_enter,
.valid = pm_valid_only_mem,
};
#endif

/*
Expand Down Expand Up @@ -205,7 +211,14 @@ static struct platform_device *devices[] __initdata = {

static int __init pxa27x_init(void)
{
return platform_add_devices(devices, ARRAY_SIZE(devices));
int ret = 0;
if (cpu_is_pxa27x()) {
#ifdef CONFIG_PM
pm_set_ops(&pxa27x_pm_ops);
#endif
ret = platform_add_devices(devices, ARRAY_SIZE(devices));
}
return ret;
}

subsys_initcall(pxa27x_init);

0 comments on commit 135b1e5

Please sign in to comment.