summaryrefslogtreecommitdiffstats
path: root/target/linux/adm8668/files/arch/mips/adm8668/clock.c
blob: 96d139e1774faf003e7899ab28f1bcec6ff7944e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * ADM8668 minimal clock support
 *
 * Copyright (C) 2012, Florian Fainelli <florian@openwrt.org>
 *
 * Licensed under the terms of the GPLv2
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/clk.h>

#include <adm8668.h>

struct clk {
	unsigned long rate;
};

static struct clk uart_clk = {
	.rate	= ADM8668_UARTCLK_FREQ,
};

struct clk *clk_get(struct device *dev, const char *id)
{
	const char *name = dev_name(dev);

	if (!strcmp(name, "apb:uart0"))
		return &uart_clk;

	return ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL(clk_get);

int clk_enable(struct clk *clk)
{
	return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);

unsigned long clk_get_rate(struct clk *clk)
{
	return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);

void clk_put(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_put);