aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ps3/sys-manager-core.c
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-06-15 18:03:54 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-28 05:16:41 -0400
commit66c63b84b23d39ce191a18833b5a769370114ec9 (patch)
tree8903417c0f89aba779e8f81bb51b9e9c6a68fd07 /drivers/ps3/sys-manager-core.c
parent7626e78d29651d3075e88f233c0632867ea6a35c (diff)
[POWERPC] PS3: System manager re-work
PS3 sys-manager updates to reflect the new PS3 unifed device support. Fixups to the PS3 sys-manager driver to properly support sys_reboot(). - Add varable request_tag to struct ps3_sys_manager_header. - Move ctrl_alt_del from PS3_SM_EVENT_POWER_RELEASED to PS3_SM_EVENT_POWER_PRESSED. - Make the PS3 sys-manager driver a loadable module. - Add new file sys-manager-core.c. - Add new struct ps3_sys_manager_ops for dynamic binding. - Put data sent to device on stack. - Add support for PS3_SM_SERVICE_ID_REQUEST_ERROR. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/ps3/sys-manager-core.c')
-rw-r--r--drivers/ps3/sys-manager-core.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/ps3/sys-manager-core.c b/drivers/ps3/sys-manager-core.c
new file mode 100644
index 000000000000..31648f7d9ae1
--- /dev/null
+++ b/drivers/ps3/sys-manager-core.c
@@ -0,0 +1,68 @@
1/*
2 * PS3 System Manager core.
3 *
4 * Copyright (C) 2007 Sony Computer Entertainment Inc.
5 * Copyright 2007 Sony Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/kernel.h>
22#include <asm/ps3.h>
23
24/**
25 * Staticly linked routines that allow late binding of a loaded sys-manager
26 * module.
27 */
28
29static struct ps3_sys_manager_ops ps3_sys_manager_ops;
30
31/**
32 * ps3_register_sys_manager_ops - Bind ps3_sys_manager_ops to a module.
33 * @ops: struct ps3_sys_manager_ops.
34 *
35 * To be called from ps3_sys_manager_probe() and ps3_sys_manager_remove() to
36 * register call back ops for power control. Copies data to the static
37 * variable ps3_sys_manager_ops.
38 */
39
40void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops)
41{
42 BUG_ON(!ops);
43 BUG_ON(!ops->dev);
44 ps3_sys_manager_ops = ops ? *ops : ps3_sys_manager_ops;
45}
46EXPORT_SYMBOL_GPL(ps3_sys_manager_register_ops);
47
48void ps3_sys_manager_power_off(void)
49{
50 if (ps3_sys_manager_ops.power_off)
51 ps3_sys_manager_ops.power_off(ps3_sys_manager_ops.dev);
52
53 printk(KERN_EMERG "System Halted, OK to turn off power\n");
54 local_irq_disable();
55 while (1)
56 (void)0;
57}
58
59void ps3_sys_manager_restart(void)
60{
61 if (ps3_sys_manager_ops.restart)
62 ps3_sys_manager_ops.restart(ps3_sys_manager_ops.dev);
63
64 printk(KERN_EMERG "System Halted, OK to turn off power\n");
65 local_irq_disable();
66 while (1)
67 (void)0;
68}