pxa27x.c (39fe5434cb9de5da40510028b17b96bc4eb312b3) pxa27x.c (15a4033354c68eb75e417ab60771f36212610820)
1/*
2 * linux/arch/arm/mach-pxa/pxa27x.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
7 *
8 * Code specific to PXA27x aka Bulverde.

--- 22 unchanged lines hidden (view full) ---

31/* Crystal clock: 13MHz */
32#define BASE_CLK 13000000
33
34/*
35 * Get the clock frequency as reflected by CCSR and the turbo flag.
36 * We assume these values have been applied via a fcs.
37 * If info is not 0 we also display the current settings.
38 */
1/*
2 * linux/arch/arm/mach-pxa/pxa27x.c
3 *
4 * Author: Nicolas Pitre
5 * Created: Nov 05, 2002
6 * Copyright: MontaVista Software Inc.
7 *
8 * Code specific to PXA27x aka Bulverde.

--- 22 unchanged lines hidden (view full) ---

31/* Crystal clock: 13MHz */
32#define BASE_CLK 13000000
33
34/*
35 * Get the clock frequency as reflected by CCSR and the turbo flag.
36 * We assume these values have been applied via a fcs.
37 * If info is not 0 we also display the current settings.
38 */
39unsigned int get_clk_frequency_khz( int info)
39unsigned int pxa27x_get_clk_frequency_khz(int info)
40{
41 unsigned long ccsr, clkcfg;
42 unsigned int l, L, m, M, n2, N, S;
43 int cccr_a, t, ht, b;
44
45 ccsr = CCSR;
46 cccr_a = CCCR & (1 << 25);
47

--- 26 unchanged lines hidden (view full) ---

74
75 return (t) ? (N/1000) : (L/1000);
76}
77
78/*
79 * Return the current mem clock frequency in units of 10kHz as
80 * reflected by CCCR[A], B, and L
81 */
40{
41 unsigned long ccsr, clkcfg;
42 unsigned int l, L, m, M, n2, N, S;
43 int cccr_a, t, ht, b;
44
45 ccsr = CCSR;
46 cccr_a = CCCR & (1 << 25);
47

--- 26 unchanged lines hidden (view full) ---

74
75 return (t) ? (N/1000) : (L/1000);
76}
77
78/*
79 * Return the current mem clock frequency in units of 10kHz as
80 * reflected by CCCR[A], B, and L
81 */
82unsigned int get_memclk_frequency_10khz(void)
82unsigned int pxa27x_get_memclk_frequency_10khz(void)
83{
84 unsigned long ccsr, clkcfg;
85 unsigned int l, L, m, M;
86 int cccr_a, b;
87
88 ccsr = CCSR;
89 cccr_a = CCCR & (1 << 25);
90

--- 8 unchanged lines hidden (view full) ---

99 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
100
101 return (M / 10000);
102}
103
104/*
105 * Return the current LCD clock frequency in units of 10kHz as
106 */
83{
84 unsigned long ccsr, clkcfg;
85 unsigned int l, L, m, M;
86 int cccr_a, b;
87
88 ccsr = CCSR;
89 cccr_a = CCCR & (1 << 25);
90

--- 8 unchanged lines hidden (view full) ---

99 M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
100
101 return (M / 10000);
102}
103
104/*
105 * Return the current LCD clock frequency in units of 10kHz as
106 */
107unsigned int get_lcdclk_frequency_10khz(void)
107unsigned int pxa27x_get_lcdclk_frequency_10khz(void)
108{
109 unsigned long ccsr;
110 unsigned int l, L, k, K;
111
112 ccsr = CCSR;
113
114 l = ccsr & 0x1f;
115 k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
116
117 L = l * BASE_CLK;
118 K = L / k;
119
120 return (K / 10000);
121}
122
108{
109 unsigned long ccsr;
110 unsigned int l, L, k, K;
111
112 ccsr = CCSR;
113
114 l = ccsr & 0x1f;
115 k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
116
117 L = l * BASE_CLK;
118 K = L / k;
119
120 return (K / 10000);
121}
122
123EXPORT_SYMBOL(get_clk_frequency_khz);
124EXPORT_SYMBOL(get_memclk_frequency_10khz);
125EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
126
127#ifdef CONFIG_PM
128
129#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
130#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
131
132#define RESTORE_GPLEVEL(n) do { \
133 GPSR##n = sleep_save[SLEEP_SAVE_GPLR##n]; \
134 GPCR##n = ~sleep_save[SLEEP_SAVE_GPLR##n]; \

--- 226 unchanged lines hidden ---
123#ifdef CONFIG_PM
124
125#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
126#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
127
128#define RESTORE_GPLEVEL(n) do { \
129 GPSR##n = sleep_save[SLEEP_SAVE_GPLR##n]; \
130 GPCR##n = ~sleep_save[SLEEP_SAVE_GPLR##n]; \

--- 226 unchanged lines hidden ---