blob: be6aab9c68344ef8ac10424d23a7319aee0ab6fa [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Tony Lindgrenb9158552005-07-10 19:58:14 +01002 * linux/arch/arm/plat-omap/clock.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +03004 * Copyright (C) 2004 - 2008 Nokia corporation
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 *
Tony Lindgren1a8bfa12005-11-10 14:26:50 +00007 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
8 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/kernel.h>
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000014#include <linux/init.h>
15#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
Tim Schmielau4e57b682005-10-30 15:03:48 -080019#include <linux/string.h>
Russell Kingf8ce2542006-01-07 16:15:52 +000020#include <linux/clk.h>
Arjan van de Ven00431702006-01-12 18:42:23 +000021#include <linux/mutex.h>
Tony Lindgrenb824efa2006-04-02 17:46:20 +010022#include <linux/platform_device.h>
Russell Kingb851cb22008-05-22 16:38:50 +010023#include <linux/cpufreq.h>
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +030024#include <linux/debugfs.h>
Russell Kingfced80c2008-09-06 12:10:45 +010025#include <linux/io.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/clock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Juha Yrjola7df34502006-06-26 16:16:22 -070029static LIST_HEAD(clocks);
Arjan van de Ven00431702006-01-12 18:42:23 +000030static DEFINE_MUTEX(clocks_mutex);
Juha Yrjola7df34502006-06-26 16:16:22 -070031static DEFINE_SPINLOCK(clockfw_lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000033static struct clk_functions *arch_clock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000035/*-------------------------------------------------------------------------
Tony Lindgrenf07adc52006-01-17 15:27:09 -080036 * Standard clock functions defined in include/linux/clk.h
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000037 *-------------------------------------------------------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Tony Lindgrenb824efa2006-04-02 17:46:20 +010039/*
40 * Returns a clock. Note that we first try to use device id on the bus
41 * and clock name. If this fails, we try to use clock name only.
42 */
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000043struct clk * clk_get(struct device *dev, const char *id)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044{
45 struct clk *p, *clk = ERR_PTR(-ENOENT);
Tony Lindgrenb824efa2006-04-02 17:46:20 +010046 int idno;
47
48 if (dev == NULL || dev->bus != &platform_bus_type)
49 idno = -1;
50 else
51 idno = to_platform_device(dev)->id;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Arjan van de Ven00431702006-01-12 18:42:23 +000053 mutex_lock(&clocks_mutex);
Tony Lindgrenb824efa2006-04-02 17:46:20 +010054
55 list_for_each_entry(p, &clocks, node) {
56 if (p->id == idno &&
57 strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
58 clk = p;
Tony Lindgren67d4d832006-04-09 22:21:05 +010059 goto found;
Tony Lindgrenb824efa2006-04-02 17:46:20 +010060 }
61 }
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 list_for_each_entry(p, &clocks, node) {
64 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
65 clk = p;
66 break;
67 }
68 }
Tony Lindgrenb824efa2006-04-02 17:46:20 +010069
Tony Lindgren67d4d832006-04-09 22:21:05 +010070found:
Arjan van de Ven00431702006-01-12 18:42:23 +000071 mutex_unlock(&clocks_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
73 return clk;
74}
75EXPORT_SYMBOL(clk_get);
76
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000077int clk_enable(struct clk *clk)
78{
79 unsigned long flags;
80 int ret = 0;
81
Tony Lindgrenb824efa2006-04-02 17:46:20 +010082 if (clk == NULL || IS_ERR(clk))
83 return -EINVAL;
84
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000085 spin_lock_irqsave(&clockfw_lock, flags);
Tony Lindgrenf07adc52006-01-17 15:27:09 -080086 if (arch_clock->clk_enable)
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000087 ret = arch_clock->clk_enable(clk);
Tony Lindgren1a8bfa12005-11-10 14:26:50 +000088 spin_unlock_irqrestore(&clockfw_lock, flags);
89
90 return ret;
91}
92EXPORT_SYMBOL(clk_enable);
93
94void clk_disable(struct clk *clk)
95{
96 unsigned long flags;
97
Tony Lindgrenb824efa2006-04-02 17:46:20 +010098 if (clk == NULL || IS_ERR(clk))
99 return;
100
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000101 spin_lock_irqsave(&clockfw_lock, flags);
Tony Lindgren7cf95772007-08-07 05:20:00 -0700102 if (clk->usecount == 0) {
103 printk(KERN_ERR "Trying disable clock %s with 0 usecount\n",
104 clk->name);
105 WARN_ON(1);
106 goto out;
107 }
108
Tony Lindgrenf07adc52006-01-17 15:27:09 -0800109 if (arch_clock->clk_disable)
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000110 arch_clock->clk_disable(clk);
Tony Lindgren7cf95772007-08-07 05:20:00 -0700111
112out:
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000113 spin_unlock_irqrestore(&clockfw_lock, flags);
114}
115EXPORT_SYMBOL(clk_disable);
116
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000117int clk_get_usecount(struct clk *clk)
118{
119 unsigned long flags;
120 int ret = 0;
121
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100122 if (clk == NULL || IS_ERR(clk))
123 return 0;
124
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000125 spin_lock_irqsave(&clockfw_lock, flags);
126 ret = clk->usecount;
127 spin_unlock_irqrestore(&clockfw_lock, flags);
128
129 return ret;
130}
131EXPORT_SYMBOL(clk_get_usecount);
132
133unsigned long clk_get_rate(struct clk *clk)
134{
135 unsigned long flags;
136 unsigned long ret = 0;
137
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100138 if (clk == NULL || IS_ERR(clk))
139 return 0;
140
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000141 spin_lock_irqsave(&clockfw_lock, flags);
142 ret = clk->rate;
143 spin_unlock_irqrestore(&clockfw_lock, flags);
144
145 return ret;
146}
147EXPORT_SYMBOL(clk_get_rate);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
149void clk_put(struct clk *clk)
150{
151 if (clk && !IS_ERR(clk))
152 module_put(clk->owner);
153}
154EXPORT_SYMBOL(clk_put);
155
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000156/*-------------------------------------------------------------------------
Tony Lindgrenf07adc52006-01-17 15:27:09 -0800157 * Optional clock functions defined in include/linux/clk.h
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000158 *-------------------------------------------------------------------------*/
Tony Lindgrenbb13b5f2005-07-10 19:58:18 +0100159
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160long clk_round_rate(struct clk *clk, unsigned long rate)
161{
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000162 unsigned long flags;
163 long ret = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100165 if (clk == NULL || IS_ERR(clk))
166 return ret;
167
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000168 spin_lock_irqsave(&clockfw_lock, flags);
169 if (arch_clock->clk_round_rate)
170 ret = arch_clock->clk_round_rate(clk, rate);
171 spin_unlock_irqrestore(&clockfw_lock, flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000173 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174}
175EXPORT_SYMBOL(clk_round_rate);
176
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177int clk_set_rate(struct clk *clk, unsigned long rate)
178{
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000179 unsigned long flags;
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100180 int ret = -EINVAL;
181
182 if (clk == NULL || IS_ERR(clk))
183 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000185 spin_lock_irqsave(&clockfw_lock, flags);
186 if (arch_clock->clk_set_rate)
187 ret = arch_clock->clk_set_rate(clk, rate);
188 spin_unlock_irqrestore(&clockfw_lock, flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
190 return ret;
191}
192EXPORT_SYMBOL(clk_set_rate);
193
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000194int clk_set_parent(struct clk *clk, struct clk *parent)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195{
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000196 unsigned long flags;
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100197 int ret = -EINVAL;
198
199 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
200 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000202 spin_lock_irqsave(&clockfw_lock, flags);
203 if (arch_clock->clk_set_parent)
204 ret = arch_clock->clk_set_parent(clk, parent);
205 spin_unlock_irqrestore(&clockfw_lock, flags);
206
207 return ret;
208}
209EXPORT_SYMBOL(clk_set_parent);
210
211struct clk *clk_get_parent(struct clk *clk)
212{
213 unsigned long flags;
214 struct clk * ret = NULL;
215
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100216 if (clk == NULL || IS_ERR(clk))
217 return ret;
218
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000219 spin_lock_irqsave(&clockfw_lock, flags);
220 if (arch_clock->clk_get_parent)
221 ret = arch_clock->clk_get_parent(clk);
222 spin_unlock_irqrestore(&clockfw_lock, flags);
223
224 return ret;
225}
226EXPORT_SYMBOL(clk_get_parent);
227
228/*-------------------------------------------------------------------------
229 * OMAP specific clock functions shared between omap1 and omap2
230 *-------------------------------------------------------------------------*/
231
232unsigned int __initdata mpurate;
233
234/*
235 * By default we use the rate set by the bootloader.
236 * You can override this with mpurate= cmdline option.
237 */
238static int __init omap_clk_setup(char *str)
239{
240 get_option(&str, &mpurate);
241
242 if (!mpurate)
243 return 1;
244
245 if (mpurate < 1000)
246 mpurate *= 1000000;
247
248 return 1;
249}
250__setup("mpurate=", omap_clk_setup);
251
252/* Used for clocks that always have same value as the parent clock */
253void followparent_recalc(struct clk *clk)
254{
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100255 if (clk == NULL || IS_ERR(clk))
256 return;
257
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000258 clk->rate = clk->parent->rate;
Imre Deakb1465bf2007-03-06 03:52:01 -0800259 if (unlikely(clk->flags & RATE_PROPAGATES))
260 propagate_rate(clk);
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000261}
262
263/* Propagate rate to children */
264void propagate_rate(struct clk * tclk)
265{
266 struct clk *clkp;
267
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100268 if (tclk == NULL || IS_ERR(tclk))
269 return;
270
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000271 list_for_each_entry(clkp, &clocks, node) {
272 if (likely(clkp->parent != tclk))
273 continue;
274 if (likely((u32)clkp->recalc))
275 clkp->recalc(clkp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277}
278
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200279/**
280 * recalculate_root_clocks - recalculate and propagate all root clocks
281 *
282 * Recalculates all root clocks (clocks with no parent), which if the
283 * clock's .recalc is set correctly, should also propagate their rates.
284 * Called at init.
285 */
286void recalculate_root_clocks(void)
287{
288 struct clk *clkp;
289
290 list_for_each_entry(clkp, &clocks, node) {
291 if (unlikely(!clkp->parent) && likely((u32)clkp->recalc))
292 clkp->recalc(clkp);
293 }
294}
295
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296int clk_register(struct clk *clk)
297{
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100298 if (clk == NULL || IS_ERR(clk))
299 return -EINVAL;
300
Arjan van de Ven00431702006-01-12 18:42:23 +0000301 mutex_lock(&clocks_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 list_add(&clk->node, &clocks);
303 if (clk->init)
304 clk->init(clk);
Arjan van de Ven00431702006-01-12 18:42:23 +0000305 mutex_unlock(&clocks_mutex);
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000306
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307 return 0;
308}
309EXPORT_SYMBOL(clk_register);
310
311void clk_unregister(struct clk *clk)
312{
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100313 if (clk == NULL || IS_ERR(clk))
314 return;
315
Arjan van de Ven00431702006-01-12 18:42:23 +0000316 mutex_lock(&clocks_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 list_del(&clk->node);
Arjan van de Ven00431702006-01-12 18:42:23 +0000318 mutex_unlock(&clocks_mutex);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319}
320EXPORT_SYMBOL(clk_unregister);
321
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000322void clk_deny_idle(struct clk *clk)
Tony Lindgrenbb13b5f2005-07-10 19:58:18 +0100323{
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000324 unsigned long flags;
325
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100326 if (clk == NULL || IS_ERR(clk))
327 return;
328
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000329 spin_lock_irqsave(&clockfw_lock, flags);
330 if (arch_clock->clk_deny_idle)
331 arch_clock->clk_deny_idle(clk);
332 spin_unlock_irqrestore(&clockfw_lock, flags);
Tony Lindgrenbb13b5f2005-07-10 19:58:18 +0100333}
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000334EXPORT_SYMBOL(clk_deny_idle);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000336void clk_allow_idle(struct clk *clk)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337{
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000338 unsigned long flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100340 if (clk == NULL || IS_ERR(clk))
341 return;
342
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000343 spin_lock_irqsave(&clockfw_lock, flags);
344 if (arch_clock->clk_allow_idle)
345 arch_clock->clk_allow_idle(clk);
346 spin_unlock_irqrestore(&clockfw_lock, flags);
347}
348EXPORT_SYMBOL(clk_allow_idle);
Tony Lindgrenbb13b5f2005-07-10 19:58:18 +0100349
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200350void clk_enable_init_clocks(void)
351{
352 struct clk *clkp;
353
354 list_for_each_entry(clkp, &clocks, node) {
355 if (clkp->flags & ENABLE_ON_INIT)
356 clk_enable(clkp);
357 }
358}
359EXPORT_SYMBOL(clk_enable_init_clocks);
360
361#ifdef CONFIG_CPU_FREQ
362void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
363{
364 unsigned long flags;
365
366 spin_lock_irqsave(&clockfw_lock, flags);
367 if (arch_clock->clk_init_cpufreq_table)
368 arch_clock->clk_init_cpufreq_table(table);
369 spin_unlock_irqrestore(&clockfw_lock, flags);
370}
371EXPORT_SYMBOL(clk_init_cpufreq_table);
372#endif
373
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000374/*-------------------------------------------------------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375
Tony Lindgren90afd5c2006-09-25 13:27:20 +0300376#ifdef CONFIG_OMAP_RESET_CLOCKS
377/*
378 * Disable any unused clocks left on by the bootloader
379 */
380static int __init clk_disable_unused(void)
381{
382 struct clk *ck;
383 unsigned long flags;
384
385 list_for_each_entry(ck, &clocks, node) {
386 if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) ||
387 ck->enable_reg == 0)
388 continue;
389
390 spin_lock_irqsave(&clockfw_lock, flags);
391 if (arch_clock->clk_disable_unused)
392 arch_clock->clk_disable_unused(ck);
393 spin_unlock_irqrestore(&clockfw_lock, flags);
394 }
395
396 return 0;
397}
398late_initcall(clk_disable_unused);
399#endif
400
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000401int __init clk_init(struct clk_functions * custom_clocks)
402{
403 if (!custom_clocks) {
404 printk(KERN_ERR "No custom clock functions registered\n");
405 BUG();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 }
407
Tony Lindgren1a8bfa12005-11-10 14:26:50 +0000408 arch_clock = custom_clocks;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409
410 return 0;
411}
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200412
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300413#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
414/*
415 * debugfs support to trace clock tree hierarchy and attributes
416 */
417static struct dentry *clk_debugfs_root;
418
419static int clk_debugfs_register_one(struct clk *c)
420{
421 int err;
422 struct dentry *d, *child;
423 struct clk *pa = c->parent;
424 char s[255];
425 char *p = s;
426
427 p += sprintf(p, "%s", c->name);
428 if (c->id != 0)
429 sprintf(p, ":%d", c->id);
430 d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
Zhaoleie621f262008-11-04 13:35:07 -0800431 if (!d)
432 return -ENOMEM;
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300433 c->dent = d;
434
435 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
Zhaoleie621f262008-11-04 13:35:07 -0800436 if (!d) {
437 err = -ENOMEM;
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300438 goto err_out;
439 }
440 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
Zhaoleie621f262008-11-04 13:35:07 -0800441 if (!d) {
442 err = -ENOMEM;
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300443 goto err_out;
444 }
445 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
Zhaoleie621f262008-11-04 13:35:07 -0800446 if (!d) {
447 err = -ENOMEM;
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300448 goto err_out;
449 }
450 return 0;
451
452err_out:
453 d = c->dent;
454 list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
455 debugfs_remove(child);
456 debugfs_remove(c->dent);
457 return err;
458}
459
460static int clk_debugfs_register(struct clk *c)
461{
462 int err;
463 struct clk *pa = c->parent;
464
465 if (pa && !pa->dent) {
466 err = clk_debugfs_register(pa);
467 if (err)
468 return err;
469 }
470
471 if (!c->dent) {
472 err = clk_debugfs_register_one(c);
473 if (err)
474 return err;
475 }
476 return 0;
477}
478
479static int __init clk_debugfs_init(void)
480{
481 struct clk *c;
482 struct dentry *d;
483 int err;
484
485 d = debugfs_create_dir("clock", NULL);
Zhaoleie621f262008-11-04 13:35:07 -0800486 if (!d)
487 return -ENOMEM;
Hiroshi DOYU137b3ee2008-07-03 12:24:41 +0300488 clk_debugfs_root = d;
489
490 list_for_each_entry(c, &clocks, node) {
491 err = clk_debugfs_register(c);
492 if (err)
493 goto err_out;
494 }
495 return 0;
496err_out:
497 debugfs_remove(clk_debugfs_root); /* REVISIT: Cleanup correctly */
498 return err;
499}
500late_initcall(clk_debugfs_init);
501
502#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */