Skip to content

Commit 31f1a8b

Browse files
YinboZhuchenhuacai
authored andcommitted
LoongArch: Export some arch-specific pm interfaces
Some PMC (Power Management Controllers) need to support DTS and will use the suspend interfaces thus this patch was to export such interfaces for their use. Signed-off-by: Yinbo Zhu <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 0115848 commit 31f1a8b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

arch/loongarch/include/asm/acpi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#ifndef _ASM_LOONGARCH_ACPI_H
99
#define _ASM_LOONGARCH_ACPI_H
1010

11+
#include <asm/suspend.h>
12+
1113
#ifdef CONFIG_ACPI
1214
extern int acpi_strict;
1315
extern int acpi_disabled;
@@ -46,12 +48,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
4648

4749
extern int loongarch_acpi_suspend(void);
4850
extern int (*acpi_suspend_lowlevel)(void);
49-
extern void loongarch_suspend_enter(void);
5051

5152
static inline unsigned long acpi_get_wakeup_address(void)
5253
{
5354
#ifdef CONFIG_SUSPEND
54-
extern void loongarch_wakeup_start(void);
5555
return (unsigned long)loongarch_wakeup_start;
5656
#endif
5757
return 0UL;

arch/loongarch/include/asm/suspend.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __ASM_SUSPEND_H
3+
#define __ASM_SUSPEND_H
4+
5+
void loongarch_common_suspend(void);
6+
void loongarch_common_resume(void);
7+
void loongarch_suspend_enter(void);
8+
void loongarch_wakeup_start(void);
9+
10+
#endif

arch/loongarch/power/suspend.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct saved_registers {
2727
};
2828
static struct saved_registers saved_regs;
2929

30-
static void arch_common_suspend(void)
30+
void loongarch_common_suspend(void)
3131
{
3232
save_counter();
3333
saved_regs.pgd = csr_read64(LOONGARCH_CSR_PGDL);
@@ -40,7 +40,7 @@ static void arch_common_suspend(void)
4040
loongarch_suspend_addr = loongson_sysconf.suspend_addr;
4141
}
4242

43-
static void arch_common_resume(void)
43+
void loongarch_common_resume(void)
4444
{
4545
sync_counter();
4646
local_flush_tlb_all();
@@ -62,12 +62,12 @@ int loongarch_acpi_suspend(void)
6262
enable_gpe_wakeup();
6363
enable_pci_wakeup();
6464

65-
arch_common_suspend();
65+
loongarch_common_suspend();
6666

6767
/* processor specific suspend */
6868
loongarch_suspend_enter();
6969

70-
arch_common_resume();
70+
loongarch_common_resume();
7171

7272
return 0;
7373
}

0 commit comments

Comments
 (0)