ACPI / sleep: move acpi_processor_sleep to sleep.c
acpi_processor_sleep is neither related nor used by CPUIdle framework. It's used in system suspend/resume path as a syscore operation. It makes more sense to move it to acpi/sleep.c where all the S-state transition (a.k.a. Linux system suspend/hiberate) related code are present. Also make it depend on CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT so that it's not compiled on architecture like ARM64 where S-states are not yet defined in ACPI. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
db62fda318
commit
504997cf96
@@ -31,7 +31,6 @@
|
||||
#include <linux/sched.h> /* need_resched() */
|
||||
#include <linux/tick.h>
|
||||
#include <linux/cpuidle.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <acpi/processor.h>
|
||||
|
||||
/*
|
||||
@@ -193,42 +192,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static u32 saved_bm_rld;
|
||||
|
||||
static int acpi_processor_suspend(void)
|
||||
{
|
||||
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void acpi_processor_resume(void)
|
||||
{
|
||||
u32 resumed_bm_rld = 0;
|
||||
|
||||
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);
|
||||
if (resumed_bm_rld == saved_bm_rld)
|
||||
return;
|
||||
|
||||
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
|
||||
}
|
||||
|
||||
static struct syscore_ops acpi_processor_syscore_ops = {
|
||||
.suspend = acpi_processor_suspend,
|
||||
.resume = acpi_processor_resume,
|
||||
};
|
||||
|
||||
void acpi_processor_syscore_init(void)
|
||||
{
|
||||
register_syscore_ops(&acpi_processor_syscore_ops);
|
||||
}
|
||||
|
||||
void acpi_processor_syscore_exit(void)
|
||||
{
|
||||
unregister_syscore_ops(&acpi_processor_syscore_ops);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#if defined(CONFIG_X86)
|
||||
static void tsc_check_state(int state)
|
||||
{
|
||||
|
Reference in New Issue
Block a user