File: clock.c

package info (click to toggle)
linux-2.6 2.6.32-48squeeze20
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 494,000 kB
  • ctags: 1,415,173
  • sloc: ansic: 7,636,125; asm: 225,085; xml: 32,978; makefile: 19,314; perl: 11,533; sh: 3,561; cpp: 3,365; yacc: 2,964; python: 2,893; lex: 1,824; lisp: 218; pascal: 116; awk: 109; sed: 30
file content (82 lines) | stat: -rw-r--r-- 1,772 bytes parent folder | download | duplicates (4)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Dummy clk implementations for powerpc.
 * These need to be overridden in platform code.
 */

#include <linux/clk.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <asm/clk_interface.h>

struct clk_interface clk_functions;

struct clk *clk_get(struct device *dev, const char *id)
{
	if (clk_functions.clk_get)
		return clk_functions.clk_get(dev, id);
	return ERR_PTR(-ENOSYS);
}
EXPORT_SYMBOL(clk_get);

void clk_put(struct clk *clk)
{
	if (clk_functions.clk_put)
		clk_functions.clk_put(clk);
}
EXPORT_SYMBOL(clk_put);

int clk_enable(struct clk *clk)
{
	if (clk_functions.clk_enable)
		return clk_functions.clk_enable(clk);
	return -ENOSYS;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
	if (clk_functions.clk_disable)
		clk_functions.clk_disable(clk);
}
EXPORT_SYMBOL(clk_disable);

unsigned long clk_get_rate(struct clk *clk)
{
	if (clk_functions.clk_get_rate)
		return clk_functions.clk_get_rate(clk);
	return 0;
}
EXPORT_SYMBOL(clk_get_rate);

long clk_round_rate(struct clk *clk, unsigned long rate)
{
	if (clk_functions.clk_round_rate)
		return clk_functions.clk_round_rate(clk, rate);
	return -ENOSYS;
}
EXPORT_SYMBOL(clk_round_rate);

int clk_set_rate(struct clk *clk, unsigned long rate)
{
	if (clk_functions.clk_set_rate)
		return clk_functions.clk_set_rate(clk, rate);
	return -ENOSYS;
}
EXPORT_SYMBOL(clk_set_rate);

struct clk *clk_get_parent(struct clk *clk)
{
	if (clk_functions.clk_get_parent)
		return clk_functions.clk_get_parent(clk);
	return ERR_PTR(-ENOSYS);
}
EXPORT_SYMBOL(clk_get_parent);

int clk_set_parent(struct clk *clk, struct clk *parent)
{
	if (clk_functions.clk_set_parent)
		return clk_functions.clk_set_parent(clk, parent);
	return -ENOSYS;
}
EXPORT_SYMBOL(clk_set_parent);