clock.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /*
  2. * Clock and PLL control for DaVinci devices
  3. *
  4. * Copyright (C) 2006-2007 Texas Instruments.
  5. * Copyright (C) 2008-2009 Deep Root Systems, LLC
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. */
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/errno.h>
  16. #include <linux/clk.h>
  17. #include <linux/err.h>
  18. #include <linux/mutex.h>
  19. #include <linux/io.h>
  20. #include <linux/delay.h>
  21. #include <mach/hardware.h>
  22. #include <mach/clock.h>
  23. #include <mach/psc.h>
  24. #include <mach/cputype.h>
  25. #include "clock.h"
  26. static LIST_HEAD(clocks);
  27. static DEFINE_MUTEX(clocks_mutex);
  28. static DEFINE_SPINLOCK(clockfw_lock);
  29. static void __clk_enable(struct clk *clk)
  30. {
  31. if (clk->parent)
  32. __clk_enable(clk->parent);
  33. if (clk->usecount++ == 0) {
  34. if (clk->flags & CLK_PSC)
  35. davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
  36. true, clk->flags);
  37. else if (clk->clk_enable)
  38. clk->clk_enable(clk);
  39. }
  40. }
  41. static void __clk_disable(struct clk *clk)
  42. {
  43. if (WARN_ON(clk->usecount == 0))
  44. return;
  45. if (--clk->usecount == 0) {
  46. if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC))
  47. davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
  48. false, clk->flags);
  49. else if (clk->clk_disable)
  50. clk->clk_disable(clk);
  51. }
  52. if (clk->parent)
  53. __clk_disable(clk->parent);
  54. }
  55. int davinci_clk_reset(struct clk *clk, bool reset)
  56. {
  57. unsigned long flags;
  58. if (clk == NULL || IS_ERR(clk))
  59. return -EINVAL;
  60. spin_lock_irqsave(&clockfw_lock, flags);
  61. if (clk->flags & CLK_PSC)
  62. davinci_psc_reset(clk->gpsc, clk->lpsc, reset);
  63. spin_unlock_irqrestore(&clockfw_lock, flags);
  64. return 0;
  65. }
  66. EXPORT_SYMBOL(davinci_clk_reset);
  67. int davinci_clk_reset_assert(struct clk *clk)
  68. {
  69. if (clk == NULL || IS_ERR(clk) || !clk->reset)
  70. return -EINVAL;
  71. return clk->reset(clk, true);
  72. }
  73. EXPORT_SYMBOL(davinci_clk_reset_assert);
  74. int davinci_clk_reset_deassert(struct clk *clk)
  75. {
  76. if (clk == NULL || IS_ERR(clk) || !clk->reset)
  77. return -EINVAL;
  78. return clk->reset(clk, false);
  79. }
  80. EXPORT_SYMBOL(davinci_clk_reset_deassert);
  81. int clk_enable(struct clk *clk)
  82. {
  83. unsigned long flags;
  84. if (!clk)
  85. return 0;
  86. else if (IS_ERR(clk))
  87. return -EINVAL;
  88. spin_lock_irqsave(&clockfw_lock, flags);
  89. __clk_enable(clk);
  90. spin_unlock_irqrestore(&clockfw_lock, flags);
  91. return 0;
  92. }
  93. EXPORT_SYMBOL(clk_enable);
  94. void clk_disable(struct clk *clk)
  95. {
  96. unsigned long flags;
  97. if (clk == NULL || IS_ERR(clk))
  98. return;
  99. spin_lock_irqsave(&clockfw_lock, flags);
  100. __clk_disable(clk);
  101. spin_unlock_irqrestore(&clockfw_lock, flags);
  102. }
  103. EXPORT_SYMBOL(clk_disable);
  104. unsigned long clk_get_rate(struct clk *clk)
  105. {
  106. if (clk == NULL || IS_ERR(clk))
  107. return 0;
  108. return clk->rate;
  109. }
  110. EXPORT_SYMBOL(clk_get_rate);
  111. long clk_round_rate(struct clk *clk, unsigned long rate)
  112. {
  113. if (clk == NULL || IS_ERR(clk))
  114. return 0;
  115. if (clk->round_rate)
  116. return clk->round_rate(clk, rate);
  117. return clk->rate;
  118. }
  119. EXPORT_SYMBOL(clk_round_rate);
  120. /* Propagate rate to children */
  121. static void propagate_rate(struct clk *root)
  122. {
  123. struct clk *clk;
  124. list_for_each_entry(clk, &root->children, childnode) {
  125. if (clk->recalc)
  126. clk->rate = clk->recalc(clk);
  127. propagate_rate(clk);
  128. }
  129. }
  130. int clk_set_rate(struct clk *clk, unsigned long rate)
  131. {
  132. unsigned long flags;
  133. int ret = -EINVAL;
  134. if (!clk)
  135. return 0;
  136. else if (IS_ERR(clk))
  137. return -EINVAL;
  138. if (clk->set_rate)
  139. ret = clk->set_rate(clk, rate);
  140. spin_lock_irqsave(&clockfw_lock, flags);
  141. if (ret == 0) {
  142. if (clk->recalc)
  143. clk->rate = clk->recalc(clk);
  144. propagate_rate(clk);
  145. }
  146. spin_unlock_irqrestore(&clockfw_lock, flags);
  147. return ret;
  148. }
  149. EXPORT_SYMBOL(clk_set_rate);
  150. int clk_set_parent(struct clk *clk, struct clk *parent)
  151. {
  152. unsigned long flags;
  153. if (!clk)
  154. return 0;
  155. else if (IS_ERR(clk))
  156. return -EINVAL;
  157. /* Cannot change parent on enabled clock */
  158. if (WARN_ON(clk->usecount))
  159. return -EINVAL;
  160. mutex_lock(&clocks_mutex);
  161. clk->parent = parent;
  162. list_del_init(&clk->childnode);
  163. list_add(&clk->childnode, &clk->parent->children);
  164. mutex_unlock(&clocks_mutex);
  165. spin_lock_irqsave(&clockfw_lock, flags);
  166. if (clk->recalc)
  167. clk->rate = clk->recalc(clk);
  168. propagate_rate(clk);
  169. spin_unlock_irqrestore(&clockfw_lock, flags);
  170. return 0;
  171. }
  172. EXPORT_SYMBOL(clk_set_parent);
  173. int clk_register(struct clk *clk)
  174. {
  175. if (clk == NULL || IS_ERR(clk))
  176. return -EINVAL;
  177. if (WARN(clk->parent && !clk->parent->rate,
  178. "CLK: %s parent %s has no rate!\n",
  179. clk->name, clk->parent->name))
  180. return -EINVAL;
  181. INIT_LIST_HEAD(&clk->children);
  182. mutex_lock(&clocks_mutex);
  183. list_add_tail(&clk->node, &clocks);
  184. if (clk->parent)
  185. list_add_tail(&clk->childnode, &clk->parent->children);
  186. mutex_unlock(&clocks_mutex);
  187. /* If rate is already set, use it */
  188. if (clk->rate)
  189. return 0;
  190. /* Else, see if there is a way to calculate it */
  191. if (clk->recalc)
  192. clk->rate = clk->recalc(clk);
  193. /* Otherwise, default to parent rate */
  194. else if (clk->parent)
  195. clk->rate = clk->parent->rate;
  196. return 0;
  197. }
  198. EXPORT_SYMBOL(clk_register);
  199. void clk_unregister(struct clk *clk)
  200. {
  201. if (clk == NULL || IS_ERR(clk))
  202. return;
  203. mutex_lock(&clocks_mutex);
  204. list_del(&clk->node);
  205. list_del(&clk->childnode);
  206. mutex_unlock(&clocks_mutex);
  207. }
  208. EXPORT_SYMBOL(clk_unregister);
  209. #ifdef CONFIG_DAVINCI_RESET_CLOCKS
  210. /*
  211. * Disable any unused clocks left on by the bootloader
  212. */
  213. int __init davinci_clk_disable_unused(void)
  214. {
  215. struct clk *ck;
  216. spin_lock_irq(&clockfw_lock);
  217. list_for_each_entry(ck, &clocks, node) {
  218. if (ck->usecount > 0)
  219. continue;
  220. if (!(ck->flags & CLK_PSC))
  221. continue;
  222. /* ignore if in Disabled or SwRstDisable states */
  223. if (!davinci_psc_is_clk_active(ck->gpsc, ck->lpsc))
  224. continue;
  225. pr_debug("Clocks: disable unused %s\n", ck->name);
  226. davinci_psc_config(ck->domain, ck->gpsc, ck->lpsc,
  227. false, ck->flags);
  228. }
  229. spin_unlock_irq(&clockfw_lock);
  230. return 0;
  231. }
  232. #endif
  233. static unsigned long clk_sysclk_recalc(struct clk *clk)
  234. {
  235. u32 v, plldiv;
  236. struct pll_data *pll;
  237. unsigned long rate = clk->rate;
  238. /* If this is the PLL base clock, no more calculations needed */
  239. if (clk->pll_data)
  240. return rate;
  241. if (WARN_ON(!clk->parent))
  242. return rate;
  243. rate = clk->parent->rate;
  244. /* Otherwise, the parent must be a PLL */
  245. if (WARN_ON(!clk->parent->pll_data))
  246. return rate;
  247. pll = clk->parent->pll_data;
  248. /* If pre-PLL, source clock is before the multiplier and divider(s) */
  249. if (clk->flags & PRE_PLL)
  250. rate = pll->input_rate;
  251. if (!clk->div_reg)
  252. return rate;
  253. v = __raw_readl(pll->base + clk->div_reg);
  254. if (v & PLLDIV_EN) {
  255. plldiv = (v & pll->div_ratio_mask) + 1;
  256. if (plldiv)
  257. rate /= plldiv;
  258. }
  259. return rate;
  260. }
  261. int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate)
  262. {
  263. unsigned v;
  264. struct pll_data *pll;
  265. unsigned long input;
  266. unsigned ratio = 0;
  267. /* If this is the PLL base clock, wrong function to call */
  268. if (clk->pll_data)
  269. return -EINVAL;
  270. /* There must be a parent... */
  271. if (WARN_ON(!clk->parent))
  272. return -EINVAL;
  273. /* ... the parent must be a PLL... */
  274. if (WARN_ON(!clk->parent->pll_data))
  275. return -EINVAL;
  276. /* ... and this clock must have a divider. */
  277. if (WARN_ON(!clk->div_reg))
  278. return -EINVAL;
  279. pll = clk->parent->pll_data;
  280. input = clk->parent->rate;
  281. /* If pre-PLL, source clock is before the multiplier and divider(s) */
  282. if (clk->flags & PRE_PLL)
  283. input = pll->input_rate;
  284. if (input > rate) {
  285. /*
  286. * Can afford to provide an output little higher than requested
  287. * only if maximum rate supported by hardware on this sysclk
  288. * is known.
  289. */
  290. if (clk->maxrate) {
  291. ratio = DIV_ROUND_CLOSEST(input, rate);
  292. if (input / ratio > clk->maxrate)
  293. ratio = 0;
  294. }
  295. if (ratio == 0)
  296. ratio = DIV_ROUND_UP(input, rate);
  297. ratio--;
  298. }
  299. if (ratio > pll->div_ratio_mask)
  300. return -EINVAL;
  301. do {
  302. v = __raw_readl(pll->base + PLLSTAT);
  303. } while (v & PLLSTAT_GOSTAT);
  304. v = __raw_readl(pll->base + clk->div_reg);
  305. v &= ~pll->div_ratio_mask;
  306. v |= ratio | PLLDIV_EN;
  307. __raw_writel(v, pll->base + clk->div_reg);
  308. v = __raw_readl(pll->base + PLLCMD);
  309. v |= PLLCMD_GOSET;
  310. __raw_writel(v, pll->base + PLLCMD);
  311. do {
  312. v = __raw_readl(pll->base + PLLSTAT);
  313. } while (v & PLLSTAT_GOSTAT);
  314. return 0;
  315. }
  316. EXPORT_SYMBOL(davinci_set_sysclk_rate);
  317. static unsigned long clk_leafclk_recalc(struct clk *clk)
  318. {
  319. if (WARN_ON(!clk->parent))
  320. return clk->rate;
  321. return clk->parent->rate;
  322. }
  323. int davinci_simple_set_rate(struct clk *clk, unsigned long rate)
  324. {
  325. clk->rate = rate;
  326. return 0;
  327. }
  328. static unsigned long clk_pllclk_recalc(struct clk *clk)
  329. {
  330. u32 ctrl, mult = 1, prediv = 1, postdiv = 1;
  331. u8 bypass;
  332. struct pll_data *pll = clk->pll_data;
  333. unsigned long rate = clk->rate;
  334. ctrl = __raw_readl(pll->base + PLLCTL);
  335. rate = pll->input_rate = clk->parent->rate;
  336. if (ctrl & PLLCTL_PLLEN) {
  337. bypass = 0;
  338. mult = __raw_readl(pll->base + PLLM);
  339. if (cpu_is_davinci_dm365())
  340. mult = 2 * (mult & PLLM_PLLM_MASK);
  341. else
  342. mult = (mult & PLLM_PLLM_MASK) + 1;
  343. } else
  344. bypass = 1;
  345. if (pll->flags & PLL_HAS_PREDIV) {
  346. prediv = __raw_readl(pll->base + PREDIV);
  347. if (prediv & PLLDIV_EN)
  348. prediv = (prediv & pll->div_ratio_mask) + 1;
  349. else
  350. prediv = 1;
  351. }
  352. /* pre-divider is fixed, but (some?) chips won't report that */
  353. if (cpu_is_davinci_dm355() && pll->num == 1)
  354. prediv = 8;
  355. if (pll->flags & PLL_HAS_POSTDIV) {
  356. postdiv = __raw_readl(pll->base + POSTDIV);
  357. if (postdiv & PLLDIV_EN)
  358. postdiv = (postdiv & pll->div_ratio_mask) + 1;
  359. else
  360. postdiv = 1;
  361. }
  362. if (!bypass) {
  363. rate /= prediv;
  364. rate *= mult;
  365. rate /= postdiv;
  366. }
  367. pr_debug("PLL%d: input = %lu MHz [ ",
  368. pll->num, clk->parent->rate / 1000000);
  369. if (bypass)
  370. pr_debug("bypass ");
  371. if (prediv > 1)
  372. pr_debug("/ %d ", prediv);
  373. if (mult > 1)
  374. pr_debug("* %d ", mult);
  375. if (postdiv > 1)
  376. pr_debug("/ %d ", postdiv);
  377. pr_debug("] --> %lu MHz output.\n", rate / 1000000);
  378. return rate;
  379. }
  380. /**
  381. * davinci_set_pllrate - set the output rate of a given PLL.
  382. *
  383. * Note: Currently tested to work with OMAP-L138 only.
  384. *
  385. * @pll: pll whose rate needs to be changed.
  386. * @prediv: The pre divider value. Passing 0 disables the pre-divider.
  387. * @pllm: The multiplier value. Passing 0 leads to multiply-by-one.
  388. * @postdiv: The post divider value. Passing 0 disables the post-divider.
  389. */
  390. int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
  391. unsigned int mult, unsigned int postdiv)
  392. {
  393. u32 ctrl;
  394. unsigned int locktime;
  395. unsigned long flags;
  396. if (pll->base == NULL)
  397. return -EINVAL;
  398. /*
  399. * PLL lock time required per OMAP-L138 datasheet is
  400. * (2000 * prediv)/sqrt(pllm) OSCIN cycles. We approximate sqrt(pllm)
  401. * as 4 and OSCIN cycle as 25 MHz.
  402. */
  403. if (prediv) {
  404. locktime = ((2000 * prediv) / 100);
  405. prediv = (prediv - 1) | PLLDIV_EN;
  406. } else {
  407. locktime = PLL_LOCK_TIME;
  408. }
  409. if (postdiv)
  410. postdiv = (postdiv - 1) | PLLDIV_EN;
  411. if (mult)
  412. mult = mult - 1;
  413. /* Protect against simultaneous calls to PLL setting seqeunce */
  414. spin_lock_irqsave(&clockfw_lock, flags);
  415. ctrl = __raw_readl(pll->base + PLLCTL);
  416. /* Switch the PLL to bypass mode */
  417. ctrl &= ~(PLLCTL_PLLENSRC | PLLCTL_PLLEN);
  418. __raw_writel(ctrl, pll->base + PLLCTL);
  419. udelay(PLL_BYPASS_TIME);
  420. /* Reset and enable PLL */
  421. ctrl &= ~(PLLCTL_PLLRST | PLLCTL_PLLDIS);
  422. __raw_writel(ctrl, pll->base + PLLCTL);
  423. if (pll->flags & PLL_HAS_PREDIV)
  424. __raw_writel(prediv, pll->base + PREDIV);
  425. __raw_writel(mult, pll->base + PLLM);
  426. if (pll->flags & PLL_HAS_POSTDIV)
  427. __raw_writel(postdiv, pll->base + POSTDIV);
  428. udelay(PLL_RESET_TIME);
  429. /* Bring PLL out of reset */
  430. ctrl |= PLLCTL_PLLRST;
  431. __raw_writel(ctrl, pll->base + PLLCTL);
  432. udelay(locktime);
  433. /* Remove PLL from bypass mode */
  434. ctrl |= PLLCTL_PLLEN;
  435. __raw_writel(ctrl, pll->base + PLLCTL);
  436. spin_unlock_irqrestore(&clockfw_lock, flags);
  437. return 0;
  438. }
  439. EXPORT_SYMBOL(davinci_set_pllrate);
  440. /**
  441. * davinci_set_refclk_rate() - Set the reference clock rate
  442. * @rate: The new rate.
  443. *
  444. * Sets the reference clock rate to a given value. This will most likely
  445. * result in the entire clock tree getting updated.
  446. *
  447. * This is used to support boards which use a reference clock different
  448. * than that used by default in <soc>.c file. The reference clock rate
  449. * should be updated early in the boot process; ideally soon after the
  450. * clock tree has been initialized once with the default reference clock
  451. * rate (davinci_common_init()).
  452. *
  453. * Returns 0 on success, error otherwise.
  454. */
  455. int davinci_set_refclk_rate(unsigned long rate)
  456. {
  457. struct clk *refclk;
  458. refclk = clk_get(NULL, "ref");
  459. if (IS_ERR(refclk)) {
  460. pr_err("%s: failed to get reference clock\n", __func__);
  461. return PTR_ERR(refclk);
  462. }
  463. clk_set_rate(refclk, rate);
  464. clk_put(refclk);
  465. return 0;
  466. }
  467. int __init davinci_clk_init(struct clk_lookup *clocks)
  468. {
  469. struct clk_lookup *c;
  470. struct clk *clk;
  471. size_t num_clocks = 0;
  472. for (c = clocks; c->clk; c++) {
  473. clk = c->clk;
  474. if (!clk->recalc) {
  475. /* Check if clock is a PLL */
  476. if (clk->pll_data)
  477. clk->recalc = clk_pllclk_recalc;
  478. /* Else, if it is a PLL-derived clock */
  479. else if (clk->flags & CLK_PLL)
  480. clk->recalc = clk_sysclk_recalc;
  481. /* Otherwise, it is a leaf clock (PSC clock) */
  482. else if (clk->parent)
  483. clk->recalc = clk_leafclk_recalc;
  484. }
  485. if (clk->pll_data) {
  486. struct pll_data *pll = clk->pll_data;
  487. if (!pll->div_ratio_mask)
  488. pll->div_ratio_mask = PLLDIV_RATIO_MASK;
  489. if (pll->phys_base && !pll->base) {
  490. pll->base = ioremap(pll->phys_base, SZ_4K);
  491. WARN_ON(!pll->base);
  492. }
  493. }
  494. if (clk->recalc)
  495. clk->rate = clk->recalc(clk);
  496. if (clk->lpsc)
  497. clk->flags |= CLK_PSC;
  498. if (clk->flags & PSC_LRST)
  499. clk->reset = davinci_clk_reset;
  500. clk_register(clk);
  501. num_clocks++;
  502. /* Turn on clocks that Linux doesn't otherwise manage */
  503. if (clk->flags & ALWAYS_ENABLED)
  504. clk_enable(clk);
  505. }
  506. clkdev_add_table(clocks, num_clocks);
  507. return 0;
  508. }
  509. #ifdef CONFIG_DEBUG_FS
  510. #include <linux/debugfs.h>
  511. #include <linux/seq_file.h>
  512. #define CLKNAME_MAX 10 /* longest clock name */
  513. #define NEST_DELTA 2
  514. #define NEST_MAX 4
  515. static void
  516. dump_clock(struct seq_file *s, unsigned nest, struct clk *parent)
  517. {
  518. char *state;
  519. char buf[CLKNAME_MAX + NEST_DELTA * NEST_MAX];
  520. struct clk *clk;
  521. unsigned i;
  522. if (parent->flags & CLK_PLL)
  523. state = "pll";
  524. else if (parent->flags & CLK_PSC)
  525. state = "psc";
  526. else
  527. state = "";
  528. /* <nest spaces> name <pad to end> */
  529. memset(buf, ' ', sizeof(buf) - 1);
  530. buf[sizeof(buf) - 1] = 0;
  531. i = strlen(parent->name);
  532. memcpy(buf + nest, parent->name,
  533. min(i, (unsigned)(sizeof(buf) - 1 - nest)));
  534. seq_printf(s, "%s users=%2d %-3s %9ld Hz\n",
  535. buf, parent->usecount, state, clk_get_rate(parent));
  536. /* REVISIT show device associations too */
  537. /* cost is now small, but not linear... */
  538. list_for_each_entry(clk, &parent->children, childnode) {
  539. dump_clock(s, nest + NEST_DELTA, clk);
  540. }
  541. }
  542. static int davinci_ck_show(struct seq_file *m, void *v)
  543. {
  544. struct clk *clk;
  545. /*
  546. * Show clock tree; We trust nonzero usecounts equate to PSC enables...
  547. */
  548. mutex_lock(&clocks_mutex);
  549. list_for_each_entry(clk, &clocks, node)
  550. if (!clk->parent)
  551. dump_clock(m, 0, clk);
  552. mutex_unlock(&clocks_mutex);
  553. return 0;
  554. }
  555. static int davinci_ck_open(struct inode *inode, struct file *file)
  556. {
  557. return single_open(file, davinci_ck_show, NULL);
  558. }
  559. static const struct file_operations davinci_ck_operations = {
  560. .open = davinci_ck_open,
  561. .read = seq_read,
  562. .llseek = seq_lseek,
  563. .release = single_release,
  564. };
  565. static int __init davinci_clk_debugfs_init(void)
  566. {
  567. debugfs_create_file("davinci_clocks", S_IFREG | S_IRUGO, NULL, NULL,
  568. &davinci_ck_operations);
  569. return 0;
  570. }
  571. device_initcall(davinci_clk_debugfs_init);
  572. #endif /* CONFIG_DEBUG_FS */