diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-08-20 05:07:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-10-12 16:14:52 -0400 |
commit | 15a4033354c68eb75e417ab60771f36212610820 (patch) | |
tree | f8e98b1a781f385e814a49ee528395866f1256e5 | |
parent | e259a3aecbfb61981175ddc7fc02dd180da7d73e (diff) |
[ARM] pxa: fix naming of memory/lcd/core clock functions
Rename pxa25x and pxa27x memory/lcd/core clock functions, and
select the correct version at run time.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-pxa/generic.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 10 |
4 files changed, 61 insertions, 23 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 98df63898d1d..ac2b1fc5bda9 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -43,6 +43,44 @@ | |||
43 | #include "generic.h" | 43 | #include "generic.h" |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * Get the clock frequency as reflected by CCCR and the turbo flag. | ||
47 | * We assume these values have been applied via a fcs. | ||
48 | * If info is not 0 we also display the current settings. | ||
49 | */ | ||
50 | unsigned int get_clk_frequency_khz(int info) | ||
51 | { | ||
52 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) | ||
53 | return pxa25x_get_clk_frequency_khz(info); | ||
54 | else | ||
55 | return pxa27x_get_clk_frequency_khz(info); | ||
56 | } | ||
57 | EXPORT_SYMBOL(get_clk_frequency_khz); | ||
58 | |||
59 | /* | ||
60 | * Return the current memory clock frequency in units of 10kHz | ||
61 | */ | ||
62 | unsigned int get_memclk_frequency_10khz(void) | ||
63 | { | ||
64 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) | ||
65 | return pxa25x_get_memclk_frequency_10khz(); | ||
66 | else | ||
67 | return pxa27x_get_memclk_frequency_10khz(); | ||
68 | } | ||
69 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
70 | |||
71 | /* | ||
72 | * Return the current LCD clock frequency in units of 10kHz | ||
73 | */ | ||
74 | unsigned int get_lcdclk_frequency_10khz(void) | ||
75 | { | ||
76 | if (cpu_is_pxa21x() || cpu_is_pxa25x()) | ||
77 | return pxa25x_get_memclk_frequency_10khz(); | ||
78 | else | ||
79 | return pxa27x_get_lcdclk_frequency_10khz(); | ||
80 | } | ||
81 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | ||
82 | |||
83 | /* | ||
46 | * Handy function to set GPIO alternate functions | 84 | * Handy function to set GPIO alternate functions |
47 | */ | 85 | */ |
48 | 86 | ||
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 91ab2ad8b34b..0a8a6f8a4f93 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -26,3 +26,21 @@ extern unsigned int get_clk_frequency_khz(int info); | |||
26 | mi->bank[__nr].size = (__size), \ | 26 | mi->bank[__nr].size = (__size), \ |
27 | mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27) | 27 | mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27) |
28 | 28 | ||
29 | #ifdef CONFIG_PXA25x | ||
30 | extern unsigned pxa25x_get_clk_frequency_khz(int); | ||
31 | extern unsigned pxa25x_get_memclk_frequency_10khz(void); | ||
32 | #else | ||
33 | #define pxa25x_get_clk_frequency_khz(x) (0) | ||
34 | #define pxa25x_get_memclk_frequency_10khz() (0) | ||
35 | #endif | ||
36 | |||
37 | #ifdef CONFIG_PXA27x | ||
38 | extern unsigned pxa27x_get_clk_frequency_khz(int); | ||
39 | extern unsigned pxa27x_get_memclk_frequency_10khz(void); | ||
40 | extern unsigned pxa27x_get_lcdclk_frequency_10khz(void); | ||
41 | #else | ||
42 | #define pxa27x_get_clk_frequency_khz(x) (0) | ||
43 | #define pxa27x_get_memclk_frequency_10khz() (0) | ||
44 | #define pxa27x_get_lcdclk_frequency_10khz() (0) | ||
45 | #endif | ||
46 | |||
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 6dfcca72e90f..bcf3f0a78463 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -53,7 +53,7 @@ static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 }; | |||
53 | * We assume these values have been applied via a fcs. | 53 | * We assume these values have been applied via a fcs. |
54 | * If info is not 0 we also display the current settings. | 54 | * If info is not 0 we also display the current settings. |
55 | */ | 55 | */ |
56 | unsigned int get_clk_frequency_khz(int info) | 56 | unsigned int pxa25x_get_clk_frequency_khz(int info) |
57 | { | 57 | { |
58 | unsigned long cccr, turbo; | 58 | unsigned long cccr, turbo; |
59 | unsigned int l, L, m, M, n2, N; | 59 | unsigned int l, L, m, M, n2, N; |
@@ -86,28 +86,14 @@ unsigned int get_clk_frequency_khz(int info) | |||
86 | return (turbo & 1) ? (N/1000) : (M/1000); | 86 | return (turbo & 1) ? (N/1000) : (M/1000); |
87 | } | 87 | } |
88 | 88 | ||
89 | EXPORT_SYMBOL(get_clk_frequency_khz); | ||
90 | |||
91 | /* | 89 | /* |
92 | * Return the current memory clock frequency in units of 10kHz | 90 | * Return the current memory clock frequency in units of 10kHz |
93 | */ | 91 | */ |
94 | unsigned int get_memclk_frequency_10khz(void) | 92 | unsigned int pxa25x_get_memclk_frequency_10khz(void) |
95 | { | 93 | { |
96 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; | 94 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; |
97 | } | 95 | } |
98 | 96 | ||
99 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
100 | |||
101 | /* | ||
102 | * Return the current LCD clock frequency in units of 10kHz | ||
103 | */ | ||
104 | unsigned int get_lcdclk_frequency_10khz(void) | ||
105 | { | ||
106 | return get_memclk_frequency_10khz(); | ||
107 | } | ||
108 | |||
109 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | ||
110 | |||
111 | #ifdef CONFIG_PM | 97 | #ifdef CONFIG_PM |
112 | 98 | ||
113 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 99 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 203371ab19db..b3bbf3feef75 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -36,7 +36,7 @@ | |||
36 | * We assume these values have been applied via a fcs. | 36 | * We assume these values have been applied via a fcs. |
37 | * If info is not 0 we also display the current settings. | 37 | * If info is not 0 we also display the current settings. |
38 | */ | 38 | */ |
39 | unsigned int get_clk_frequency_khz( int info) | 39 | unsigned int pxa27x_get_clk_frequency_khz(int info) |
40 | { | 40 | { |
41 | unsigned long ccsr, clkcfg; | 41 | unsigned long ccsr, clkcfg; |
42 | unsigned int l, L, m, M, n2, N, S; | 42 | unsigned int l, L, m, M, n2, N, S; |
@@ -79,7 +79,7 @@ unsigned int get_clk_frequency_khz( int info) | |||
79 | * Return the current mem clock frequency in units of 10kHz as | 79 | * Return the current mem clock frequency in units of 10kHz as |
80 | * reflected by CCCR[A], B, and L | 80 | * reflected by CCCR[A], B, and L |
81 | */ | 81 | */ |
82 | unsigned int get_memclk_frequency_10khz(void) | 82 | unsigned int pxa27x_get_memclk_frequency_10khz(void) |
83 | { | 83 | { |
84 | unsigned long ccsr, clkcfg; | 84 | unsigned long ccsr, clkcfg; |
85 | unsigned int l, L, m, M; | 85 | unsigned int l, L, m, M; |
@@ -104,7 +104,7 @@ unsigned int get_memclk_frequency_10khz(void) | |||
104 | /* | 104 | /* |
105 | * Return the current LCD clock frequency in units of 10kHz as | 105 | * Return the current LCD clock frequency in units of 10kHz as |
106 | */ | 106 | */ |
107 | unsigned int get_lcdclk_frequency_10khz(void) | 107 | unsigned int pxa27x_get_lcdclk_frequency_10khz(void) |
108 | { | 108 | { |
109 | unsigned long ccsr; | 109 | unsigned long ccsr; |
110 | unsigned int l, L, k, K; | 110 | unsigned int l, L, k, K; |
@@ -120,10 +120,6 @@ unsigned int get_lcdclk_frequency_10khz(void) | |||
120 | return (K / 10000); | 120 | return (K / 10000); |
121 | } | 121 | } |
122 | 122 | ||
123 | EXPORT_SYMBOL(get_clk_frequency_khz); | ||
124 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
125 | EXPORT_SYMBOL(get_lcdclk_frequency_10khz); | ||
126 | |||
127 | #ifdef CONFIG_PM | 123 | #ifdef CONFIG_PM |
128 | 124 | ||
129 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 125 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |