aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/neponset.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-sa1100/neponset.c')
-rw-r--r--arch/arm/mach-sa1100/neponset.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index fc061641b7be..052e4caedb89 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -178,33 +178,27 @@ static int neponset_probe(struct device *dev)
178/* 178/*
179 * LDM power management. 179 * LDM power management.
180 */ 180 */
181static int neponset_suspend(struct device *dev, pm_message_t state, u32 level) 181static int neponset_suspend(struct device *dev, pm_message_t state)
182{ 182{
183 /* 183 /*
184 * Save state. 184 * Save state.
185 */ 185 */
186 if (level == SUSPEND_SAVE_STATE || 186 if (!dev->power.saved_state)
187 level == SUSPEND_DISABLE || 187 dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
188 level == SUSPEND_POWER_DOWN) { 188 if (!dev->power.saved_state)
189 if (!dev->power.saved_state) 189 return -ENOMEM;
190 dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); 190
191 if (!dev->power.saved_state) 191 *(unsigned int *)dev->power.saved_state = NCR_0;
192 return -ENOMEM;
193
194 *(unsigned int *)dev->power.saved_state = NCR_0;
195 }
196 192
197 return 0; 193 return 0;
198} 194}
199 195
200static int neponset_resume(struct device *dev, u32 level) 196static int neponset_resume(struct device *dev)
201{ 197{
202 if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) { 198 if (dev->power.saved_state) {
203 if (dev->power.saved_state) { 199 NCR_0 = *(unsigned int *)dev->power.saved_state;
204 NCR_0 = *(unsigned int *)dev->power.saved_state; 200 kfree(dev->power.saved_state);
205 kfree(dev->power.saved_state); 201 dev->power.saved_state = NULL;
206 dev->power.saved_state = NULL;
207 }
208 } 202 }
209 203
210 return 0; 204 return 0;
@@ -331,9 +325,17 @@ static int __init neponset_init(void)
331subsys_initcall(neponset_init); 325subsys_initcall(neponset_init);
332 326
333static struct map_desc neponset_io_desc[] __initdata = { 327static struct map_desc neponset_io_desc[] __initdata = {
334 /* virtual physical length type */ 328 { /* System Registers */
335 { 0xf3000000, 0x10000000, SZ_1M, MT_DEVICE }, /* System Registers */ 329 .virtual = 0xf3000000,
336 { 0xf4000000, 0x40000000, SZ_1M, MT_DEVICE } /* SA-1111 */ 330 .pfn = __phys_to_pfn(0x10000000),
331 .length = SZ_1M,
332 .type = MT_DEVICE
333 }, { /* SA-1111 */
334 .virtual = 0xf4000000,
335 .pfn = __phys_to_pfn(0x40000000),
336 .length = SZ_1M,
337 .type = MT_DEVICE
338 }
337}; 339};
338 340
339void __init neponset_map_io(void) 341void __init neponset_map_io(void)