aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-14 07:48:06 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 04:35:33 -0400
commitf4b8b319bf21bf3576014ce7336763cd3e1684ef (patch)
tree5f3200e3b82dd23fc58633e010f3996246d81607 /arch/arm/mach-versatile
parentc5a0adb51002e51a4254cb7f0ab7190d41d8b930 (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-versatile')
-rw-r--r--arch/arm/mach-versatile/Makefile2
-rw-r--r--arch/arm/mach-versatile/clock.c65
-rw-r--r--arch/arm/mach-versatile/clock.h21
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mach-versatile/include/mach/clkdev.h9
5 files changed, 11 insertions, 88 deletions
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
index ba81e70ed813..97cf4d831b0c 100644
--- a/arch/arm/mach-versatile/Makefile
+++ b/arch/arm/mach-versatile/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := core.o clock.o 5obj-y := core.o
6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o 6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o 7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
8obj-$(CONFIG_PCI) += pci.o 8obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
deleted file mode 100644
index adc67d771c78..000000000000
--- a/arch/arm/mach-versatile/clock.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * linux/arch/arm/mach-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/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/clkdev.h>
22#include <asm/hardware/icst.h>
23
24#include "clock.h"
25
26int clk_enable(struct clk *clk)
27{
28 return 0;
29}
30EXPORT_SYMBOL(clk_enable);
31
32void clk_disable(struct clk *clk)
33{
34}
35EXPORT_SYMBOL(clk_disable);
36
37unsigned long clk_get_rate(struct clk *clk)
38{
39 return clk->rate;
40}
41EXPORT_SYMBOL(clk_get_rate);
42
43long clk_round_rate(struct clk *clk, unsigned long rate)
44{
45 struct icst_vco vco;
46 vco = icst_hz_to_vco(clk->params, rate);
47 return icst_hz(clk->params, vco);
48}
49EXPORT_SYMBOL(clk_round_rate);
50
51int clk_set_rate(struct clk *clk, unsigned long rate)
52{
53 int ret = -EIO;
54
55 if (clk->setvco) {
56 struct icst_vco vco;
57
58 vco = icst_hz_to_vco(clk->params, rate);
59 clk->rate = icst_hz(clk->params, vco);
60 clk->setvco(clk, vco);
61 ret = 0;
62 }
63 return ret;
64}
65EXPORT_SYMBOL(clk_set_rate);
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h
deleted file mode 100644
index aed7e22d102b..000000000000
--- a/arch/arm/mach-versatile/clock.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * linux/arch/arm/mach-versatile/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
13struct module;
14
15struct clk {
16 unsigned long rate;
17 const struct icst_params *params;
18 u32 oscoff;
19 void *data;
20 void (*setvco)(struct clk *, struct icst_vco vco);
21};
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 3c67691d4e72..e9d255f33674 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -47,11 +47,11 @@
47#include <asm/mach/irq.h> 47#include <asm/mach/irq.h>
48#include <asm/mach/time.h> 48#include <asm/mach/time.h>
49#include <asm/mach/map.h> 49#include <asm/mach/map.h>
50#include <mach/clkdev.h>
50#include <mach/hardware.h> 51#include <mach/hardware.h>
51#include <mach/platform.h> 52#include <mach/platform.h>
52 53
53#include "core.h" 54#include "core.h"
54#include "clock.h"
55 55
56/* 56/*
57 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx 57 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h
index 04b37a89801c..fefe4671255c 100644
--- a/arch/arm/mach-versatile/include/mach/clkdev.h
+++ b/arch/arm/mach-versatile/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
6struct 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