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/mach-realview | |
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/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/clock.c | 64 | ||||
-rw-r--r-- | arch/arm/mach-realview/clock.h | 20 | ||||
-rw-r--r-- | arch/arm/mach-realview/core.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/clkdev.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_eb.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb1176.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pb11mp.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-realview/realview_pba8.c | 1 |
9 files changed, 11 insertions, 90 deletions
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile index e704edb733c0..a01b76b7c956 100644 --- a/arch/arm/mach-realview/Makefile +++ b/arch/arm/mach-realview/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := core.o clock.o | 5 | obj-y := core.o |
6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o | 6 | obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o |
7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o | 7 | obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o |
8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o | 8 | obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o |
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c deleted file mode 100644 index 18c545921e41..000000000000 --- a/arch/arm/mach-realview/clock.c +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/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/device.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <linux/errno.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/clk.h> | ||
19 | #include <linux/mutex.h> | ||
20 | |||
21 | #include <asm/hardware/icst.h> | ||
22 | |||
23 | #include "clock.h" | ||
24 | |||
25 | int clk_enable(struct clk *clk) | ||
26 | { | ||
27 | return 0; | ||
28 | } | ||
29 | EXPORT_SYMBOL(clk_enable); | ||
30 | |||
31 | void clk_disable(struct clk *clk) | ||
32 | { | ||
33 | } | ||
34 | EXPORT_SYMBOL(clk_disable); | ||
35 | |||
36 | unsigned long clk_get_rate(struct clk *clk) | ||
37 | { | ||
38 | return clk->rate; | ||
39 | } | ||
40 | EXPORT_SYMBOL(clk_get_rate); | ||
41 | |||
42 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
43 | { | ||
44 | struct icst_vco vco; | ||
45 | vco = icst_hz_to_vco(clk->params, rate); | ||
46 | return icst_hz(clk->params, vco); | ||
47 | } | ||
48 | EXPORT_SYMBOL(clk_round_rate); | ||
49 | |||
50 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
51 | { | ||
52 | int ret = -EIO; | ||
53 | |||
54 | if (clk->setvco) { | ||
55 | struct icst_vco vco; | ||
56 | |||
57 | vco = icst_hz_to_vco(clk->params, rate); | ||
58 | clk->rate = icst_hz(clk->params, vco); | ||
59 | clk->setvco(clk, vco); | ||
60 | ret = 0; | ||
61 | } | ||
62 | return ret; | ||
63 | } | ||
64 | EXPORT_SYMBOL(clk_set_rate); | ||
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h deleted file mode 100644 index fa64c854258d..000000000000 --- a/arch/arm/mach-realview/clock.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/clock.h | ||
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 <asm/hardware/icst.h> | ||
12 | |||
13 | struct module; | ||
14 | |||
15 | struct clk { | ||
16 | unsigned long rate; | ||
17 | const struct icst_params *params; | ||
18 | void *data; | ||
19 | void (*setvco)(struct clk *, struct icst_vco vco); | ||
20 | }; | ||
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index a8c215a406a2..17eb7eb780d8 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -48,11 +48,11 @@ | |||
48 | 48 | ||
49 | #include <asm/hardware/gic.h> | 49 | #include <asm/hardware/gic.h> |
50 | 50 | ||
51 | #include <mach/clkdev.h> | ||
51 | #include <mach/platform.h> | 52 | #include <mach/platform.h> |
52 | #include <mach/irqs.h> | 53 | #include <mach/irqs.h> |
53 | 54 | ||
54 | #include "core.h" | 55 | #include "core.h" |
55 | #include "clock.h" | ||
56 | 56 | ||
57 | #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) | 57 | #define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET) |
58 | 58 | ||
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h index 04b37a89801c..fefe4671255c 100644 --- a/arch/arm/mach-realview/include/mach/clkdev.h +++ b/arch/arm/mach-realview/include/mach/clkdev.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | 1 | #ifndef __ASM_MACH_CLKDEV_H |
2 | #define __ASM_MACH_CLKDEV_H | 2 | #define __ASM_MACH_CLKDEV_H |
3 | 3 | ||
4 | #include <asm/hardware/icst.h> | ||
5 | |||
6 | struct clk { | ||
7 | unsigned long rate; | ||
8 | const struct icst_params *params; | ||
9 | u32 oscoff; | ||
10 | void (*setvco)(struct clk *, struct icst_vco vco); | ||
11 | }; | ||
12 | |||
4 | #define __clk_get(clk) ({ 1; }) | 13 | #define __clk_get(clk) ({ 1; }) |
5 | #define __clk_put(clk) do { } while (0) | 14 | #define __clk_put(clk) do { } while (0) |
6 | 15 | ||
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index 39d953c89d9a..006765fd204c 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <mach/irqs.h> | 43 | #include <mach/irqs.h> |
44 | 44 | ||
45 | #include "core.h" | 45 | #include "core.h" |
46 | #include "clock.h" | ||
47 | 46 | ||
48 | static struct map_desc realview_eb_io_desc[] __initdata = { | 47 | static struct map_desc realview_eb_io_desc[] __initdata = { |
49 | { | 48 | { |
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c index a93aac5f473e..217f7c19551e 100644 --- a/arch/arm/mach-realview/realview_pb1176.c +++ b/arch/arm/mach-realview/realview_pb1176.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <mach/irqs.h> | 43 | #include <mach/irqs.h> |
44 | 44 | ||
45 | #include "core.h" | 45 | #include "core.h" |
46 | #include "clock.h" | ||
47 | 46 | ||
48 | static struct map_desc realview_pb1176_io_desc[] __initdata = { | 47 | static struct map_desc realview_pb1176_io_desc[] __initdata = { |
49 | { | 48 | { |
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c index c7c656e235cc..9ef2ecc3c098 100644 --- a/arch/arm/mach-realview/realview_pb11mp.c +++ b/arch/arm/mach-realview/realview_pb11mp.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <mach/irqs.h> | 44 | #include <mach/irqs.h> |
45 | 45 | ||
46 | #include "core.h" | 46 | #include "core.h" |
47 | #include "clock.h" | ||
48 | 47 | ||
49 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { | 48 | static struct map_desc realview_pb11mp_io_desc[] __initdata = { |
50 | { | 49 | { |
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c index 3e3aaa3a2bc0..2fab3a6d566b 100644 --- a/arch/arm/mach-realview/realview_pba8.c +++ b/arch/arm/mach-realview/realview_pba8.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
42 | 42 | ||
43 | #include "core.h" | 43 | #include "core.h" |
44 | #include "clock.h" | ||
45 | 44 | ||
46 | static struct map_desc realview_pba8_io_desc[] __initdata = { | 45 | static struct map_desc realview_pba8_io_desc[] __initdata = { |
47 | { | 46 | { |