diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 13:53:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 13:53:43 -0400 |
commit | 00e9028a95fb8a4d79f2fb695a853f33ea7d3b57 (patch) | |
tree | 2dea2ae498a6ce57de8890e87185aca5e9f3ad2d /arch/sh/boards/mach-hp6xx/pm.c | |
parent | 57b1494d2ba544c62673234da6115c21fac27ffc (diff) | |
parent | 7cb93181629c613ee2b8f4ffe3446f8003074842 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (28 commits)
mm/hugetlb.c must #include <asm/io.h>
video: Fix up hp6xx driver build regressions.
sh: defconfig updates.
sh: Kill off stray mach-rsk7203 reference.
serial: sh-sci: Fix up SH7760/SH7780/SH7785 early printk regression.
sh: Move out individual boards without mach groups.
sh: Make sure AT_SYSINFO_EHDR is exposed to userspace in asm/auxvec.h.
sh: Allow SH-3 and SH-5 to use common headers.
sh: Provide common CPU headers, prune the SH-2 and SH-2A directories.
sh/maple: clean maple bus code
sh: More header path fixups for mach dir refactoring.
sh: Move out the solution engine headers to arch/sh/include/mach-se/
sh: I2C fix for AP325RXA and Migo-R
sh: Shuffle the board directories in to mach groups.
sh: dma-sh: Fix up dreamcast dma.h mach path.
sh: Switch KBUILD_DEFCONFIG to shx3_defconfig.
sh: Add ARCH_DEFCONFIG entries for sh and sh64.
sh: Fix compile error of Solution Engine
sh: Proper __put_user_asm() size mismatch fix.
sh: Stub in a dummy ENTRY_OFFSET for uImage offset calculation.
...
Diffstat (limited to 'arch/sh/boards/mach-hp6xx/pm.c')
-rw-r--r-- | arch/sh/boards/mach-hp6xx/pm.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c new file mode 100644 index 000000000000..e96684def788 --- /dev/null +++ b/arch/sh/boards/mach-hp6xx/pm.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * hp6x0 Power Management Routines | ||
3 | * | ||
4 | * Copyright (c) 2006 Andriy Skulysh <askulsyh@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License. | ||
8 | */ | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/suspend.h> | ||
11 | #include <linux/errno.h> | ||
12 | #include <linux/time.h> | ||
13 | #include <asm/io.h> | ||
14 | #include <asm/hd64461.h> | ||
15 | #include <asm/hp6xx.h> | ||
16 | #include <cpu/dac.h> | ||
17 | #include <asm/pm.h> | ||
18 | |||
19 | #define STBCR 0xffffff82 | ||
20 | #define STBCR2 0xffffff88 | ||
21 | |||
22 | static int hp6x0_pm_enter(suspend_state_t state) | ||
23 | { | ||
24 | u8 stbcr, stbcr2; | ||
25 | #ifdef CONFIG_HD64461_ENABLER | ||
26 | u8 scr; | ||
27 | u16 hd64461_stbcr; | ||
28 | #endif | ||
29 | |||
30 | #ifdef CONFIG_HD64461_ENABLER | ||
31 | outb(0, HD64461_PCC1CSCIER); | ||
32 | |||
33 | scr = inb(HD64461_PCC1SCR); | ||
34 | scr |= HD64461_PCCSCR_VCC1; | ||
35 | outb(scr, HD64461_PCC1SCR); | ||
36 | |||
37 | hd64461_stbcr = inw(HD64461_STBCR); | ||
38 | hd64461_stbcr |= HD64461_STBCR_SPC1ST; | ||
39 | outw(hd64461_stbcr, HD64461_STBCR); | ||
40 | #endif | ||
41 | |||
42 | ctrl_outb(0x1f, DACR); | ||
43 | |||
44 | stbcr = ctrl_inb(STBCR); | ||
45 | ctrl_outb(0x01, STBCR); | ||
46 | |||
47 | stbcr2 = ctrl_inb(STBCR2); | ||
48 | ctrl_outb(0x7f , STBCR2); | ||
49 | |||
50 | outw(0xf07f, HD64461_SCPUCR); | ||
51 | |||
52 | pm_enter(); | ||
53 | |||
54 | outw(0, HD64461_SCPUCR); | ||
55 | ctrl_outb(stbcr, STBCR); | ||
56 | ctrl_outb(stbcr2, STBCR2); | ||
57 | |||
58 | #ifdef CONFIG_HD64461_ENABLER | ||
59 | hd64461_stbcr = inw(HD64461_STBCR); | ||
60 | hd64461_stbcr &= ~HD64461_STBCR_SPC1ST; | ||
61 | outw(hd64461_stbcr, HD64461_STBCR); | ||
62 | |||
63 | outb(0x4c, HD64461_PCC1CSCIER); | ||
64 | outb(0x00, HD64461_PCC1CSCR); | ||
65 | #endif | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static struct platform_suspend_ops hp6x0_pm_ops = { | ||
71 | .enter = hp6x0_pm_enter, | ||
72 | .valid = suspend_valid_only_mem, | ||
73 | }; | ||
74 | |||
75 | static int __init hp6x0_pm_init(void) | ||
76 | { | ||
77 | suspend_set_ops(&hp6x0_pm_ops); | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | late_initcall(hp6x0_pm_init); | ||