Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kevin Hilman <khilman@ti.com>
Acked-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+37 -15
+19
arch/arm/include/asm/suspend.h
··· 1 + #ifndef __ASM_ARM_SUSPEND_H 2 + #define __ASM_ARM_SUSPEND_H 3 + 4 + #include <asm/memory.h> 5 + 6 + extern void cpu_resume(void); 7 + 8 + /* 9 + * Hide the first two arguments to __cpu_suspend - these are an implementation 10 + * detail which platform code shouldn't have to know about. 11 + */ 12 + static inline void cpu_suspend(unsigned long arg, void (*fn)(unsigned long)) 13 + { 14 + extern void __cpu_suspend(int, long, unsigned long, 15 + void (*)(unsigned long)); 16 + __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn); 17 + } 18 + 19 + #endif
-2
arch/arm/include/asm/system.h
··· 106 106 107 107 extern int cpu_architecture(void); 108 108 extern void cpu_init(void); 109 - extern void cpu_suspend(int, long, unsigned long, void (*)(unsigned long)); 110 - extern void cpu_resume(void); 111 109 112 110 void arm_machine_restart(char mode, const char *cmd); 113 111 extern void (*arm_pm_restart)(char str, const char *cmd);
+2 -2
arch/arm/kernel/sleep.S
··· 14 14 * r3 = suspend function 15 15 * Note: does not return until system resumes 16 16 */ 17 - ENTRY(cpu_suspend) 17 + ENTRY(__cpu_suspend) 18 18 stmfd sp!, {r4 - r11, lr} 19 19 #ifdef MULTI_CPU 20 20 ldr r10, =processor ··· 56 56 bl __cpuc_flush_kern_all 57 57 #endif 58 58 ldmfd sp!, {r0, pc} @ call suspend fn 59 - ENDPROC(cpu_suspend) 59 + ENDPROC(__cpu_suspend) 60 60 .ltorg 61 61 62 62 /*
+3 -2
arch/arm/mach-omap2/pm34xx.c
··· 31 31 #include <linux/console.h> 32 32 #include <trace/events/power.h> 33 33 34 + #include <asm/suspend.h> 35 + 34 36 #include <plat/sram.h> 35 37 #include "clockdomain.h" 36 38 #include "powerdomain.h" ··· 413 411 * from there before resuming. 414 412 */ 415 413 if (save_state == 1 || save_state == 3) 416 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, save_state, 417 - omap34xx_do_sram_idle); 414 + cpu_suspend(save_state, omap34xx_do_sram_idle); 418 415 else 419 416 omap34xx_do_sram_idle(save_state); 420 417
+1
arch/arm/mach-pxa/palmz72.c
··· 33 33 #include <linux/i2c-gpio.h> 34 34 35 35 #include <asm/mach-types.h> 36 + #include <asm/suspend.h> 36 37 #include <asm/mach/arch.h> 37 38 #include <asm/mach/map.h> 38 39
+2 -2
arch/arm/mach-pxa/pxa25x.c
··· 25 25 #include <linux/irq.h> 26 26 27 27 #include <asm/mach/map.h> 28 + #include <asm/suspend.h> 28 29 #include <mach/hardware.h> 29 30 #include <mach/irqs.h> 30 31 #include <mach/gpio.h> ··· 245 244 246 245 switch (state) { 247 246 case PM_SUSPEND_MEM: 248 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, PWRMODE_SLEEP, 249 - pxa25x_finish_suspend); 247 + cpu_suspend(PWRMODE_SLEEP, pxa25x_finish_suspend); 250 248 break; 251 249 } 252 250 }
+2 -2
arch/arm/mach-pxa/pxa27x.c
··· 24 24 #include <asm/mach/map.h> 25 25 #include <mach/hardware.h> 26 26 #include <asm/irq.h> 27 + #include <asm/suspend.h> 27 28 #include <mach/irqs.h> 28 29 #include <mach/gpio.h> 29 30 #include <mach/pxa27x.h> ··· 305 304 pxa_cpu_standby(); 306 305 break; 307 306 case PM_SUSPEND_MEM: 308 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, pwrmode, 309 - pxa27x_finish_suspend); 307 + cpu_suspend(pwrmode, pxa27x_finish_suspend); 310 308 #ifndef CONFIG_IWMMXT 311 309 asm volatile("mar acc0, %Q0, %R0" : "=r" (acc0)); 312 310 #endif
+2 -1
arch/arm/mach-pxa/pxa3xx.c
··· 24 24 #include <linux/i2c/pxa-i2c.h> 25 25 26 26 #include <asm/mach/map.h> 27 + #include <asm/suspend.h> 27 28 #include <mach/hardware.h> 28 29 #include <mach/gpio.h> 29 30 #include <mach/pxa3xx-regs.h> ··· 168 167 /* overwrite with the resume address */ 169 168 *p = virt_to_phys(cpu_resume); 170 169 171 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pxa3xx_finish_suspend); 170 + cpu_suspend(0, pxa3xx_finish_suspend); 172 171 173 172 *p = saved_data; 174 173
+2 -2
arch/arm/mach-pxa/zeus.c
··· 31 31 #include <linux/can/platform/mcp251x.h> 32 32 33 33 #include <asm/mach-types.h> 34 + #include <asm/suspend.h> 34 35 #include <asm/mach/arch.h> 35 36 #include <asm/mach/map.h> 36 37 ··· 677 676 static void zeus_power_off(void) 678 677 { 679 678 local_irq_disable(); 680 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, PWRMODE_DEEPSLEEP, 681 - pxa27x_finish_suspend); 679 + cpu_suspend(PWRMODE_DEEPSLEEP, pxa27x_finish_suspend); 682 680 } 683 681 #else 684 682 #define zeus_power_off NULL
+2 -1
arch/arm/mach-sa1100/pm.c
··· 29 29 30 30 #include <mach/hardware.h> 31 31 #include <asm/memory.h> 32 + #include <asm/suspend.h> 32 33 #include <asm/system.h> 33 34 #include <asm/mach/time.h> 34 35 ··· 76 75 PSPR = virt_to_phys(cpu_resume); 77 76 78 77 /* go zzz */ 79 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, sa1100_finish_suspend); 78 + cpu_suspend(0, sa1100_finish_suspend); 80 79 81 80 /* 82 81 * Ensure not to come back here if it wasn't intended
+2 -1
arch/arm/plat-samsung/pm.c
··· 20 20 #include <linux/io.h> 21 21 22 22 #include <asm/cacheflush.h> 23 + #include <asm/suspend.h> 23 24 #include <mach/hardware.h> 24 25 #include <mach/map.h> 25 26 ··· 299 298 * we resume as it saves its own register state and restores it 300 299 * during the resume. */ 301 300 302 - cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pm_cpu_sleep); 301 + cpu_suspend(0, pm_cpu_sleep); 303 302 304 303 /* restore the system state */ 305 304