diff options
Diffstat (limited to 'arch/powerpc/platforms/52xx/lite5200.c')
-rw-r--r-- | arch/powerpc/platforms/52xx/lite5200.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c index 8e2646ac417b..1cfc00dfb99a 100644 --- a/arch/powerpc/platforms/52xx/lite5200.c +++ b/arch/powerpc/platforms/52xx/lite5200.c | |||
@@ -85,6 +85,28 @@ error: | |||
85 | iounmap(gpio); | 85 | iounmap(gpio); |
86 | } | 86 | } |
87 | 87 | ||
88 | #ifdef CONFIG_PM | ||
89 | static u32 descr_a; | ||
90 | static void lite5200_suspend_prepare(void __iomem *mbar) | ||
91 | { | ||
92 | u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */ | ||
93 | u8 level = 0; /* wakeup on low level */ | ||
94 | mpc52xx_set_wakeup_gpio(pin, level); | ||
95 | |||
96 | /* | ||
97 | * power down usb port | ||
98 | * this needs to be called before of-ohci suspend code | ||
99 | */ | ||
100 | descr_a = in_be32(mbar + 0x1048); | ||
101 | out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100); | ||
102 | } | ||
103 | |||
104 | static void lite5200_resume_finish(void __iomem *mbar) | ||
105 | { | ||
106 | out_be32(mbar + 0x1048, descr_a); | ||
107 | } | ||
108 | #endif | ||
109 | |||
88 | static void __init lite5200_setup_arch(void) | 110 | static void __init lite5200_setup_arch(void) |
89 | { | 111 | { |
90 | struct device_node *np; | 112 | struct device_node *np; |
@@ -107,6 +129,12 @@ static void __init lite5200_setup_arch(void) | |||
107 | mpc52xx_setup_cpu(); /* Generic */ | 129 | mpc52xx_setup_cpu(); /* Generic */ |
108 | lite5200_setup_cpu(); /* Platorm specific */ | 130 | lite5200_setup_cpu(); /* Platorm specific */ |
109 | 131 | ||
132 | #ifdef CONFIG_PM | ||
133 | mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare; | ||
134 | mpc52xx_suspend.board_resume_finish = lite5200_resume_finish; | ||
135 | mpc52xx_pm_init(); | ||
136 | #endif | ||
137 | |||
110 | #ifdef CONFIG_PCI | 138 | #ifdef CONFIG_PCI |
111 | np = of_find_node_by_type(NULL, "pci"); | 139 | np = of_find_node_by_type(NULL, "pci"); |
112 | if (np) { | 140 | if (np) { |