4a8b69b4cb3a5ea5b1541f4f17986adca549d995
[openwrt/svn-archive/archive.git] / target / linux / adm5120 / files / arch / mips / adm5120 / clock.c
1 /*
2 * $Id$
3 *
4 * ADM5120 minimal CLK API implementation
5 *
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8 *
9 * This file was based on the CLK API implementation in:
10 * arch/mips/tx4938/toshiba_rbtx4938/setup.c
11 * Copyright (C) 2000-2001 Toshiba Corporation
12 * 2003-2005 (c) MontaVista Software, Inc.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the
26 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 * Boston, MA 02110-1301, USA.
28 *
29 */
30
31 #include <linux/kernel.h>
32 #include <linux/string.h>
33 #include <linux/module.h>
34 #include <linux/err.h>
35 #include <linux/clk.h>
36
37 #include <asm/mach-adm5120/adm5120_defs.h>
38
39 struct clk {
40 unsigned long rate;
41 };
42
43 static struct clk uart_clk = {
44 .rate = ADM5120_UART_CLOCK
45 };
46
47 struct clk *clk_get(struct device *dev, const char *id)
48 {
49 if (!strcmp(id, "UARTCLK"))
50 return &uart_clk;
51
52 return ERR_PTR(-ENOENT);
53 }
54 EXPORT_SYMBOL(clk_get);
55
56 int clk_enable(struct clk *clk)
57 {
58 return 0;
59 }
60 EXPORT_SYMBOL(clk_enable);
61
62 void clk_disable(struct clk *clk)
63 {
64 }
65 EXPORT_SYMBOL(clk_disable);
66
67 unsigned long clk_get_rate(struct clk *clk)
68 {
69 return clk->rate;
70 }
71 EXPORT_SYMBOL(clk_get_rate);
72
73 void clk_put(struct clk *clk)
74 {
75 }
76 EXPORT_SYMBOL(clk_put);