aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy/devboards/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/alchemy/devboards/platform.c')
-rw-r--r--arch/mips/alchemy/devboards/platform.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/alchemy/devboards/platform.c b/arch/mips/alchemy/devboards/platform.c
index 7f2bcee7ac34..febf4e042343 100644
--- a/arch/mips/alchemy/devboards/platform.c
+++ b/arch/mips/alchemy/devboards/platform.c
@@ -8,6 +8,35 @@
8#include <linux/mtd/physmap.h> 8#include <linux/mtd/physmap.h>
9#include <linux/slab.h> 9#include <linux/slab.h>
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11#include <linux/pm.h>
12
13#include <asm/reboot.h>
14#include <asm/mach-db1x00/bcsr.h>
15
16static void db1x_power_off(void)
17{
18 bcsr_write(BCSR_RESETS, 0);
19 bcsr_write(BCSR_SYSTEM, BCSR_SYSTEM_PWROFF | BCSR_SYSTEM_RESET);
20}
21
22static void db1x_reset(char *c)
23{
24 bcsr_write(BCSR_RESETS, 0);
25 bcsr_write(BCSR_SYSTEM, 0);
26}
27
28static int __init db1x_poweroff_setup(void)
29{
30 if (!pm_power_off)
31 pm_power_off = db1x_power_off;
32 if (!_machine_halt)
33 _machine_halt = db1x_power_off;
34 if (!_machine_restart)
35 _machine_restart = db1x_reset;
36
37 return 0;
38}
39late_initcall(db1x_poweroff_setup);
11 40
12/* register a pcmcia socket */ 41/* register a pcmcia socket */
13int __init db1x_register_pcmcia_socket(unsigned long pseudo_attr_start, 42int __init db1x_register_pcmcia_socket(unsigned long pseudo_attr_start,