21 #include <linux/module.h>
22 #include <linux/kernel.h>
30 #include <asm/suspend.h>
31 #include <mach/hardware.h>
32 #include <mach/irqs.h>
34 #include <mach/reset.h>
48 static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, };
51 static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 };
55 static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 };
58 #define BASE_CLK 3686400
67 unsigned long cccr, turbo;
68 unsigned int l,
L,
m,
M, n2,
N;
71 asm(
"mrc\tp14, 0, %0, c6, c0, 0" :
"=r" (turbo) );
73 l = L_clk_mult[(cccr >> 0) & 0x1f];
74 m = M_clk_mult[(cccr >> 5) & 0x03];
75 n2 = N2_clk_mult[(cccr >> 7) & 0x07];
85 L / 1000000, (L % 1000000) / 10000, l );
88 M / 1000000, (M % 1000000) / 10000, m );
91 N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5,
92 (turbo & 1) ?
"" :
"in" );
95 return (turbo & 1) ? (N/1000) : (M/1000);
98 static unsigned long clk_pxa25x_mem_getrate(
struct clk *
clk)
103 static const struct clkops clk_pxa25x_mem_ops = {
106 .getrate = clk_pxa25x_mem_getrate,
109 static const struct clkops clk_pxa25x_lcd_ops = {
112 .getrate = clk_pxa25x_mem_getrate,
115 static unsigned long gpio12_config_32k[] = {
119 static unsigned long gpio12_config_gpio[] = {
123 static void clk_gpio12_enable(
struct clk *
clk)
128 static void clk_gpio12_disable(
struct clk *
clk)
133 static const struct clkops clk_pxa25x_gpio12_ops = {
134 .enable = clk_gpio12_enable,
135 .disable = clk_gpio12_disable,
138 static unsigned long gpio11_config_3m6[] = {
142 static unsigned long gpio11_config_gpio[] = {
146 static void clk_gpio11_enable(
struct clk *
clk)
151 static void clk_gpio11_disable(
struct clk *
clk)
156 static const struct clkops clk_pxa25x_gpio11_ops = {
157 .enable = clk_gpio11_enable,
158 .disable = clk_gpio11_disable,
187 static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0);
188 static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0);
189 static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0);
205 INIT_CLKREG(&clk_pxa25x_stuart,
"pxa2xx-ir",
"UARTCLK"),
206 INIT_CLKREG(&clk_pxa25x_ficp,
"pxa2xx-ir",
"FICPCLK"),
214 static struct clk_lookup pxa25x_hwuart_clkreg =
219 #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
220 #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
233 static void pxa25x_cpu_pm_save(
unsigned long *
sleep_save)
238 static void pxa25x_cpu_pm_restore(
unsigned long *
sleep_save)
255 static int pxa25x_cpu_pm_prepare(
void)
262 static void pxa25x_cpu_pm_finish(
void)
271 .save = pxa25x_cpu_pm_save,
272 .restore = pxa25x_cpu_pm_restore,
273 .enter = pxa25x_cpu_pm_enter,
274 .prepare = pxa25x_cpu_pm_prepare,
275 .finish = pxa25x_cpu_pm_finish,
278 static void __init pxa25x_init_pm(
void)
283 static inline void pxa25x_init_pm(
void) {}
289 static int pxa25x_set_wake(
struct irq_data *
d,
unsigned int on)
294 if (gpio >= 0 && gpio < 85)
318 #ifdef CONFIG_CPU_PXA26x
319 void __init pxa26x_init_irq(
void)
329 .length = 0x00200000,
354 static int __init pxa25x_init(
void)