aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2010-11-22 09:48:49 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-12-16 01:31:19 -0500
commit2a125dd56b3a853701063fe8a678ad7603e385fd (patch)
tree279a16da435e810fa8490fe4a1557486a54e9cf3 /drivers
parent4029813c89926ae5d78cc2dff49d845d934424f6 (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 'drivers')
-rw-r--r--drivers/pcmcia/pxa2xx_base.c17
-rw-r--r--drivers/pcmcia/soc_common.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 55a7d0b045b1..3c01774eb393 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -179,8 +179,8 @@ static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int cl
179 179
180static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt) 180static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt)
181{ 181{
182 unsigned int clk = get_memclk_frequency_10khz(); 182 unsigned long clk = clk_get_rate(skt->clk);
183 return pxa2xx_pcmcia_set_mcxx(skt, clk); 183 return pxa2xx_pcmcia_set_mcxx(skt, clk / 10000);
184} 184}
185 185
186#ifdef CONFIG_CPU_FREQ 186#ifdef CONFIG_CPU_FREQ
@@ -282,24 +282,33 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
282 struct pcmcia_low_level *ops; 282 struct pcmcia_low_level *ops;
283 struct skt_dev_info *sinfo; 283 struct skt_dev_info *sinfo;
284 struct soc_pcmcia_socket *skt; 284 struct soc_pcmcia_socket *skt;
285 struct clk *clk;
285 286
286 ops = (struct pcmcia_low_level *)dev->dev.platform_data; 287 ops = (struct pcmcia_low_level *)dev->dev.platform_data;
287 if (!ops) 288 if (!ops)
288 return -ENODEV; 289 return -ENODEV;
289 290
291 clk = clk_get(&dev->dev, NULL);
292 if (!clk)
293 return -ENODEV;
294
290 pxa2xx_drv_pcmcia_ops(ops); 295 pxa2xx_drv_pcmcia_ops(ops);
291 296
292 sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); 297 sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
293 if (!sinfo) 298 if (!sinfo) {
299 clk_put(clk);
294 return -ENOMEM; 300 return -ENOMEM;
301 }
295 302
296 sinfo->nskt = ops->nr; 303 sinfo->nskt = ops->nr;
304 sinfo->clk = clk;
297 305
298 /* Initialize processor specific parameters */ 306 /* Initialize processor specific parameters */
299 for (i = 0; i < ops->nr; i++) { 307 for (i = 0; i < ops->nr; i++) {
300 skt = &sinfo->skt[i]; 308 skt = &sinfo->skt[i];
301 309
302 skt->nr = ops->first + i; 310 skt->nr = ops->first + i;
311 skt->clk = clk;
303 skt->ops = ops; 312 skt->ops = ops;
304 skt->socket.owner = ops->owner; 313 skt->socket.owner = ops->owner;
305 skt->socket.dev.parent = &dev->dev; 314 skt->socket.dev.parent = &dev->dev;
@@ -314,6 +323,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
314 while (--i >= 0) 323 while (--i >= 0)
315 soc_pcmcia_remove_one(&sinfo->skt[i]); 324 soc_pcmcia_remove_one(&sinfo->skt[i]);
316 kfree(sinfo); 325 kfree(sinfo);
326 clk_put(clk);
317 } else { 327 } else {
318 pxa2xx_configure_sockets(&dev->dev); 328 pxa2xx_configure_sockets(&dev->dev);
319 dev_set_drvdata(&dev->dev, sinfo); 329 dev_set_drvdata(&dev->dev, sinfo);
@@ -332,6 +342,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
332 for (i = 0; i < sinfo->nskt; i++) 342 for (i = 0; i < sinfo->nskt; i++)
333 soc_pcmcia_remove_one(&sinfo->skt[i]); 343 soc_pcmcia_remove_one(&sinfo->skt[i]);
334 344
345 clk_put(sinfo->clk);
335 kfree(sinfo); 346 kfree(sinfo);
336 return 0; 347 return 0;
337} 348}
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index bbcd5385a221..9daa73615c8b 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -10,6 +10,7 @@
10#define _ASM_ARCH_PCMCIA 10#define _ASM_ARCH_PCMCIA
11 11
12/* include the world */ 12/* include the world */
13#include <linux/clk.h>
13#include <linux/cpufreq.h> 14#include <linux/cpufreq.h>
14#include <pcmcia/ss.h> 15#include <pcmcia/ss.h>
15#include <pcmcia/cistpl.h> 16#include <pcmcia/cistpl.h>
@@ -29,6 +30,7 @@ struct soc_pcmcia_socket {
29 * Info from low level handler 30 * Info from low level handler
30 */ 31 */
31 unsigned int nr; 32 unsigned int nr;
33 struct clk *clk;
32 34
33 /* 35 /*
34 * Core PCMCIA state 36 * Core PCMCIA state
@@ -56,6 +58,7 @@ struct soc_pcmcia_socket {
56 58
57struct skt_dev_info { 59struct skt_dev_info {
58 int nskt; 60 int nskt;
61 struct clk *clk;
59 struct soc_pcmcia_socket skt[0]; 62 struct soc_pcmcia_socket skt[0];
60}; 63};
61 64