1 From c8f2a8aaae41fa0a40ad88855ae82696098230d7 Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
3 Date: Thu, 15 Apr 2021 13:49:48 +0300
4 Subject: [PATCH 198/247] ARM: at91: pm: move the setup of soc_pm.bu->suspended
6 Move the setup of soc_pm.bu->suspended in platform_suspend::begin
7 function so that the PMC code in charge with clocks suspend/resume
8 to differentiate b/w standard PM mode and backup mode.
10 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
11 Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
12 Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
13 Link: https://lore.kernel.org/r/20210415105010.569620-3-claudiu.beznea@microchip.com
15 arch/arm/mach-at91/pm.c | 15 ++++++++++++---
16 1 file changed, 12 insertions(+), 3 deletions(-)
18 --- a/arch/arm/mach-at91/pm.c
19 +++ b/arch/arm/mach-at91/pm.c
20 @@ -214,6 +214,8 @@ static int at91_sam9x60_config_pmc_ws(vo
22 static int at91_pm_begin(suspend_state_t state)
28 soc_pm.data.mode = soc_pm.data.suspend_mode;
29 @@ -227,7 +229,16 @@ static int at91_pm_begin(suspend_state_t
30 soc_pm.data.mode = -1;
33 - return at91_pm_config_ws(soc_pm.data.mode, true);
34 + ret = at91_pm_config_ws(soc_pm.data.mode, true);
38 + if (soc_pm.data.mode == AT91_PM_BACKUP)
39 + soc_pm.bu->suspended = 1;
41 + soc_pm.bu->suspended = 0;
47 @@ -296,8 +307,6 @@ static int at91_suspend_finish(unsigned
48 static void at91_pm_suspend(suspend_state_t state)
50 if (soc_pm.data.mode == AT91_PM_BACKUP) {
51 - soc_pm.bu->suspended = 1;
53 cpu_suspend(0, at91_suspend_finish);
55 /* The SRAM is lost between suspend cycles */