[adm8668] get rid of the specific UART driver and use AMBA PL010
[openwrt/svn-archive/archive.git] / target / linux / adm8668 / files / arch / mips / adm8668 / clock.c
1 /*
2 * ADM8668 minimal clock support
3 *
4 * Copyright (C) 2012, Florian Fainelli <florian@openwrt.org>
5 *
6 * Licensed under the terms of the GPLv2
7 */
8
9 #include <linux/kernel.h>
10 #include <linux/module.h>
11 #include <linux/device.h>
12 #include <linux/err.h>
13 #include <linux/clk.h>
14
15 #include <adm8668.h>
16
17 struct clk {
18 unsigned long rate;
19 };
20
21 static struct clk uart_clk = {
22 .rate = ADM8668_UARTCLK_FREQ,
23 };
24
25 struct clk *clk_get(struct device *dev, const char *id)
26 {
27 const char *name = dev_name(dev);
28
29 if (!strcmp(name, "apb:uart0"))
30 return &uart_clk;
31
32 return ERR_PTR(-ENOENT);
33 }
34 EXPORT_SYMBOL(clk_get);
35
36 int clk_enable(struct clk *clk)
37 {
38 return 0;
39 }
40 EXPORT_SYMBOL(clk_enable);
41
42 void clk_disable(struct clk *clk)
43 {
44 }
45 EXPORT_SYMBOL(clk_disable);
46
47 unsigned long clk_get_rate(struct clk *clk)
48 {
49 return clk->rate;
50 }
51 EXPORT_SYMBOL(clk_get_rate);
52
53 void clk_put(struct clk *clk)
54 {
55 }
56 EXPORT_SYMBOL(clk_put);