diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2010-11-22 09:48:49 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-16 01:31:19 -0500 |
commit | 2a125dd56b3a853701063fe8a678ad7603e385fd (patch) | |
tree | 279a16da435e810fa8490fe4a1557486a54e9cf3 /arch/arm/mach-pxa | |
parent | 4029813c89926ae5d78cc2dff49d845d934424f6 (diff) |
ARM: pxa: remove get_memclk_frequency_10khz()
Introduce 'struct clk' for memory and remove
get_memclk_frequency_10khz().
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-pxa/generic.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 15 |
4 files changed, 21 insertions, 31 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index d4ce8f9233d7..d2bb071b0afc 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -72,19 +72,6 @@ unsigned int get_clk_frequency_khz(int info) | |||
72 | EXPORT_SYMBOL(get_clk_frequency_khz); | 72 | EXPORT_SYMBOL(get_clk_frequency_khz); |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Return the current memory clock frequency in units of 10kHz | ||
76 | */ | ||
77 | unsigned int get_memclk_frequency_10khz(void) | ||
78 | { | ||
79 | if (cpu_is_pxa25x()) | ||
80 | return pxa25x_get_memclk_frequency_10khz(); | ||
81 | else if (cpu_is_pxa27x()) | ||
82 | return pxa27x_get_memclk_frequency_10khz(); | ||
83 | return 0; | ||
84 | } | ||
85 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
86 | |||
87 | /* | ||
88 | * Intel PXA2xx internal register mapping. | 75 | * Intel PXA2xx internal register mapping. |
89 | * | 76 | * |
90 | * Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table | 77 | * Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index d2e8bc3aa521..0569d82d2592 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -36,18 +36,14 @@ extern unsigned int get_clk_frequency_khz(int info); | |||
36 | 36 | ||
37 | #ifdef CONFIG_PXA25x | 37 | #ifdef CONFIG_PXA25x |
38 | extern unsigned pxa25x_get_clk_frequency_khz(int); | 38 | extern unsigned pxa25x_get_clk_frequency_khz(int); |
39 | extern unsigned pxa25x_get_memclk_frequency_10khz(void); | ||
40 | #else | 39 | #else |
41 | #define pxa25x_get_clk_frequency_khz(x) (0) | 40 | #define pxa25x_get_clk_frequency_khz(x) (0) |
42 | #define pxa25x_get_memclk_frequency_10khz() (0) | ||
43 | #endif | 41 | #endif |
44 | 42 | ||
45 | #ifdef CONFIG_PXA27x | 43 | #ifdef CONFIG_PXA27x |
46 | extern unsigned pxa27x_get_clk_frequency_khz(int); | 44 | extern unsigned pxa27x_get_clk_frequency_khz(int); |
47 | extern unsigned pxa27x_get_memclk_frequency_10khz(void); | ||
48 | #else | 45 | #else |
49 | #define pxa27x_get_clk_frequency_khz(x) (0) | 46 | #define pxa27x_get_clk_frequency_khz(x) (0) |
50 | #define pxa27x_get_memclk_frequency_10khz() (0) | ||
51 | #endif | 47 | #endif |
52 | 48 | ||
53 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | 49 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index f29775e3e18d..65051bb6d62c 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -92,23 +92,21 @@ unsigned int pxa25x_get_clk_frequency_khz(int info) | |||
92 | return (turbo & 1) ? (N/1000) : (M/1000); | 92 | return (turbo & 1) ? (N/1000) : (M/1000); |
93 | } | 93 | } |
94 | 94 | ||
95 | /* | 95 | static unsigned long clk_pxa25x_mem_getrate(struct clk *clk) |
96 | * Return the current memory clock frequency in units of 10kHz | ||
97 | */ | ||
98 | unsigned int pxa25x_get_memclk_frequency_10khz(void) | ||
99 | { | 96 | { |
100 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; | 97 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK; |
101 | } | 98 | } |
102 | 99 | ||
103 | static unsigned long clk_pxa25x_lcd_getrate(struct clk *clk) | 100 | static const struct clkops clk_pxa25x_mem_ops = { |
104 | { | 101 | .enable = clk_dummy_enable, |
105 | return pxa25x_get_memclk_frequency_10khz() * 10000; | 102 | .disable = clk_dummy_disable, |
106 | } | 103 | .getrate = clk_pxa25x_mem_getrate, |
104 | }; | ||
107 | 105 | ||
108 | static const struct clkops clk_pxa25x_lcd_ops = { | 106 | static const struct clkops clk_pxa25x_lcd_ops = { |
109 | .enable = clk_pxa2xx_cken_enable, | 107 | .enable = clk_pxa2xx_cken_enable, |
110 | .disable = clk_pxa2xx_cken_disable, | 108 | .disable = clk_pxa2xx_cken_disable, |
111 | .getrate = clk_pxa25x_lcd_getrate, | 109 | .getrate = clk_pxa25x_mem_getrate, |
112 | }; | 110 | }; |
113 | 111 | ||
114 | static unsigned long gpio12_config_32k[] = { | 112 | static unsigned long gpio12_config_32k[] = { |
@@ -185,6 +183,7 @@ static DEFINE_PXA2_CKEN(pxa25x_ficp, FICP, 47923000, 0); | |||
185 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); | 183 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); |
186 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); | 184 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); |
187 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); | 185 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); |
186 | static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0); | ||
188 | 187 | ||
189 | static struct clk_lookup pxa25x_clkregs[] = { | 188 | static struct clk_lookup pxa25x_clkregs[] = { |
190 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), | 189 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), |
@@ -205,6 +204,7 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
205 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), | 204 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), |
206 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), | 205 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), | 206 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), | ||
208 | }; | 208 | }; |
209 | 209 | ||
210 | static struct clk_lookup pxa25x_hwuart_clkreg = | 210 | static struct clk_lookup pxa25x_hwuart_clkreg = |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 13242f2a3392..6d2254b92adc 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -111,10 +111,9 @@ unsigned int pxa27x_get_clk_frequency_khz(int info) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | /* | 113 | /* |
114 | * Return the current mem clock frequency in units of 10kHz as | 114 | * Return the current mem clock frequency as reflected by CCCR[A], B, and L |
115 | * reflected by CCCR[A], B, and L | ||
116 | */ | 115 | */ |
117 | unsigned int pxa27x_get_memclk_frequency_10khz(void) | 116 | static unsigned long clk_pxa27x_mem_getrate(struct clk *clk) |
118 | { | 117 | { |
119 | unsigned long ccsr, clkcfg; | 118 | unsigned long ccsr, clkcfg; |
120 | unsigned int l, L, m, M; | 119 | unsigned int l, L, m, M; |
@@ -133,9 +132,15 @@ unsigned int pxa27x_get_memclk_frequency_10khz(void) | |||
133 | L = l * BASE_CLK; | 132 | L = l * BASE_CLK; |
134 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); | 133 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); |
135 | 134 | ||
136 | return (M / 10000); | 135 | return M; |
137 | } | 136 | } |
138 | 137 | ||
138 | static const struct clkops clk_pxa27x_mem_ops = { | ||
139 | .enable = clk_dummy_enable, | ||
140 | .disable = clk_dummy_disable, | ||
141 | .getrate = clk_pxa27x_mem_getrate, | ||
142 | }; | ||
143 | |||
139 | /* | 144 | /* |
140 | * Return the current LCD clock frequency in units of 10kHz as | 145 | * Return the current LCD clock frequency in units of 10kHz as |
141 | */ | 146 | */ |
@@ -192,6 +197,7 @@ static DEFINE_PXA2_CKEN(pxa27x_memc, MEMC, 0, 0); | |||
192 | 197 | ||
193 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); | 198 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); |
194 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); | 199 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); |
200 | static DEFINE_CLK(pxa27x_mem, &clk_pxa27x_mem_ops, 0, 0); | ||
195 | 201 | ||
196 | static struct clk_lookup pxa27x_clkregs[] = { | 202 | static struct clk_lookup pxa27x_clkregs[] = { |
197 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), | 203 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), |
@@ -220,6 +226,7 @@ static struct clk_lookup pxa27x_clkregs[] = { | |||
220 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), | 226 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), |
221 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), | 227 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), |
222 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), | 228 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), |
229 | INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), | ||
223 | }; | 230 | }; |
224 | 231 | ||
225 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |