diff options
Diffstat (limited to 'arch/arm/mach-lh7a40x/clocks.c')
-rw-r--r-- | arch/arm/mach-lh7a40x/clocks.c | 65 |
1 files changed, 4 insertions, 61 deletions
diff --git a/arch/arm/mach-lh7a40x/clocks.c b/arch/arm/mach-lh7a40x/clocks.c index fcdac94a9510..6182f5410b4d 100644 --- a/arch/arm/mach-lh7a40x/clocks.c +++ b/arch/arm/mach-lh7a40x/clocks.c | |||
@@ -72,31 +72,15 @@ unsigned int pclkfreq_get (void) | |||
72 | 72 | ||
73 | /* ----- */ | 73 | /* ----- */ |
74 | 74 | ||
75 | static LIST_HEAD(clocks); | ||
76 | static DECLARE_MUTEX(clocks_sem); | ||
77 | |||
78 | struct clk *clk_get (struct device *dev, const char *id) | 75 | struct clk *clk_get (struct device *dev, const char *id) |
79 | { | 76 | { |
80 | struct clk *p; | 77 | return dev && strcmp(dev_name(dev), "cldc-lh7a40x") == 0 |
81 | struct clk *clk = ERR_PTR(-ENOENT); | 78 | ? NULL : ERR_PTR(-ENOENT); |
82 | |||
83 | down (&clocks_sem); | ||
84 | list_for_each_entry (p, &clocks, node) { | ||
85 | if (strcmp (id, p->name) == 0 | ||
86 | && try_module_get(p->owner)) { | ||
87 | clk = p; | ||
88 | break; | ||
89 | } | ||
90 | } | ||
91 | up (&clocks_sem); | ||
92 | |||
93 | return clk; | ||
94 | } | 79 | } |
95 | EXPORT_SYMBOL(clk_get); | 80 | EXPORT_SYMBOL(clk_get); |
96 | 81 | ||
97 | void clk_put (struct clk *clk) | 82 | void clk_put (struct clk *clk) |
98 | { | 83 | { |
99 | module_put(clk->owner); | ||
100 | } | 84 | } |
101 | EXPORT_SYMBOL(clk_put); | 85 | EXPORT_SYMBOL(clk_put); |
102 | 86 | ||
@@ -111,20 +95,9 @@ void clk_disable (struct clk *clk) | |||
111 | } | 95 | } |
112 | EXPORT_SYMBOL(clk_disable); | 96 | EXPORT_SYMBOL(clk_disable); |
113 | 97 | ||
114 | int clk_use (struct clk *clk) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | EXPORT_SYMBOL(clk_use); | ||
119 | |||
120 | void clk_unuse (struct clk *clk) | ||
121 | { | ||
122 | } | ||
123 | EXPORT_SYMBOL(clk_unuse); | ||
124 | |||
125 | unsigned long clk_get_rate (struct clk *clk) | 98 | unsigned long clk_get_rate (struct clk *clk) |
126 | { | 99 | { |
127 | return clk->rate; | 100 | return 0; |
128 | } | 101 | } |
129 | EXPORT_SYMBOL(clk_get_rate); | 102 | EXPORT_SYMBOL(clk_get_rate); |
130 | 103 | ||
@@ -136,36 +109,6 @@ EXPORT_SYMBOL(clk_round_rate); | |||
136 | 109 | ||
137 | int clk_set_rate (struct clk *clk, unsigned long rate) | 110 | int clk_set_rate (struct clk *clk, unsigned long rate) |
138 | { | 111 | { |
139 | int ret = -EIO; | 112 | return -EIO; |
140 | return ret; | ||
141 | } | 113 | } |
142 | EXPORT_SYMBOL(clk_set_rate); | 114 | EXPORT_SYMBOL(clk_set_rate); |
143 | |||
144 | static struct clk clcd_clk = { | ||
145 | .name = "CLCDCLK", | ||
146 | .rate = 0, | ||
147 | }; | ||
148 | |||
149 | int clk_register (struct clk *clk) | ||
150 | { | ||
151 | down (&clocks_sem); | ||
152 | list_add (&clk->node, &clocks); | ||
153 | up (&clocks_sem); | ||
154 | return 0; | ||
155 | } | ||
156 | EXPORT_SYMBOL(clk_register); | ||
157 | |||
158 | void clk_unregister (struct clk *clk) | ||
159 | { | ||
160 | down (&clocks_sem); | ||
161 | list_del (&clk->node); | ||
162 | up (&clocks_sem); | ||
163 | } | ||
164 | EXPORT_SYMBOL(clk_unregister); | ||
165 | |||
166 | static int __init clk_init (void) | ||
167 | { | ||
168 | clk_register(&clcd_clk); | ||
169 | return 0; | ||
170 | } | ||
171 | arch_initcall(clk_init); | ||