Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
[linux/fpc-iii.git] / arch / arm / mach-shmobile / clock-sh7367.c
blobbb940c6e4e6ca6f26ac87824b919a316aec732ed
1 /*
2 * Preliminary clock framework support for sh7367
4 * Copyright (C) 2010 Magnus Damm
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.
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.
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
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>
25 struct clk {
26 const char *name;
27 unsigned long rate;
30 #include <asm/clkdev.h>
32 int __clk_get(struct clk *clk)
34 return 1;
36 EXPORT_SYMBOL(__clk_get);
38 void __clk_put(struct clk *clk)
41 EXPORT_SYMBOL(__clk_put);
44 int clk_enable(struct clk *clk)
46 return 0;
48 EXPORT_SYMBOL(clk_enable);
50 void clk_disable(struct clk *clk)
53 EXPORT_SYMBOL(clk_disable);
55 unsigned long clk_get_rate(struct clk *clk)
57 return clk ? clk->rate : 0;
59 EXPORT_SYMBOL(clk_get_rate);
61 /* a static peripheral clock for now - enough to get sh-sci working */
62 static struct clk peripheral_clk = {
63 .name = "peripheral_clk",
64 .rate = 48000000,
67 /* a static rclk for now - enough to get sh_cmt working */
68 static struct clk r_clk = {
69 .name = "r_clk",
70 .rate = 32768,
73 /* a static usb0 for now - enough to get r8a66597 working */
74 static struct clk usb0_clk = {
75 .name = "usb0",
78 /* a static keysc0 clk for now - enough to get sh_keysc working */
79 static struct clk keysc0_clk = {
80 .name = "keysc0",
83 static struct clk_lookup lookups[] = {
85 .clk = &peripheral_clk,
86 }, {
87 .clk = &r_clk,
88 }, {
89 .clk = &usb0_clk,
90 }, {
91 .clk = &keysc0_clk,
95 void __init sh7367_clock_init(void)
97 int i;
99 for (i = 0; i < ARRAY_SIZE(lookups); i++) {
100 lookups[i].con_id = lookups[i].clk->name;
101 clkdev_add(&lookups[i]);