fapll.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. #include <linux/clk.h>
  3. #include <linux/clk-provider.h>
  4. #include <linux/delay.h>
  5. #include <linux/err.h>
  6. #include <linux/io.h>
  7. #include <linux/math64.h>
  8. #include <linux/of.h>
  9. #include <linux/of_address.h>
  10. #include <linux/clk/ti.h>
  11. #include "clock.h"
  12. /* FAPLL Control Register PLL_CTRL */
  13. #define FAPLL_MAIN_MULT_N_SHIFT 16
  14. #define FAPLL_MAIN_DIV_P_SHIFT 8
  15. #define FAPLL_MAIN_LOCK BIT(7)
  16. #define FAPLL_MAIN_PLLEN BIT(3)
  17. #define FAPLL_MAIN_BP BIT(2)
  18. #define FAPLL_MAIN_LOC_CTL BIT(0)
  19. #define FAPLL_MAIN_MAX_MULT_N 0xffff
  20. #define FAPLL_MAIN_MAX_DIV_P 0xff
  21. #define FAPLL_MAIN_CLEAR_MASK \
  22. ((FAPLL_MAIN_MAX_MULT_N << FAPLL_MAIN_MULT_N_SHIFT) | \
  23. (FAPLL_MAIN_DIV_P_SHIFT << FAPLL_MAIN_DIV_P_SHIFT) | \
  24. FAPLL_MAIN_LOC_CTL)
  25. /* FAPLL powerdown register PWD */
  26. #define FAPLL_PWD_OFFSET 4
  27. #define MAX_FAPLL_OUTPUTS 7
  28. #define FAPLL_MAX_RETRIES 1000
  29. #define to_fapll(_hw) container_of(_hw, struct fapll_data, hw)
  30. #define to_synth(_hw) container_of(_hw, struct fapll_synth, hw)
  31. /* The bypass bit is inverted on the ddr_pll.. */
  32. #define fapll_is_ddr_pll(va) (((u32)(va) & 0xffff) == 0x0440)
  33. /*
  34. * The audio_pll_clk1 input is hard wired to the 27MHz bypass clock,
  35. * and the audio_pll_clk1 synthesizer is hardwared to 32KiHz output.
  36. */
  37. #define is_ddr_pll_clk1(va) (((u32)(va) & 0xffff) == 0x044c)
  38. #define is_audio_pll_clk1(va) (((u32)(va) & 0xffff) == 0x04a8)
  39. /* Synthesizer divider register */
  40. #define SYNTH_LDMDIV1 BIT(8)
  41. /* Synthesizer frequency register */
  42. #define SYNTH_LDFREQ BIT(31)
  43. #define SYNTH_PHASE_K 8
  44. #define SYNTH_MAX_INT_DIV 0xf
  45. #define SYNTH_MAX_DIV_M 0xff
  46. struct fapll_data {
  47. struct clk_hw hw;
  48. void __iomem *base;
  49. const char *name;
  50. struct clk *clk_ref;
  51. struct clk *clk_bypass;
  52. struct clk_onecell_data outputs;
  53. bool bypass_bit_inverted;
  54. };
  55. struct fapll_synth {
  56. struct clk_hw hw;
  57. struct fapll_data *fd;
  58. int index;
  59. void __iomem *freq;
  60. void __iomem *div;
  61. const char *name;
  62. struct clk *clk_pll;
  63. };
  64. static bool ti_fapll_clock_is_bypass(struct fapll_data *fd)
  65. {
  66. u32 v = readl_relaxed(fd->base);
  67. if (fd->bypass_bit_inverted)
  68. return !(v & FAPLL_MAIN_BP);
  69. else
  70. return !!(v & FAPLL_MAIN_BP);
  71. }
  72. static void ti_fapll_set_bypass(struct fapll_data *fd)
  73. {
  74. u32 v = readl_relaxed(fd->base);
  75. if (fd->bypass_bit_inverted)
  76. v &= ~FAPLL_MAIN_BP;
  77. else
  78. v |= FAPLL_MAIN_BP;
  79. writel_relaxed(v, fd->base);
  80. }
  81. static void ti_fapll_clear_bypass(struct fapll_data *fd)
  82. {
  83. u32 v = readl_relaxed(fd->base);
  84. if (fd->bypass_bit_inverted)
  85. v |= FAPLL_MAIN_BP;
  86. else
  87. v &= ~FAPLL_MAIN_BP;
  88. writel_relaxed(v, fd->base);
  89. }
  90. static int ti_fapll_wait_lock(struct fapll_data *fd)
  91. {
  92. int retries = FAPLL_MAX_RETRIES;
  93. u32 v;
  94. while ((v = readl_relaxed(fd->base))) {
  95. if (v & FAPLL_MAIN_LOCK)
  96. return 0;
  97. if (retries-- <= 0)
  98. break;
  99. udelay(1);
  100. }
  101. pr_err("%s failed to lock\n", fd->name);
  102. return -ETIMEDOUT;
  103. }
  104. static int ti_fapll_enable(struct clk_hw *hw)
  105. {
  106. struct fapll_data *fd = to_fapll(hw);
  107. u32 v = readl_relaxed(fd->base);
  108. v |= FAPLL_MAIN_PLLEN;
  109. writel_relaxed(v, fd->base);
  110. ti_fapll_wait_lock(fd);
  111. return 0;
  112. }
  113. static void ti_fapll_disable(struct clk_hw *hw)
  114. {
  115. struct fapll_data *fd = to_fapll(hw);
  116. u32 v = readl_relaxed(fd->base);
  117. v &= ~FAPLL_MAIN_PLLEN;
  118. writel_relaxed(v, fd->base);
  119. }
  120. static int ti_fapll_is_enabled(struct clk_hw *hw)
  121. {
  122. struct fapll_data *fd = to_fapll(hw);
  123. u32 v = readl_relaxed(fd->base);
  124. return v & FAPLL_MAIN_PLLEN;
  125. }
  126. static unsigned long ti_fapll_recalc_rate(struct clk_hw *hw,
  127. unsigned long parent_rate)
  128. {
  129. struct fapll_data *fd = to_fapll(hw);
  130. u32 fapll_n, fapll_p, v;
  131. u64 rate;
  132. if (ti_fapll_clock_is_bypass(fd))
  133. return parent_rate;
  134. rate = parent_rate;
  135. /* PLL pre-divider is P and multiplier is N */
  136. v = readl_relaxed(fd->base);
  137. fapll_p = (v >> 8) & 0xff;
  138. if (fapll_p)
  139. do_div(rate, fapll_p);
  140. fapll_n = v >> 16;
  141. if (fapll_n)
  142. rate *= fapll_n;
  143. return rate;
  144. }
  145. static u8 ti_fapll_get_parent(struct clk_hw *hw)
  146. {
  147. struct fapll_data *fd = to_fapll(hw);
  148. if (ti_fapll_clock_is_bypass(fd))
  149. return 1;
  150. return 0;
  151. }
  152. static int ti_fapll_set_div_mult(unsigned long rate,
  153. unsigned long parent_rate,
  154. u32 *pre_div_p, u32 *mult_n)
  155. {
  156. /*
  157. * So far no luck getting decent clock with PLL divider,
  158. * PLL does not seem to lock and the signal does not look
  159. * right. It seems the divider can only be used together
  160. * with the multiplier?
  161. */
  162. if (rate < parent_rate) {
  163. pr_warn("FAPLL main divider rates unsupported\n");
  164. return -EINVAL;
  165. }
  166. *mult_n = rate / parent_rate;
  167. if (*mult_n > FAPLL_MAIN_MAX_MULT_N)
  168. return -EINVAL;
  169. *pre_div_p = 1;
  170. return 0;
  171. }
  172. static long ti_fapll_round_rate(struct clk_hw *hw, unsigned long rate,
  173. unsigned long *parent_rate)
  174. {
  175. u32 pre_div_p, mult_n;
  176. int error;
  177. if (!rate)
  178. return -EINVAL;
  179. error = ti_fapll_set_div_mult(rate, *parent_rate,
  180. &pre_div_p, &mult_n);
  181. if (error)
  182. return error;
  183. rate = *parent_rate / pre_div_p;
  184. rate *= mult_n;
  185. return rate;
  186. }
  187. static int ti_fapll_set_rate(struct clk_hw *hw, unsigned long rate,
  188. unsigned long parent_rate)
  189. {
  190. struct fapll_data *fd = to_fapll(hw);
  191. u32 pre_div_p, mult_n, v;
  192. int error;
  193. if (!rate)
  194. return -EINVAL;
  195. error = ti_fapll_set_div_mult(rate, parent_rate,
  196. &pre_div_p, &mult_n);
  197. if (error)
  198. return error;
  199. ti_fapll_set_bypass(fd);
  200. v = readl_relaxed(fd->base);
  201. v &= ~FAPLL_MAIN_CLEAR_MASK;
  202. v |= pre_div_p << FAPLL_MAIN_DIV_P_SHIFT;
  203. v |= mult_n << FAPLL_MAIN_MULT_N_SHIFT;
  204. writel_relaxed(v, fd->base);
  205. if (ti_fapll_is_enabled(hw))
  206. ti_fapll_wait_lock(fd);
  207. ti_fapll_clear_bypass(fd);
  208. return 0;
  209. }
  210. static const struct clk_ops ti_fapll_ops = {
  211. .enable = ti_fapll_enable,
  212. .disable = ti_fapll_disable,
  213. .is_enabled = ti_fapll_is_enabled,
  214. .recalc_rate = ti_fapll_recalc_rate,
  215. .get_parent = ti_fapll_get_parent,
  216. .round_rate = ti_fapll_round_rate,
  217. .set_rate = ti_fapll_set_rate,
  218. };
  219. static int ti_fapll_synth_enable(struct clk_hw *hw)
  220. {
  221. struct fapll_synth *synth = to_synth(hw);
  222. u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET);
  223. v &= ~(1 << synth->index);
  224. writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET);
  225. return 0;
  226. }
  227. static void ti_fapll_synth_disable(struct clk_hw *hw)
  228. {
  229. struct fapll_synth *synth = to_synth(hw);
  230. u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET);
  231. v |= 1 << synth->index;
  232. writel_relaxed(v, synth->fd->base + FAPLL_PWD_OFFSET);
  233. }
  234. static int ti_fapll_synth_is_enabled(struct clk_hw *hw)
  235. {
  236. struct fapll_synth *synth = to_synth(hw);
  237. u32 v = readl_relaxed(synth->fd->base + FAPLL_PWD_OFFSET);
  238. return !(v & (1 << synth->index));
  239. }
  240. /*
  241. * See dm816x TRM chapter 1.10.3 Flying Adder PLL fore more info
  242. */
  243. static unsigned long ti_fapll_synth_recalc_rate(struct clk_hw *hw,
  244. unsigned long parent_rate)
  245. {
  246. struct fapll_synth *synth = to_synth(hw);
  247. u32 synth_div_m;
  248. u64 rate;
  249. /* The audio_pll_clk1 is hardwired to produce 32.768KiHz clock */
  250. if (!synth->div)
  251. return 32768;
  252. /*
  253. * PLL in bypass sets the synths in bypass mode too. The PLL rate
  254. * can be also be set to 27MHz, so we can't use parent_rate to
  255. * check for bypass mode.
  256. */
  257. if (ti_fapll_clock_is_bypass(synth->fd))
  258. return parent_rate;
  259. rate = parent_rate;
  260. /*
  261. * Synth frequency integer and fractional divider.
  262. * Note that the phase output K is 8, so the result needs
  263. * to be multiplied by SYNTH_PHASE_K.
  264. */
  265. if (synth->freq) {
  266. u32 v, synth_int_div, synth_frac_div, synth_div_freq;
  267. v = readl_relaxed(synth->freq);
  268. synth_int_div = (v >> 24) & 0xf;
  269. synth_frac_div = v & 0xffffff;
  270. synth_div_freq = (synth_int_div * 10000000) + synth_frac_div;
  271. rate *= 10000000;
  272. do_div(rate, synth_div_freq);
  273. rate *= SYNTH_PHASE_K;
  274. }
  275. /* Synth post-divider M */
  276. synth_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M;
  277. return DIV_ROUND_UP_ULL(rate, synth_div_m);
  278. }
  279. static unsigned long ti_fapll_synth_get_frac_rate(struct clk_hw *hw,
  280. unsigned long parent_rate)
  281. {
  282. struct fapll_synth *synth = to_synth(hw);
  283. unsigned long current_rate, frac_rate;
  284. u32 post_div_m;
  285. current_rate = ti_fapll_synth_recalc_rate(hw, parent_rate);
  286. post_div_m = readl_relaxed(synth->div) & SYNTH_MAX_DIV_M;
  287. frac_rate = current_rate * post_div_m;
  288. return frac_rate;
  289. }
  290. static u32 ti_fapll_synth_set_frac_rate(struct fapll_synth *synth,
  291. unsigned long rate,
  292. unsigned long parent_rate)
  293. {
  294. u32 post_div_m, synth_int_div = 0, synth_frac_div = 0, v;
  295. post_div_m = DIV_ROUND_UP_ULL((u64)parent_rate * SYNTH_PHASE_K, rate);
  296. post_div_m = post_div_m / SYNTH_MAX_INT_DIV;
  297. if (post_div_m > SYNTH_MAX_DIV_M)
  298. return -EINVAL;
  299. if (!post_div_m)
  300. post_div_m = 1;
  301. for (; post_div_m < SYNTH_MAX_DIV_M; post_div_m++) {
  302. synth_int_div = DIV_ROUND_UP_ULL((u64)parent_rate *
  303. SYNTH_PHASE_K *
  304. 10000000,
  305. rate * post_div_m);
  306. synth_frac_div = synth_int_div % 10000000;
  307. synth_int_div /= 10000000;
  308. if (synth_int_div <= SYNTH_MAX_INT_DIV)
  309. break;
  310. }
  311. if (synth_int_div > SYNTH_MAX_INT_DIV)
  312. return -EINVAL;
  313. v = readl_relaxed(synth->freq);
  314. v &= ~0x1fffffff;
  315. v |= (synth_int_div & SYNTH_MAX_INT_DIV) << 24;
  316. v |= (synth_frac_div & 0xffffff);
  317. v |= SYNTH_LDFREQ;
  318. writel_relaxed(v, synth->freq);
  319. return post_div_m;
  320. }
  321. static long ti_fapll_synth_round_rate(struct clk_hw *hw, unsigned long rate,
  322. unsigned long *parent_rate)
  323. {
  324. struct fapll_synth *synth = to_synth(hw);
  325. struct fapll_data *fd = synth->fd;
  326. unsigned long r;
  327. if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate)
  328. return -EINVAL;
  329. /* Only post divider m available with no fractional divider? */
  330. if (!synth->freq) {
  331. unsigned long frac_rate;
  332. u32 synth_post_div_m;
  333. frac_rate = ti_fapll_synth_get_frac_rate(hw, *parent_rate);
  334. synth_post_div_m = DIV_ROUND_UP(frac_rate, rate);
  335. r = DIV_ROUND_UP(frac_rate, synth_post_div_m);
  336. goto out;
  337. }
  338. r = *parent_rate * SYNTH_PHASE_K;
  339. if (rate > r)
  340. goto out;
  341. r = DIV_ROUND_UP_ULL(r, SYNTH_MAX_INT_DIV * SYNTH_MAX_DIV_M);
  342. if (rate < r)
  343. goto out;
  344. r = rate;
  345. out:
  346. return r;
  347. }
  348. static int ti_fapll_synth_set_rate(struct clk_hw *hw, unsigned long rate,
  349. unsigned long parent_rate)
  350. {
  351. struct fapll_synth *synth = to_synth(hw);
  352. struct fapll_data *fd = synth->fd;
  353. unsigned long frac_rate, post_rate = 0;
  354. u32 post_div_m = 0, v;
  355. if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate)
  356. return -EINVAL;
  357. /* Produce the rate with just post divider M? */
  358. frac_rate = ti_fapll_synth_get_frac_rate(hw, parent_rate);
  359. if (frac_rate < rate) {
  360. if (!synth->freq)
  361. return -EINVAL;
  362. } else {
  363. post_div_m = DIV_ROUND_UP(frac_rate, rate);
  364. if (post_div_m && (post_div_m <= SYNTH_MAX_DIV_M))
  365. post_rate = DIV_ROUND_UP(frac_rate, post_div_m);
  366. if (!synth->freq && !post_rate)
  367. return -EINVAL;
  368. }
  369. /* Need to recalculate the fractional divider? */
  370. if ((post_rate != rate) && synth->freq)
  371. post_div_m = ti_fapll_synth_set_frac_rate(synth,
  372. rate,
  373. parent_rate);
  374. v = readl_relaxed(synth->div);
  375. v &= ~SYNTH_MAX_DIV_M;
  376. v |= post_div_m;
  377. v |= SYNTH_LDMDIV1;
  378. writel_relaxed(v, synth->div);
  379. return 0;
  380. }
  381. static const struct clk_ops ti_fapll_synt_ops = {
  382. .enable = ti_fapll_synth_enable,
  383. .disable = ti_fapll_synth_disable,
  384. .is_enabled = ti_fapll_synth_is_enabled,
  385. .recalc_rate = ti_fapll_synth_recalc_rate,
  386. .round_rate = ti_fapll_synth_round_rate,
  387. .set_rate = ti_fapll_synth_set_rate,
  388. };
  389. static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,
  390. void __iomem *freq,
  391. void __iomem *div,
  392. int index,
  393. const char *name,
  394. const char *parent,
  395. struct clk *pll_clk)
  396. {
  397. struct clk_init_data *init;
  398. struct fapll_synth *synth;
  399. struct clk *clk = ERR_PTR(-ENOMEM);
  400. init = kzalloc(sizeof(*init), GFP_KERNEL);
  401. if (!init)
  402. return ERR_PTR(-ENOMEM);
  403. init->ops = &ti_fapll_synt_ops;
  404. init->name = name;
  405. init->parent_names = &parent;
  406. init->num_parents = 1;
  407. synth = kzalloc(sizeof(*synth), GFP_KERNEL);
  408. if (!synth)
  409. goto free;
  410. synth->fd = fd;
  411. synth->index = index;
  412. synth->freq = freq;
  413. synth->div = div;
  414. synth->name = name;
  415. synth->hw.init = init;
  416. synth->clk_pll = pll_clk;
  417. clk = clk_register(NULL, &synth->hw);
  418. if (IS_ERR(clk)) {
  419. pr_err("failed to register clock\n");
  420. goto free;
  421. }
  422. return clk;
  423. free:
  424. kfree(synth);
  425. kfree(init);
  426. return clk;
  427. }
  428. static void __init ti_fapll_setup(struct device_node *node)
  429. {
  430. struct fapll_data *fd;
  431. struct clk_init_data *init = NULL;
  432. const char *parent_name[2];
  433. struct clk *pll_clk;
  434. const char *name;
  435. int i;
  436. fd = kzalloc(sizeof(*fd), GFP_KERNEL);
  437. if (!fd)
  438. return;
  439. fd->outputs.clks = kzalloc(sizeof(struct clk *) *
  440. MAX_FAPLL_OUTPUTS + 1,
  441. GFP_KERNEL);
  442. if (!fd->outputs.clks)
  443. goto free;
  444. init = kzalloc(sizeof(*init), GFP_KERNEL);
  445. if (!init)
  446. goto free;
  447. init->ops = &ti_fapll_ops;
  448. name = ti_dt_clk_name(node);
  449. init->name = name;
  450. init->num_parents = of_clk_get_parent_count(node);
  451. if (init->num_parents != 2) {
  452. pr_err("%pOFn must have two parents\n", node);
  453. goto free;
  454. }
  455. of_clk_parent_fill(node, parent_name, 2);
  456. init->parent_names = parent_name;
  457. fd->clk_ref = of_clk_get(node, 0);
  458. if (IS_ERR(fd->clk_ref)) {
  459. pr_err("%pOFn could not get clk_ref\n", node);
  460. goto free;
  461. }
  462. fd->clk_bypass = of_clk_get(node, 1);
  463. if (IS_ERR(fd->clk_bypass)) {
  464. pr_err("%pOFn could not get clk_bypass\n", node);
  465. goto free;
  466. }
  467. fd->base = of_iomap(node, 0);
  468. if (!fd->base) {
  469. pr_err("%pOFn could not get IO base\n", node);
  470. goto free;
  471. }
  472. if (fapll_is_ddr_pll(fd->base))
  473. fd->bypass_bit_inverted = true;
  474. fd->name = name;
  475. fd->hw.init = init;
  476. /* Register the parent PLL */
  477. pll_clk = clk_register(NULL, &fd->hw);
  478. if (IS_ERR(pll_clk))
  479. goto unmap;
  480. fd->outputs.clks[0] = pll_clk;
  481. fd->outputs.clk_num++;
  482. /*
  483. * Set up the child synthesizers starting at index 1 as the
  484. * PLL output is at index 0. We need to check the clock-indices
  485. * for numbering in case there are holes in the synth mapping,
  486. * and then probe the synth register to see if it has a FREQ
  487. * register available.
  488. */
  489. for (i = 0; i < MAX_FAPLL_OUTPUTS; i++) {
  490. const char *output_name;
  491. void __iomem *freq, *div;
  492. struct clk *synth_clk;
  493. int output_instance;
  494. u32 v;
  495. if (of_property_read_string_index(node, "clock-output-names",
  496. i, &output_name))
  497. continue;
  498. if (of_property_read_u32_index(node, "clock-indices", i,
  499. &output_instance))
  500. output_instance = i;
  501. freq = fd->base + (output_instance * 8);
  502. div = freq + 4;
  503. /* Check for hardwired audio_pll_clk1 */
  504. if (is_audio_pll_clk1(freq)) {
  505. freq = NULL;
  506. div = NULL;
  507. } else {
  508. /* Does the synthesizer have a FREQ register? */
  509. v = readl_relaxed(freq);
  510. if (!v)
  511. freq = NULL;
  512. }
  513. synth_clk = ti_fapll_synth_setup(fd, freq, div, output_instance,
  514. output_name, name, pll_clk);
  515. if (IS_ERR(synth_clk))
  516. continue;
  517. fd->outputs.clks[output_instance] = synth_clk;
  518. fd->outputs.clk_num++;
  519. clk_register_clkdev(synth_clk, output_name, NULL);
  520. }
  521. /* Register the child synthesizers as the FAPLL outputs */
  522. of_clk_add_provider(node, of_clk_src_onecell_get, &fd->outputs);
  523. /* Add clock alias for the outputs */
  524. kfree(init);
  525. return;
  526. unmap:
  527. iounmap(fd->base);
  528. free:
  529. if (fd->clk_bypass)
  530. clk_put(fd->clk_bypass);
  531. if (fd->clk_ref)
  532. clk_put(fd->clk_ref);
  533. kfree(fd->outputs.clks);
  534. kfree(fd);
  535. kfree(init);
  536. }
  537. CLK_OF_DECLARE(ti_fapll_clock, "ti,dm816-fapll-clock", ti_fapll_setup);