Commit 2c74a0ce authored by Russell King's avatar Russell King

ARM: pm: hide 1st and 2nd arguments to cpu_suspend from platform code

The first and second arguments shouldn't concern platform code, so
hide them from each platforms caller.
Tested-by: default avatarKevin Hilman <khilman@ti.com>
Acked-by: default avatarJean Pihet <j-pihet@ti.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 14c79bbe
#ifndef __ASM_ARM_SUSPEND_H
#define __ASM_ARM_SUSPEND_H
#include <asm/memory.h>
extern void cpu_resume(void);
/*
* Hide the first two arguments to __cpu_suspend - these are an implementation
* detail which platform code shouldn't have to know about.
*/
static inline void cpu_suspend(unsigned long arg, void (*fn)(unsigned long))
{
extern void __cpu_suspend(int, long, unsigned long,
void (*)(unsigned long));
__cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn);
}
#endif
...@@ -106,8 +106,6 @@ extern void __show_regs(struct pt_regs *); ...@@ -106,8 +106,6 @@ extern void __show_regs(struct pt_regs *);
extern int cpu_architecture(void); extern int cpu_architecture(void);
extern void cpu_init(void); extern void cpu_init(void);
extern void cpu_suspend(int, long, unsigned long, void (*)(unsigned long));
extern void cpu_resume(void);
void arm_machine_restart(char mode, const char *cmd); void arm_machine_restart(char mode, const char *cmd);
extern void (*arm_pm_restart)(char str, const char *cmd); extern void (*arm_pm_restart)(char str, const char *cmd);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* r3 = suspend function * r3 = suspend function
* Note: does not return until system resumes * Note: does not return until system resumes
*/ */
ENTRY(cpu_suspend) ENTRY(__cpu_suspend)
stmfd sp!, {r4 - r11, lr} stmfd sp!, {r4 - r11, lr}
#ifdef MULTI_CPU #ifdef MULTI_CPU
ldr r10, =processor ldr r10, =processor
...@@ -56,7 +56,7 @@ ENTRY(cpu_suspend) ...@@ -56,7 +56,7 @@ ENTRY(cpu_suspend)
bl __cpuc_flush_kern_all bl __cpuc_flush_kern_all
#endif #endif
ldmfd sp!, {r0, pc} @ call suspend fn ldmfd sp!, {r0, pc} @ call suspend fn
ENDPROC(cpu_suspend) ENDPROC(__cpu_suspend)
.ltorg .ltorg
/* /*
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include <linux/console.h> #include <linux/console.h>
#include <trace/events/power.h> #include <trace/events/power.h>
#include <asm/suspend.h>
#include <plat/sram.h> #include <plat/sram.h>
#include "clockdomain.h" #include "clockdomain.h"
#include "powerdomain.h" #include "powerdomain.h"
...@@ -411,8 +413,7 @@ void omap_sram_idle(void) ...@@ -411,8 +413,7 @@ void omap_sram_idle(void)
* from there before resuming. * from there before resuming.
*/ */
if (save_state == 1 || save_state == 3) if (save_state == 1 || save_state == 3)
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, save_state, cpu_suspend(save_state, omap34xx_do_sram_idle);
omap34xx_do_sram_idle);
else else
omap34xx_do_sram_idle(save_state); omap34xx_do_sram_idle(save_state);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/i2c-gpio.h> #include <linux/i2c-gpio.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/suspend.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/suspend.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/gpio.h> #include <mach/gpio.h>
...@@ -244,8 +245,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state) ...@@ -244,8 +245,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
switch (state) { switch (state) {
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, PWRMODE_SLEEP, cpu_suspend(PWRMODE_SLEEP, pxa25x_finish_suspend);
pxa25x_finish_suspend);
break; break;
} }
} }
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/suspend.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/gpio.h> #include <mach/gpio.h>
#include <mach/pxa27x.h> #include <mach/pxa27x.h>
...@@ -304,8 +305,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) ...@@ -304,8 +305,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
pxa_cpu_standby(); pxa_cpu_standby();
break; break;
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, pwrmode, cpu_suspend(pwrmode, pxa27x_finish_suspend);
pxa27x_finish_suspend);
#ifndef CONFIG_IWMMXT #ifndef CONFIG_IWMMXT
asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0)); asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0));
#endif #endif
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/i2c/pxa-i2c.h> #include <linux/i2c/pxa-i2c.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/suspend.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/gpio.h> #include <mach/gpio.h>
#include <mach/pxa3xx-regs.h> #include <mach/pxa3xx-regs.h>
...@@ -167,7 +168,7 @@ static void pxa3xx_cpu_pm_suspend(void) ...@@ -167,7 +168,7 @@ static void pxa3xx_cpu_pm_suspend(void)
/* overwrite with the resume address */ /* overwrite with the resume address */
*p = virt_to_phys(cpu_resume); *p = virt_to_phys(cpu_resume);
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pxa3xx_finish_suspend); cpu_suspend(0, pxa3xx_finish_suspend);
*p = saved_data; *p = saved_data;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/can/platform/mcp251x.h> #include <linux/can/platform/mcp251x.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/suspend.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -676,8 +677,7 @@ static struct pxa2xx_udc_mach_info zeus_udc_info = { ...@@ -676,8 +677,7 @@ static struct pxa2xx_udc_mach_info zeus_udc_info = {
static void zeus_power_off(void) static void zeus_power_off(void)
{ {
local_irq_disable(); local_irq_disable();
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, PWRMODE_DEEPSLEEP, cpu_suspend(PWRMODE_DEEPSLEEP, pxa27x_finish_suspend);
pxa27x_finish_suspend);
} }
#else #else
#define zeus_power_off NULL #define zeus_power_off NULL
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/suspend.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
...@@ -75,7 +76,7 @@ static int sa11x0_pm_enter(suspend_state_t state) ...@@ -75,7 +76,7 @@ static int sa11x0_pm_enter(suspend_state_t state)
PSPR = virt_to_phys(cpu_resume); PSPR = virt_to_phys(cpu_resume);
/* go zzz */ /* go zzz */
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, sa1100_finish_suspend); cpu_suspend(0, sa1100_finish_suspend);
/* /*
* Ensure not to come back here if it wasn't intended * Ensure not to come back here if it wasn't intended
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/suspend.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/map.h> #include <mach/map.h>
...@@ -298,7 +299,7 @@ static int s3c_pm_enter(suspend_state_t state) ...@@ -298,7 +299,7 @@ static int s3c_pm_enter(suspend_state_t state)
* we resume as it saves its own register state and restores it * we resume as it saves its own register state and restores it
* during the resume. */ * during the resume. */
cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pm_cpu_sleep); cpu_suspend(0, pm_cpu_sleep);
/* restore the system state */ /* restore the system state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment