2 * hp6x0 Power Management Routines
4 * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License.
9 #include <linux/init.h>
10 #include <linux/suspend.h>
11 #include <linux/errno.h>
12 #include <linux/time.h>
14 #include <asm/hd64461.h>
15 #include <asm/hp6xx.h>
19 #define STBCR 0xffffff82
20 #define STBCR2 0xffffff88
22 static int hp6x0_pm_enter(suspend_state_t state
)
25 #ifdef CONFIG_HD64461_ENABLER
30 #ifdef CONFIG_HD64461_ENABLER
31 outb(0, HD64461_PCC1CSCIER
);
33 scr
= inb(HD64461_PCC1SCR
);
34 scr
|= HD64461_PCCSCR_VCC1
;
35 outb(scr
, HD64461_PCC1SCR
);
37 hd64461_stbcr
= inw(HD64461_STBCR
);
38 hd64461_stbcr
|= HD64461_STBCR_SPC1ST
;
39 outw(hd64461_stbcr
, HD64461_STBCR
);
42 ctrl_outb(0x1f, DACR
);
44 stbcr
= ctrl_inb(STBCR
);
45 ctrl_outb(0x01, STBCR
);
47 stbcr2
= ctrl_inb(STBCR2
);
48 ctrl_outb(0x7f , STBCR2
);
50 outw(0xf07f, HD64461_SCPUCR
);
54 outw(0, HD64461_SCPUCR
);
55 ctrl_outb(stbcr
, STBCR
);
56 ctrl_outb(stbcr2
, STBCR2
);
58 #ifdef CONFIG_HD64461_ENABLER
59 hd64461_stbcr
= inw(HD64461_STBCR
);
60 hd64461_stbcr
&= ~HD64461_STBCR_SPC1ST
;
61 outw(hd64461_stbcr
, HD64461_STBCR
);
63 outb(0x4c, HD64461_PCC1CSCIER
);
64 outb(0x00, HD64461_PCC1CSCR
);
70 static struct platform_suspend_ops hp6x0_pm_ops
= {
71 .enter
= hp6x0_pm_enter
,
72 .valid
= suspend_valid_only_mem
,
75 static int __init
hp6x0_pm_init(void)
77 suspend_set_ops(&hp6x0_pm_ops
);
81 late_initcall(hp6x0_pm_init
);