This source file includes following definitions.
- s3c_pm_debug_init_uart
- s3c_pm_arch_prepare_irqs
- s3c_pm_arch_stop_clocks
- s3c_pm_arch_show_resume_irqs
- s3c_pm_arch_update_uart
- s3c_pm_restored_gpios
- samsung_pm_saved_gpios
1
2
3
4
5
6
7
8
9
10
11 #ifndef __MACH_S3C64XX_PM_CORE_H
12 #define __MACH_S3C64XX_PM_CORE_H __FILE__
13
14 #include <linux/serial_s3c.h>
15 #include <linux/delay.h>
16
17 #include <mach/regs-gpio.h>
18 #include <mach/regs-clock.h>
19 #include <mach/map.h>
20
21 static inline void s3c_pm_debug_init_uart(void)
22 {
23 u32 tmp = __raw_readl(S3C_PCLK_GATE);
24
25
26
27
28
29
30
31 tmp |= S3C_CLKCON_PCLK_UART0;
32 tmp |= S3C_CLKCON_PCLK_UART1;
33 tmp |= S3C_CLKCON_PCLK_UART2;
34 tmp |= S3C_CLKCON_PCLK_UART3;
35
36 __raw_writel(tmp, S3C_PCLK_GATE);
37 udelay(10);
38 }
39
40 static inline void s3c_pm_arch_prepare_irqs(void)
41 {
42
43
44
45 __raw_writel(__raw_readl(S3C64XX_EINT0PEND), S3C64XX_EINT0PEND);
46 }
47
48 static inline void s3c_pm_arch_stop_clocks(void)
49 {
50 }
51
52 static inline void s3c_pm_arch_show_resume_irqs(void)
53 {
54 }
55
56
57
58 #ifdef CONFIG_PM_SLEEP
59 #define s3c_irqwake_eintallow ((1 << 28) - 1)
60 #define s3c_irqwake_intallow (~0)
61 #else
62 #define s3c_irqwake_eintallow 0
63 #define s3c_irqwake_intallow 0
64 #endif
65
66 static inline void s3c_pm_arch_update_uart(void __iomem *regs,
67 struct pm_uart_save *save)
68 {
69 u32 ucon = __raw_readl(regs + S3C2410_UCON);
70 u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK;
71 u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK;
72 u32 new_ucon;
73 u32 delta;
74
75
76
77
78 save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL;
79
80
81
82
83
84
85 if (ucon_clk != save_clk) {
86 new_ucon = save->ucon;
87 delta = ucon_clk ^ save_clk;
88
89
90
91
92 if (ucon_clk & S3C6400_UCON_UCLK0 &&
93 !(save_clk & S3C6400_UCON_UCLK0) &&
94 delta & S3C6400_UCON_PCLK2) {
95 new_ucon &= ~S3C6400_UCON_UCLK0;
96 } else if (delta == S3C6400_UCON_PCLK2) {
97
98
99 new_ucon ^= S3C6400_UCON_PCLK2;
100 }
101
102 S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n",
103 ucon, new_ucon, save->ucon);
104 save->ucon = new_ucon;
105 }
106 }
107
108 static inline void s3c_pm_restored_gpios(void)
109 {
110
111
112 __raw_writel(0, S3C64XX_SLPEN);
113 }
114
115 static inline void samsung_pm_saved_gpios(void)
116 {
117
118
119
120
121
122 __raw_writel(S3C64XX_SLPEN_USE_xSLP, S3C64XX_SLPEN);
123 }
124 #endif