Revert r12510. Remove -rpath-link form TARGET_LDFLAGS as it breaks some
[15.05/openwrt.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 modify it
15  *  under the terms of the GNU General Public License version 2 as published
16  *  by the Free Software Foundation.
17  *
18  */
19
20 #include <linux/kernel.h>
21 #include <linux/string.h>
22 #include <linux/module.h>
23 #include <linux/err.h>
24 #include <linux/clk.h>
25
26 #include <adm5120_defs.h>
27
28 struct clk {
29         unsigned long rate;
30 };
31
32 static struct clk uart_clk = {
33         .rate = ADM5120_UART_CLOCK
34 };
35
36 struct clk *clk_get(struct device *dev, const char *id)
37 {
38         if (!strcmp(id, "UARTCLK"))
39                 return &uart_clk;
40
41         return ERR_PTR(-ENOENT);
42 }
43 EXPORT_SYMBOL(clk_get);
44
45 int clk_enable(struct clk *clk)
46 {
47         return 0;
48 }
49 EXPORT_SYMBOL(clk_enable);
50
51 void clk_disable(struct clk *clk)
52 {
53 }
54 EXPORT_SYMBOL(clk_disable);
55
56 unsigned long clk_get_rate(struct clk *clk)
57 {
58         return clk->rate;
59 }
60 EXPORT_SYMBOL(clk_get_rate);
61
62 void clk_put(struct clk *clk)
63 {
64 }
65 EXPORT_SYMBOL(clk_put);