aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-lh7a40x
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-lh7a40x')
-rw-r--r--arch/arm/mach-lh7a40x/clocks.c92
1 files changed, 4 insertions, 88 deletions
diff --git a/arch/arm/mach-lh7a40x/clocks.c b/arch/arm/mach-lh7a40x/clocks.c
index 4fb23ac6b5ac..6182f5410b4d 100644
--- a/arch/arm/mach-lh7a40x/clocks.c
+++ b/arch/arm/mach-lh7a40x/clocks.c
@@ -14,21 +14,14 @@
14#include <linux/err.h> 14#include <linux/err.h>
15 15
16struct module; 16struct module;
17struct icst525_params;
18 17
19struct clk { 18struct clk {
20 struct list_head node; 19 struct list_head node;
21 unsigned long rate; 20 unsigned long rate;
22 struct module *owner; 21 struct module *owner;
23 const char *name; 22 const char *name;
24// void *data;
25// const struct icst525_params *params;
26// void (*setvco)(struct clk *, struct icst525_vco vco);
27}; 23};
28 24
29int clk_register(struct clk *clk);
30void clk_unregister(struct clk *clk);
31
32/* ----- */ 25/* ----- */
33 26
34#define MAINDIV1(c) (((c) >> 7) & 0x0f) 27#define MAINDIV1(c) (((c) >> 7) & 0x0f)
@@ -79,31 +72,15 @@ unsigned int pclkfreq_get (void)
79 72
80/* ----- */ 73/* ----- */
81 74
82static LIST_HEAD(clocks);
83static DECLARE_MUTEX(clocks_sem);
84
85struct clk *clk_get (struct device *dev, const char *id) 75struct clk *clk_get (struct device *dev, const char *id)
86{ 76{
87 struct clk *p; 77 return dev && strcmp(dev_name(dev), "cldc-lh7a40x") == 0
88 struct clk *clk = ERR_PTR(-ENOENT); 78 ? NULL : ERR_PTR(-ENOENT);
89
90 down (&clocks_sem);
91 list_for_each_entry (p, &clocks, node) {
92 if (strcmp (id, p->name) == 0
93 && try_module_get(p->owner)) {
94 clk = p;
95 break;
96 }
97 }
98 up (&clocks_sem);
99
100 return clk;
101} 79}
102EXPORT_SYMBOL(clk_get); 80EXPORT_SYMBOL(clk_get);
103 81
104void clk_put (struct clk *clk) 82void clk_put (struct clk *clk)
105{ 83{
106 module_put(clk->owner);
107} 84}
108EXPORT_SYMBOL(clk_put); 85EXPORT_SYMBOL(clk_put);
109 86
@@ -118,20 +95,9 @@ void clk_disable (struct clk *clk)
118} 95}
119EXPORT_SYMBOL(clk_disable); 96EXPORT_SYMBOL(clk_disable);
120 97
121int clk_use (struct clk *clk)
122{
123 return 0;
124}
125EXPORT_SYMBOL(clk_use);
126
127void clk_unuse (struct clk *clk)
128{
129}
130EXPORT_SYMBOL(clk_unuse);
131
132unsigned long clk_get_rate (struct clk *clk) 98unsigned long clk_get_rate (struct clk *clk)
133{ 99{
134 return clk->rate; 100 return 0;
135} 101}
136EXPORT_SYMBOL(clk_get_rate); 102EXPORT_SYMBOL(clk_get_rate);
137 103
@@ -143,56 +109,6 @@ EXPORT_SYMBOL(clk_round_rate);
143 109
144int clk_set_rate (struct clk *clk, unsigned long rate) 110int clk_set_rate (struct clk *clk, unsigned long rate)
145{ 111{
146 int ret = -EIO; 112 return -EIO;
147 return ret;
148} 113}
149EXPORT_SYMBOL(clk_set_rate); 114EXPORT_SYMBOL(clk_set_rate);
150
151#if 0
152/*
153 * These are fixed clocks.
154 */
155static struct clk kmi_clk = {
156 .name = "KMIREFCLK",
157 .rate = 24000000,
158};
159
160static struct clk uart_clk = {
161 .name = "UARTCLK",
162 .rate = 24000000,
163};
164
165static struct clk mmci_clk = {
166 .name = "MCLK",
167 .rate = 33000000,
168};
169#endif
170
171static struct clk clcd_clk = {
172 .name = "CLCDCLK",
173 .rate = 0,
174};
175
176int clk_register (struct clk *clk)
177{
178 down (&clocks_sem);
179 list_add (&clk->node, &clocks);
180 up (&clocks_sem);
181 return 0;
182}
183EXPORT_SYMBOL(clk_register);
184
185void clk_unregister (struct clk *clk)
186{
187 down (&clocks_sem);
188 list_del (&clk->node);
189 up (&clocks_sem);
190}
191EXPORT_SYMBOL(clk_unregister);
192
193static int __init clk_init (void)
194{
195 clk_register(&clcd_clk);
196 return 0;
197}
198arch_initcall(clk_init);