mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 04:22:19 +07:00
a30eceb7a5
Ask firmware to put RAM in self-refresh mode and power system down. echo mem > /sys/power/state See Documentation/power/states.txt Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
33 lines
622 B
C
33 lines
622 B
C
#include <linux/init.h>
|
|
#include <linux/suspend.h>
|
|
#include <asm/suspend.h>
|
|
#include "smc.h"
|
|
|
|
static int tango_pm_powerdown(unsigned long arg)
|
|
{
|
|
tango_suspend(virt_to_phys(cpu_resume));
|
|
|
|
return -EIO; /* tango_suspend has failed */
|
|
}
|
|
|
|
static int tango_pm_enter(suspend_state_t state)
|
|
{
|
|
if (state == PM_SUSPEND_MEM)
|
|
return cpu_suspend(0, tango_pm_powerdown);
|
|
|
|
return -EINVAL;
|
|
}
|
|
|
|
static const struct platform_suspend_ops tango_pm_ops = {
|
|
.enter = tango_pm_enter,
|
|
.valid = suspend_valid_only_mem,
|
|
};
|
|
|
|
static int __init tango_pm_init(void)
|
|
{
|
|
suspend_set_ops(&tango_pm_ops);
|
|
return 0;
|
|
}
|
|
|
|
late_initcall(tango_pm_init);
|