diff options
author | Wenyou Yang <wenyou.yang@atmel.com> | 2015-03-08 23:51:09 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-03-13 08:34:54 -0400 |
commit | 5726a8b9686348e8d203f1bbf9d5fc1bb5899518 (patch) | |
tree | 025029d4b23cbcf4193dd25273e169c6fa15955d /arch/arm/mach-at91 | |
parent | 828b98fa380662406f9a84e09372b18e45babbf2 (diff) |
ARM: at91/pm: rename function name: at91_slow_clock() --> at91_pm_suspend_sram_fn()
As the file name is renamed, rename the function name at91_slow_clock()
--> at91_pm_suspend_sram_fn(), rename the function handler's name at the
same time.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
[nicolas.ferre@atmel.com: little update of the commit message]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/pm.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-at91/pm_suspend.S | 26 |
2 files changed, 25 insertions, 28 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 3fc5e12043a2..a008e9cb88ef 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -120,13 +120,12 @@ int at91_suspend_entering_slow_clock(void) | |||
120 | } | 120 | } |
121 | EXPORT_SYMBOL(at91_suspend_entering_slow_clock); | 121 | EXPORT_SYMBOL(at91_suspend_entering_slow_clock); |
122 | 122 | ||
123 | 123 | static void (*at91_suspend_sram_fn)(void __iomem *pmc, void __iomem *ramc0, | |
124 | static void (*slow_clock)(void __iomem *pmc, void __iomem *ramc0, | ||
125 | void __iomem *ramc1, int memctrl); | 124 | void __iomem *ramc1, int memctrl); |
126 | 125 | ||
127 | extern void at91_slow_clock(void __iomem *pmc, void __iomem *ramc0, | 126 | extern void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *ramc0, |
128 | void __iomem *ramc1, int memctrl); | 127 | void __iomem *ramc1, int memctrl); |
129 | extern u32 at91_slow_clock_sz; | 128 | extern u32 at91_pm_suspend_in_sram_sz; |
130 | 129 | ||
131 | static void at91_pm_suspend(suspend_state_t state) | 130 | static void at91_pm_suspend(suspend_state_t state) |
132 | { | 131 | { |
@@ -135,8 +134,8 @@ static void at91_pm_suspend(suspend_state_t state) | |||
135 | pm_data |= (state == PM_SUSPEND_MEM) ? | 134 | pm_data |= (state == PM_SUSPEND_MEM) ? |
136 | AT91_PM_MODE(AT91_PM_SLOW_CLOCK) : 0; | 135 | AT91_PM_MODE(AT91_PM_SLOW_CLOCK) : 0; |
137 | 136 | ||
138 | slow_clock(at91_pmc_base, at91_ramc_base[0], | 137 | at91_suspend_sram_fn(at91_pmc_base, at91_ramc_base[0], |
139 | at91_ramc_base[1], pm_data); | 138 | at91_ramc_base[1], pm_data); |
140 | } | 139 | } |
141 | 140 | ||
142 | static int at91_pm_enter(suspend_state_t state) | 141 | static int at91_pm_enter(suspend_state_t state) |
@@ -278,21 +277,23 @@ static void __init at91_pm_sram_init(void) | |||
278 | return; | 277 | return; |
279 | } | 278 | } |
280 | 279 | ||
281 | sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz); | 280 | sram_base = gen_pool_alloc(sram_pool, at91_pm_suspend_in_sram_sz); |
282 | if (!sram_base) { | 281 | if (!sram_base) { |
283 | pr_warn("%s: unable to alloc ocram!\n", __func__); | 282 | pr_warn("%s: unable to alloc sram!\n", __func__); |
284 | return; | 283 | return; |
285 | } | 284 | } |
286 | 285 | ||
287 | sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); | 286 | sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); |
288 | slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false); | 287 | at91_suspend_sram_fn = __arm_ioremap_exec(sram_pbase, |
289 | if (!slow_clock) { | 288 | at91_pm_suspend_in_sram_sz, false); |
289 | if (!at91_suspend_sram_fn) { | ||
290 | pr_warn("SRAM: Could not map\n"); | 290 | pr_warn("SRAM: Could not map\n"); |
291 | return; | 291 | return; |
292 | } | 292 | } |
293 | 293 | ||
294 | /* Copy the slow_clock handler to SRAM */ | 294 | /* Copy the pm suspend handler to SRAM */ |
295 | slow_clock = fncpy(slow_clock, &at91_slow_clock, at91_slow_clock_sz); | 295 | at91_suspend_sram_fn = fncpy(at91_suspend_sram_fn, |
296 | &at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); | ||
296 | } | 297 | } |
297 | 298 | ||
298 | static void __init at91_pm_init(void) | 299 | static void __init at91_pm_init(void) |
@@ -302,7 +303,7 @@ static void __init at91_pm_init(void) | |||
302 | if (at91_cpuidle_device.dev.platform_data) | 303 | if (at91_cpuidle_device.dev.platform_data) |
303 | platform_device_register(&at91_cpuidle_device); | 304 | platform_device_register(&at91_cpuidle_device); |
304 | 305 | ||
305 | if (slow_clock) | 306 | if (at91_suspend_sram_fn) |
306 | suspend_set_ops(&at91_pm_ops); | 307 | suspend_set_ops(&at91_pm_ops); |
307 | else | 308 | else |
308 | pr_info("AT91: PM not supported, due to no SRAM allocated\n"); | 309 | pr_info("AT91: PM not supported, due to no SRAM allocated\n"); |
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S index db35f72e7bad..1002bb80a939 100644 --- a/arch/arm/mach-at91/pm_suspend.S +++ b/arch/arm/mach-at91/pm_suspend.S | |||
@@ -55,23 +55,19 @@ tmp2 .req r5 | |||
55 | 55 | ||
56 | .arm | 56 | .arm |
57 | 57 | ||
58 | /* void at91_slow_clock(void __iomem *pmc, void __iomem *sdramc, | 58 | /* |
59 | * void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *sdramc, | ||
59 | * void __iomem *ramc1, int memctrl) | 60 | * void __iomem *ramc1, int memctrl) |
61 | * @input param: | ||
62 | * @r0: base address of AT91_PMC | ||
63 | * @r1: base address of SDRAM Controller (SDRAM, DDRSDR, or AT91_SYS) | ||
64 | * @r2: base address of second SDRAM Controller or 0 if not present | ||
65 | * @r3: pm information | ||
60 | */ | 66 | */ |
61 | ENTRY(at91_slow_clock) | 67 | ENTRY(at91_pm_suspend_in_sram) |
62 | /* Save registers on stack */ | 68 | /* Save registers on stack */ |
63 | stmfd sp!, {r4 - r12, lr} | 69 | stmfd sp!, {r4 - r12, lr} |
64 | 70 | ||
65 | /* | ||
66 | * Register usage: | ||
67 | * R0 = Base address of AT91_PMC | ||
68 | * R1 = Base address of RAM Controller (SDRAM, DDRSDR, or AT91_SYS) | ||
69 | * R2 = Base address of second RAM Controller or 0 if not present | ||
70 | * R3 = Memory controller | ||
71 | * R4 = temporary register | ||
72 | * R5 = temporary register | ||
73 | */ | ||
74 | |||
75 | /* Drain write buffer */ | 71 | /* Drain write buffer */ |
76 | mov tmp1, #0 | 72 | mov tmp1, #0 |
77 | mcr p15, 0, tmp1, c7, c10, 4 | 73 | mcr p15, 0, tmp1, c7, c10, 4 |
@@ -170,7 +166,7 @@ skip_enable_main_clock: | |||
170 | 166 | ||
171 | /* Restore registers, and return */ | 167 | /* Restore registers, and return */ |
172 | ldmfd sp!, {r4 - r12, pc} | 168 | ldmfd sp!, {r4 - r12, pc} |
173 | ENDPROC(at91_slow_clock) | 169 | ENDPROC(at91_pm_suspend_in_sram) |
174 | 170 | ||
175 | /* | 171 | /* |
176 | * void at91_sramc_self_refresh(unsigned int is_active) | 172 | * void at91_sramc_self_refresh(unsigned int is_active) |
@@ -320,5 +316,5 @@ ENDPROC(at91_sramc_self_refresh) | |||
320 | .saved_sam9_mdr1: | 316 | .saved_sam9_mdr1: |
321 | .word 0 | 317 | .word 0 |
322 | 318 | ||
323 | ENTRY(at91_slow_clock_sz) | 319 | ENTRY(at91_pm_suspend_in_sram_sz) |
324 | .word .-at91_slow_clock | 320 | .word .-at91_pm_suspend_in_sram |