diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-01-14 07:48:06 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-02 04:35:33 -0400 |
commit | f4b8b319bf21bf3576014ce7336763cd3e1684ef (patch) | |
tree | 5f3200e3b82dd23fc58633e010f3996246d81607 /arch/arm/plat-versatile | |
parent | c5a0adb51002e51a4254cb7f0ab7190d41d8b930 (diff) |
ARM: Realview/Versatile/Integrator: separate out common clock code
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-versatile')
-rw-r--r-- | arch/arm/plat-versatile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-versatile/clock.c | 60 |
2 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile new file mode 100644 index 000000000000..2228fd1725ac --- /dev/null +++ b/arch/arm/plat-versatile/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-y := clock.o | |||
diff --git a/arch/arm/plat-versatile/clock.c b/arch/arm/plat-versatile/clock.c new file mode 100644 index 000000000000..2fa34de92325 --- /dev/null +++ b/arch/arm/plat-versatile/clock.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-versatile/clock.c | ||
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> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/mutex.h> | ||
16 | |||
17 | #include <asm/hardware/icst.h> | ||
18 | |||
19 | #include <mach/clkdev.h> | ||
20 | |||
21 | int clk_enable(struct clk *clk) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | EXPORT_SYMBOL(clk_enable); | ||
26 | |||
27 | void clk_disable(struct clk *clk) | ||
28 | { | ||
29 | } | ||
30 | EXPORT_SYMBOL(clk_disable); | ||
31 | |||
32 | unsigned long clk_get_rate(struct clk *clk) | ||
33 | { | ||
34 | return clk->rate; | ||
35 | } | ||
36 | EXPORT_SYMBOL(clk_get_rate); | ||
37 | |||
38 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
39 | { | ||
40 | struct icst_vco vco; | ||
41 | vco = icst_hz_to_vco(clk->params, rate); | ||
42 | return icst_hz(clk->params, vco); | ||
43 | } | ||
44 | EXPORT_SYMBOL(clk_round_rate); | ||
45 | |||
46 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
47 | { | ||
48 | int ret = -EIO; | ||
49 | |||
50 | if (clk->setvco) { | ||
51 | struct icst_vco vco; | ||
52 | |||
53 | vco = icst_hz_to_vco(clk->params, rate); | ||
54 | clk->rate = icst_hz(clk->params, vco); | ||
55 | clk->setvco(clk, vco); | ||
56 | ret = 0; | ||
57 | } | ||
58 | return ret; | ||
59 | } | ||
60 | EXPORT_SYMBOL(clk_set_rate); | ||