1 // SPDX-License-Identifier: GPL-2.0-only
3 * PS3 System Manager core.
5 * Copyright (C) 2007 Sony Computer Entertainment Inc.
6 * Copyright 2007 Sony Corp.
9 #include <linux/kernel.h>
10 #include <linux/export.h>
11 #include <asm/lv1call.h>
15 * Staticly linked routines that allow late binding of a loaded sys-manager
19 static struct ps3_sys_manager_ops ps3_sys_manager_ops
;
22 * ps3_register_sys_manager_ops - Bind ps3_sys_manager_ops to a module.
23 * @ops: struct ps3_sys_manager_ops.
25 * To be called from ps3_sys_manager_probe() and ps3_sys_manager_remove() to
26 * register call back ops for power control. Copies data to the static
27 * variable ps3_sys_manager_ops.
30 void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops
*ops
)
34 ps3_sys_manager_ops
= ops
? *ops
: ps3_sys_manager_ops
;
36 EXPORT_SYMBOL_GPL(ps3_sys_manager_register_ops
);
38 void __noreturn
ps3_sys_manager_power_off(void)
40 if (ps3_sys_manager_ops
.power_off
)
41 ps3_sys_manager_ops
.power_off(ps3_sys_manager_ops
.dev
);
43 ps3_sys_manager_halt();
46 void __noreturn
ps3_sys_manager_restart(void)
48 if (ps3_sys_manager_ops
.restart
)
49 ps3_sys_manager_ops
.restart(ps3_sys_manager_ops
.dev
);
51 ps3_sys_manager_halt();
54 void __noreturn
ps3_sys_manager_halt(void)
56 pr_emerg("System Halted, OK to turn off power\n");