sparc: Convert naked unsigned uses to unsigned int
[linux-2.6-block.git] / arch / arm / plat-versatile / clock.c
CommitLineData
1da177e4 1/*
f4b8b319 2 * linux/arch/arm/plat-versatile/clock.c
1da177e4
LT
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
1da177e4 13#include <linux/errno.h>
f8ce2547 14#include <linux/clk.h>
00431707 15#include <linux/mutex.h>
1da177e4 16
c5a0adb5 17#include <asm/hardware/icst.h>
f4b8b319 18
d72fbdf0 19#include <mach/clkdev.h>
1da177e4
LT
20
21int clk_enable(struct clk *clk)
22{
23 return 0;
24}
25EXPORT_SYMBOL(clk_enable);
26
27void clk_disable(struct clk *clk)
28{
29}
30EXPORT_SYMBOL(clk_disable);
31
1da177e4
LT
32unsigned long clk_get_rate(struct clk *clk)
33{
34 return clk->rate;
35}
36EXPORT_SYMBOL(clk_get_rate);
37
38long clk_round_rate(struct clk *clk, unsigned long rate)
39{
9bf5b2ef
RK
40 long ret = -EIO;
41 if (clk->ops && clk->ops->round)
42 ret = clk->ops->round(clk, rate);
43 return ret;
1da177e4
LT
44}
45EXPORT_SYMBOL(clk_round_rate);
46
47int clk_set_rate(struct clk *clk, unsigned long rate)
48{
49 int ret = -EIO;
9bf5b2ef
RK
50 if (clk->ops && clk->ops->set)
51 ret = clk->ops->set(clk, rate);
d72fbdf0 52 return ret;
1da177e4
LT
53}
54EXPORT_SYMBOL(clk_set_rate);
9bf5b2ef
RK
55
56long icst_clk_round(struct clk *clk, unsigned long rate)
57{
58 struct icst_vco vco;
59 vco = icst_hz_to_vco(clk->params, rate);
60 return icst_hz(clk->params, vco);
61}
62EXPORT_SYMBOL(icst_clk_round);
63
64int icst_clk_set(struct clk *clk, unsigned long rate)
65{
66 struct icst_vco vco;
67
68 vco = icst_hz_to_vco(clk->params, rate);
69 clk->rate = icst_hz(clk->params, vco);
70 clk->ops->setvco(clk, vco);
71
72 return 0;
73}
74EXPORT_SYMBOL(icst_clk_set);