hh.org updates
[hh.org.git] / arch / arm / mach-pxa / htcuniversal / htcuniversal_pm.c
bloba5ce6248caf82cce1ddfc66b087cb2426759c2f1
1 /*
2 * MyPal 716 power management support for the original HTC IPL in DoC G3
4 * Use consistent with the GNU GPL is permitted, provided that this
5 * copyright notice is preserved in its entirety in all copies and
6 * derived works.
8 * Copyright (C) 2005 Pawel Kolodziejski
12 #include <linux/kernel.h>
13 #include <linux/module.h>
14 #include <linux/device.h>
15 #include <linux/pm.h>
17 #include <asm/mach-types.h>
18 #include <asm/hardware.h>
19 #include <asm/arch/pxa-regs.h>
20 #include <asm/arch/pxa-pm_ll.h>
22 #ifdef CONFIG_PM
24 static u32 *addr_a0040000;
25 static u32 *addr_a0040004;
26 static u32 *addr_a0040008;
27 static u32 *addr_a004000c;
29 static u32 save_a0040000;
30 static u32 save_a0040004;
31 static u32 save_a0040008;
32 static u32 save_a004000c;
34 static void htcuniversal_pxa_ll_pm_suspend(unsigned long resume_addr)
36 save_a0040000 = *addr_a0040000;
37 save_a0040004 = *addr_a0040004;
38 save_a0040008 = *addr_a0040008;
39 save_a004000c = *addr_a004000c;
41 /* jump to PSPR */
42 *addr_a0040000 = 0xe3a00101; // mov r0, #0x40000000
43 *addr_a0040004 = 0xe380060f; // orr r0, r0, #0x0f000000
44 *addr_a0040008 = 0xe3800008; // orr r0, r0, #8
45 *addr_a004000c = 0xe590f000; // ldr pc, [r0]
48 static void htcuniversal_pxa_ll_pm_resume(void)
50 *addr_a0040000 = save_a0040000;
51 *addr_a0040004 = save_a0040004;
52 *addr_a0040008 = save_a0040008;
53 *addr_a004000c = save_a004000c;
56 static struct pxa_ll_pm_ops htcuniversal_ll_pm_ops = {
57 .suspend = htcuniversal_pxa_ll_pm_suspend,
58 .resume = htcuniversal_pxa_ll_pm_resume,
61 void htcuniversal_ll_pm_init(void) {
62 addr_a0040000 = phys_to_virt(0xa0040000);
63 addr_a0040004 = phys_to_virt(0xa0040004);
64 addr_a0040008 = phys_to_virt(0xa0040008);
65 addr_a004000c = phys_to_virt(0xa004000c);
67 pxa_pm_set_ll_ops(&htcuniversal_ll_pm_ops);
69 #endif /* CONFIG_PM */