1 From 62be32b56ff31b2cd048a53fac40a165c5bc66cd Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
3 Date: Thu, 15 Apr 2021 13:50:06 +0300
4 Subject: [PATCH 215/247] ARM: at91: pm: add backup mode support for SAMA7G5
6 Adapt at91_pm_backup_init() to work for SAMA7G5. Also, set the LPM pin
7 to shutdown controller. This will signal to PMIC that it needs to switch
8 to the state corresponding to backup mode.
10 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
11 Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
12 Link: https://lore.kernel.org/r/20210415105010.569620-21-claudiu.beznea@microchip.com
14 arch/arm/mach-at91/pm.c | 3 ++-
15 arch/arm/mach-at91/pm_suspend.S | 7 +++++++
16 2 files changed, 9 insertions(+), 1 deletion(-)
18 --- a/arch/arm/mach-at91/pm.c
19 +++ b/arch/arm/mach-at91/pm.c
20 @@ -744,7 +744,8 @@ static int __init at91_pm_backup_init(vo
21 struct platform_device *pdev;
22 int ret = -ENODEV, located = 0;
24 - if (!IS_ENABLED(CONFIG_SOC_SAMA5D2))
25 + if (!IS_ENABLED(CONFIG_SOC_SAMA5D2) &&
26 + !IS_ENABLED(CONFIG_SOC_SAMA7G5))
29 if (!at91_is_pm_mode_active(AT91_PM_BACKUP))
30 --- a/arch/arm/mach-at91/pm_suspend.S
31 +++ b/arch/arm/mach-at91/pm_suspend.S
32 @@ -106,6 +106,12 @@ lp_done_\ena:
36 + .macro at91_backup_set_lpm reg
37 +#ifdef CONFIG_SOC_SAMA7
38 + orr \reg, \reg, #0x200000
45 @@ -989,6 +995,7 @@ ulp_exit:
49 + at91_backup_set_lpm tmp1