mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 05:07:59 +07:00
86fe639a1c
Provide a new default fallback power off that just sits in a wfi loop to save some power. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Atish Patra <atish.patra@wdc.com> [paul.walmsley@sifive.com: split the WFI fix apart from the nommu-related default_power_off() changes] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
35 lines
522 B
C
35 lines
522 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (C) 2012 Regents of the University of California
|
|
*/
|
|
|
|
#include <linux/reboot.h>
|
|
#include <linux/pm.h>
|
|
#include <asm/sbi.h>
|
|
|
|
static void default_power_off(void)
|
|
{
|
|
sbi_shutdown();
|
|
while (1)
|
|
wait_for_interrupt();
|
|
}
|
|
|
|
void (*pm_power_off)(void) = default_power_off;
|
|
EXPORT_SYMBOL(pm_power_off);
|
|
|
|
void machine_restart(char *cmd)
|
|
{
|
|
do_kernel_restart(cmd);
|
|
while (1);
|
|
}
|
|
|
|
void machine_halt(void)
|
|
{
|
|
pm_power_off();
|
|
}
|
|
|
|
void machine_power_off(void)
|
|
{
|
|
pm_power_off();
|
|
}
|