Commit 31f1a8b0 authored by Yinbo Zhu's avatar Yinbo Zhu Committed by Huacai Chen

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: default avatarYinbo Zhu <zhuyinbo@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 01158487
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#ifndef _ASM_LOONGARCH_ACPI_H #ifndef _ASM_LOONGARCH_ACPI_H
#define _ASM_LOONGARCH_ACPI_H #define _ASM_LOONGARCH_ACPI_H
#include <asm/suspend.h>
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
extern int acpi_strict; extern int acpi_strict;
extern int acpi_disabled; extern int acpi_disabled;
...@@ -46,12 +48,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu) ...@@ -46,12 +48,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
extern int loongarch_acpi_suspend(void); extern int loongarch_acpi_suspend(void);
extern int (*acpi_suspend_lowlevel)(void); extern int (*acpi_suspend_lowlevel)(void);
extern void loongarch_suspend_enter(void);
static inline unsigned long acpi_get_wakeup_address(void) static inline unsigned long acpi_get_wakeup_address(void)
{ {
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
extern void loongarch_wakeup_start(void);
return (unsigned long)loongarch_wakeup_start; return (unsigned long)loongarch_wakeup_start;
#endif #endif
return 0UL; return 0UL;
......
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H
void loongarch_common_suspend(void);
void loongarch_common_resume(void);
void loongarch_suspend_enter(void);
void loongarch_wakeup_start(void);
#endif
...@@ -27,7 +27,7 @@ struct saved_registers { ...@@ -27,7 +27,7 @@ struct saved_registers {
}; };
static struct saved_registers saved_regs; static struct saved_registers saved_regs;
static void arch_common_suspend(void) void loongarch_common_suspend(void)
{ {
save_counter(); save_counter();
saved_regs.pgd = csr_read64(LOONGARCH_CSR_PGDL); saved_regs.pgd = csr_read64(LOONGARCH_CSR_PGDL);
...@@ -40,7 +40,7 @@ static void arch_common_suspend(void) ...@@ -40,7 +40,7 @@ static void arch_common_suspend(void)
loongarch_suspend_addr = loongson_sysconf.suspend_addr; loongarch_suspend_addr = loongson_sysconf.suspend_addr;
} }
static void arch_common_resume(void) void loongarch_common_resume(void)
{ {
sync_counter(); sync_counter();
local_flush_tlb_all(); local_flush_tlb_all();
...@@ -62,12 +62,12 @@ int loongarch_acpi_suspend(void) ...@@ -62,12 +62,12 @@ int loongarch_acpi_suspend(void)
enable_gpe_wakeup(); enable_gpe_wakeup();
enable_pci_wakeup(); enable_pci_wakeup();
arch_common_suspend(); loongarch_common_suspend();
/* processor specific suspend */ /* processor specific suspend */
loongarch_suspend_enter(); loongarch_suspend_enter();
arch_common_resume(); loongarch_common_resume();
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment