1 From e41d00bdaa31b36fd314e927104082615aa4643a Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
3 Date: Thu, 15 Apr 2021 13:49:47 +0300
4 Subject: [PATCH 197/247] ARM: at91: pm: move pm_bu to soc_pm data structure
6 Move pm_bu to soc_pm data structure.
8 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
9 Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
10 Link: https://lore.kernel.org/r/20210415105010.569620-2-claudiu.beznea@microchip.com
12 arch/arm/mach-at91/pm.c | 34 +++++++++++++++++++++-------------
13 1 file changed, 21 insertions(+), 13 deletions(-)
15 --- a/arch/arm/mach-at91/pm.c
16 +++ b/arch/arm/mach-at91/pm.c
22 + * struct at91_pm_bu - AT91 power management backup unit data structure
23 + * @suspended: true if suspended to backup mode
24 + * @reserved: reserved
25 + * @canary: canary data for memory checking after exit from backup mode
26 + * @resume: resume API
30 + unsigned long reserved;
36 int (*config_shdwc_ws)(void __iomem *shdwc, u32 *mode, u32 *polarity);
37 int (*config_pmc_ws)(void __iomem *pmc, u32 mode, u32 polarity);
38 const struct of_device_id *ws_ids;
39 + struct at91_pm_bu *bu;
40 struct at91_pm_data data;
43 @@ -71,13 +86,6 @@ static int at91_pm_valid_state(suspend_s
45 static int canary = 0xA5A5A5A5;
47 -static struct at91_pm_bu {
49 - unsigned long reserved;
54 struct wakeup_source_info {
55 unsigned int pmc_fsmr_bit;
56 unsigned int shdwc_mr_bit;
57 @@ -288,7 +296,7 @@ static int at91_suspend_finish(unsigned
58 static void at91_pm_suspend(suspend_state_t state)
60 if (soc_pm.data.mode == AT91_PM_BACKUP) {
61 - pm_bu->suspended = 1;
62 + soc_pm.bu->suspended = 1;
64 cpu_suspend(0, at91_suspend_finish);
66 @@ -672,16 +680,16 @@ static int __init at91_pm_backup_init(vo
70 - pm_bu = (void *)gen_pool_alloc(sram_pool, sizeof(struct at91_pm_bu));
72 + soc_pm.bu = (void *)gen_pool_alloc(sram_pool, sizeof(struct at91_pm_bu));
74 pr_warn("%s: unable to alloc securam!\n", __func__);
79 - pm_bu->suspended = 0;
80 - pm_bu->canary = __pa_symbol(&canary);
81 - pm_bu->resume = __pa_symbol(cpu_resume);
82 + soc_pm.bu->suspended = 0;
83 + soc_pm.bu->canary = __pa_symbol(&canary);
84 + soc_pm.bu->resume = __pa_symbol(cpu_resume);