aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/clock-sh7367.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/clock-sh7367.c')
-rw-r--r--arch/arm/mach-shmobile/clock-sh7367.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
new file mode 100644
index 000000000000..58bd54e1113a
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh7367.c
@@ -0,0 +1,96 @@
1/*
2 * Preliminary clock framework support for sh7367
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/list.h>
23#include <linux/clk.h>
24
25struct clk {
26 const char *name;
27 unsigned long rate;
28};
29
30#include <asm/clkdev.h>
31
32int __clk_get(struct clk *clk)
33{
34 return 1;
35}
36EXPORT_SYMBOL(__clk_get);
37
38void __clk_put(struct clk *clk)
39{
40}
41EXPORT_SYMBOL(__clk_put);
42
43
44int clk_enable(struct clk *clk)
45{
46 return 0;
47}
48EXPORT_SYMBOL(clk_enable);
49
50void clk_disable(struct clk *clk)
51{
52}
53EXPORT_SYMBOL(clk_disable);
54
55unsigned long clk_get_rate(struct clk *clk)
56{
57 return clk ? clk->rate : 0;
58}
59EXPORT_SYMBOL(clk_get_rate);
60
61/* a static peripheral clock for now - enough to get sh-sci working */
62static struct clk peripheral_clk = {
63 .name = "peripheral_clk",
64 .rate = 48000000,
65};
66
67/* a static rclk for now - enough to get sh_cmt working */
68static struct clk r_clk = {
69 .name = "r_clk",
70 .rate = 32768,
71};
72
73/* a static usb0 for now - enough to get r8a66597 working */
74static struct clk usb0_clk = {
75 .name = "usb0",
76};
77
78static struct clk_lookup lookups[] = {
79 {
80 .clk = &peripheral_clk,
81 }, {
82 .clk = &r_clk,
83 }, {
84 .clk = &usb0_clk,
85 }
86};
87
88void __init sh7367_clock_init(void)
89{
90 int i;
91
92 for (i = 0; i < ARRAY_SIZE(lookups); i++) {
93 lookups[i].con_id = lookups[i].clk->name;
94 clkdev_add(&lookups[i]);
95 }
96}