clock.c 15 KB

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