clk.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __TEGRA_CLK_H
  17. #define __TEGRA_CLK_H
  18. #include <linux/clk-provider.h>
  19. #include <linux/clkdev.h>
  20. /**
  21. * struct tegra_clk_sync_source - external clock source from codec
  22. *
  23. * @hw: handle between common and hardware-specific interfaces
  24. * @rate: input frequency from source
  25. * @max_rate: max rate allowed
  26. */
  27. struct tegra_clk_sync_source {
  28. struct clk_hw hw;
  29. unsigned long rate;
  30. unsigned long max_rate;
  31. };
  32. #define to_clk_sync_source(_hw) \
  33. container_of(_hw, struct tegra_clk_sync_source, hw)
  34. extern const struct clk_ops tegra_clk_sync_source_ops;
  35. struct clk *tegra_clk_register_sync_source(const char *name,
  36. unsigned long fixed_rate, unsigned long max_rate);
  37. /**
  38. * struct tegra_clk_frac_div - fractional divider clock
  39. *
  40. * @hw: handle between common and hardware-specific interfaces
  41. * @reg: register containing divider
  42. * @flags: hardware-specific flags
  43. * @shift: shift to the divider bit field
  44. * @width: width of the divider bit field
  45. * @frac_width: width of the fractional bit field
  46. * @lock: register lock
  47. *
  48. * Flags:
  49. * TEGRA_DIVIDER_ROUND_UP - This flags indicates to round up the divider value.
  50. * TEGRA_DIVIDER_FIXED - Fixed rate PLL dividers has addition override bit, this
  51. * flag indicates that this divider is for fixed rate PLL.
  52. * TEGRA_DIVIDER_INT - Some modules can not cope with the duty cycle when
  53. * fraction bit is set. This flags indicates to calculate divider for which
  54. * fracton bit will be zero.
  55. * TEGRA_DIVIDER_UART - UART module divider has additional enable bit which is
  56. * set when divider value is not 0. This flags indicates that the divider
  57. * is for UART module.
  58. */
  59. struct tegra_clk_frac_div {
  60. struct clk_hw hw;
  61. void __iomem *reg;
  62. u8 flags;
  63. u8 shift;
  64. u8 width;
  65. u8 frac_width;
  66. spinlock_t *lock;
  67. };
  68. #define to_clk_frac_div(_hw) container_of(_hw, struct tegra_clk_frac_div, hw)
  69. #define TEGRA_DIVIDER_ROUND_UP BIT(0)
  70. #define TEGRA_DIVIDER_FIXED BIT(1)
  71. #define TEGRA_DIVIDER_INT BIT(2)
  72. #define TEGRA_DIVIDER_UART BIT(3)
  73. extern const struct clk_ops tegra_clk_frac_div_ops;
  74. struct clk *tegra_clk_register_divider(const char *name,
  75. const char *parent_name, void __iomem *reg,
  76. unsigned long flags, u8 clk_divider_flags, u8 shift, u8 width,
  77. u8 frac_width, spinlock_t *lock);
  78. /*
  79. * Tegra PLL:
  80. *
  81. * In general, there are 3 requirements for each PLL
  82. * that SW needs to be comply with.
  83. * (1) Input frequency range (REF).
  84. * (2) Comparison frequency range (CF). CF = REF/DIVM.
  85. * (3) VCO frequency range (VCO). VCO = CF * DIVN.
  86. *
  87. * The final PLL output frequency (FO) = VCO >> DIVP.
  88. */
  89. /**
  90. * struct tegra_clk_pll_freq_table - PLL frequecy table
  91. *
  92. * @input_rate: input rate from source
  93. * @output_rate: output rate from PLL for the input rate
  94. * @n: feedback divider
  95. * @m: input divider
  96. * @p: post divider
  97. * @cpcon: charge pump current
  98. */
  99. struct tegra_clk_pll_freq_table {
  100. unsigned long input_rate;
  101. unsigned long output_rate;
  102. u16 n;
  103. u16 m;
  104. u8 p;
  105. u8 cpcon;
  106. };
  107. /**
  108. * struct pdiv_map - map post divider to hw value
  109. *
  110. * @pdiv: post divider
  111. * @hw_val: value to be written to the PLL hw
  112. */
  113. struct pdiv_map {
  114. u8 pdiv;
  115. u8 hw_val;
  116. };
  117. /**
  118. * struct clk_pll_params - PLL parameters
  119. *
  120. * @input_min: Minimum input frequency
  121. * @input_max: Maximum input frequency
  122. * @cf_min: Minimum comparison frequency
  123. * @cf_max: Maximum comparison frequency
  124. * @vco_min: Minimum VCO frequency
  125. * @vco_max: Maximum VCO frequency
  126. * @base_reg: PLL base reg offset
  127. * @misc_reg: PLL misc reg offset
  128. * @lock_reg: PLL lock reg offset
  129. * @lock_bit_idx: Bit index for PLL lock status
  130. * @lock_enable_bit_idx: Bit index to enable PLL lock
  131. * @lock_delay: Delay in us if PLL lock is not used
  132. */
  133. struct tegra_clk_pll_params {
  134. unsigned long input_min;
  135. unsigned long input_max;
  136. unsigned long cf_min;
  137. unsigned long cf_max;
  138. unsigned long vco_min;
  139. unsigned long vco_max;
  140. u32 base_reg;
  141. u32 misc_reg;
  142. u32 lock_reg;
  143. u32 lock_mask;
  144. u32 lock_enable_bit_idx;
  145. u32 iddq_reg;
  146. u32 iddq_bit_idx;
  147. u32 aux_reg;
  148. u32 dyn_ramp_reg;
  149. u32 ext_misc_reg[3];
  150. int stepa_shift;
  151. int stepb_shift;
  152. int lock_delay;
  153. int max_p;
  154. struct pdiv_map *pdiv_tohw;
  155. };
  156. /**
  157. * struct tegra_clk_pll - Tegra PLL clock
  158. *
  159. * @hw: handle between common and hardware-specifix interfaces
  160. * @clk_base: address of CAR controller
  161. * @pmc: address of PMC, required to read override bits
  162. * @freq_table: array of frequencies supported by PLL
  163. * @params: PLL parameters
  164. * @flags: PLL flags
  165. * @fixed_rate: PLL rate if it is fixed
  166. * @lock: register lock
  167. * @divn_shift: shift to the feedback divider bit field
  168. * @divn_width: width of the feedback divider bit field
  169. * @divm_shift: shift to the input divider bit field
  170. * @divm_width: width of the input divider bit field
  171. * @divp_shift: shift to the post divider bit field
  172. * @divp_width: width of the post divider bit field
  173. *
  174. * Flags:
  175. * TEGRA_PLL_USE_LOCK - This flag indicated to use lock bits for
  176. * PLL locking. If not set it will use lock_delay value to wait.
  177. * TEGRA_PLL_HAS_CPCON - This flag indicates that CPCON value needs
  178. * to be programmed to change output frequency of the PLL.
  179. * TEGRA_PLL_SET_LFCON - This flag indicates that LFCON value needs
  180. * to be programmed to change output frequency of the PLL.
  181. * TEGRA_PLL_SET_DCCON - This flag indicates that DCCON value needs
  182. * to be programmed to change output frequency of the PLL.
  183. * TEGRA_PLLU - PLLU has inverted post divider. This flags indicated
  184. * that it is PLLU and invert post divider value.
  185. * TEGRA_PLLM - PLLM has additional override settings in PMC. This
  186. * flag indicates that it is PLLM and use override settings.
  187. * TEGRA_PLL_FIXED - We are not supposed to change output frequency
  188. * of some plls.
  189. * TEGRA_PLLE_CONFIGURE - Configure PLLE when enabling.
  190. * TEGRA_PLL_LOCK_MISC - Lock bit is in the misc register instead of the
  191. * base register.
  192. * TEGRA_PLL_BYPASS - PLL has bypass bit
  193. * TEGRA_PLL_HAS_LOCK_ENABLE - PLL has bit to enable lock monitoring
  194. */
  195. struct tegra_clk_pll {
  196. struct clk_hw hw;
  197. void __iomem *clk_base;
  198. void __iomem *pmc;
  199. u32 flags;
  200. unsigned long fixed_rate;
  201. spinlock_t *lock;
  202. u8 divn_shift;
  203. u8 divn_width;
  204. u8 divm_shift;
  205. u8 divm_width;
  206. u8 divp_shift;
  207. u8 divp_width;
  208. struct tegra_clk_pll_freq_table *freq_table;
  209. struct tegra_clk_pll_params *params;
  210. };
  211. #define to_clk_pll(_hw) container_of(_hw, struct tegra_clk_pll, hw)
  212. #define TEGRA_PLL_USE_LOCK BIT(0)
  213. #define TEGRA_PLL_HAS_CPCON BIT(1)
  214. #define TEGRA_PLL_SET_LFCON BIT(2)
  215. #define TEGRA_PLL_SET_DCCON BIT(3)
  216. #define TEGRA_PLLU BIT(4)
  217. #define TEGRA_PLLM BIT(5)
  218. #define TEGRA_PLL_FIXED BIT(6)
  219. #define TEGRA_PLLE_CONFIGURE BIT(7)
  220. #define TEGRA_PLL_LOCK_MISC BIT(8)
  221. #define TEGRA_PLL_BYPASS BIT(9)
  222. #define TEGRA_PLL_HAS_LOCK_ENABLE BIT(10)
  223. extern const struct clk_ops tegra_clk_pll_ops;
  224. extern const struct clk_ops tegra_clk_plle_ops;
  225. struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
  226. void __iomem *clk_base, void __iomem *pmc,
  227. unsigned long flags, unsigned long fixed_rate,
  228. struct tegra_clk_pll_params *pll_params, u32 pll_flags,
  229. struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock);
  230. struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
  231. void __iomem *clk_base, void __iomem *pmc,
  232. unsigned long flags, unsigned long fixed_rate,
  233. struct tegra_clk_pll_params *pll_params, u32 pll_flags,
  234. struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock);
  235. struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
  236. void __iomem *clk_base, void __iomem *pmc,
  237. unsigned long flags, unsigned long fixed_rate,
  238. struct tegra_clk_pll_params *pll_params,
  239. u32 pll_flags,
  240. struct tegra_clk_pll_freq_table *freq_table,
  241. spinlock_t *lock);
  242. struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
  243. void __iomem *clk_base, void __iomem *pmc,
  244. unsigned long flags, unsigned long fixed_rate,
  245. struct tegra_clk_pll_params *pll_params,
  246. u32 pll_flags,
  247. struct tegra_clk_pll_freq_table *freq_table,
  248. spinlock_t *lock);
  249. struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
  250. void __iomem *clk_base, void __iomem *pmc,
  251. unsigned long flags, unsigned long fixed_rate,
  252. struct tegra_clk_pll_params *pll_params,
  253. u32 pll_flags,
  254. struct tegra_clk_pll_freq_table *freq_table,
  255. spinlock_t *lock);
  256. struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
  257. void __iomem *clk_base, void __iomem *pmc,
  258. unsigned long flags, unsigned long fixed_rate,
  259. struct tegra_clk_pll_params *pll_params,
  260. u32 pll_flags,
  261. struct tegra_clk_pll_freq_table *freq_table,
  262. spinlock_t *lock, unsigned long parent_rate);
  263. struct clk *tegra_clk_register_plle_tegra114(const char *name,
  264. const char *parent_name,
  265. void __iomem *clk_base, unsigned long flags,
  266. unsigned long fixed_rate,
  267. struct tegra_clk_pll_params *pll_params,
  268. struct tegra_clk_pll_freq_table *freq_table,
  269. spinlock_t *lock);
  270. /**
  271. * struct tegra_clk_pll_out - PLL divider down clock
  272. *
  273. * @hw: handle between common and hardware-specific interfaces
  274. * @reg: register containing the PLL divider
  275. * @enb_bit_idx: bit to enable/disable PLL divider
  276. * @rst_bit_idx: bit to reset PLL divider
  277. * @lock: register lock
  278. * @flags: hardware-specific flags
  279. */
  280. struct tegra_clk_pll_out {
  281. struct clk_hw hw;
  282. void __iomem *reg;
  283. u8 enb_bit_idx;
  284. u8 rst_bit_idx;
  285. spinlock_t *lock;
  286. u8 flags;
  287. };
  288. #define to_clk_pll_out(_hw) container_of(_hw, struct tegra_clk_pll_out, hw)
  289. extern const struct clk_ops tegra_clk_pll_out_ops;
  290. struct clk *tegra_clk_register_pll_out(const char *name,
  291. const char *parent_name, void __iomem *reg, u8 enb_bit_idx,
  292. u8 rst_bit_idx, unsigned long flags, u8 pll_div_flags,
  293. spinlock_t *lock);
  294. /**
  295. * struct tegra_clk_periph_regs - Registers controlling peripheral clock
  296. *
  297. * @enb_reg: read the enable status
  298. * @enb_set_reg: write 1 to enable clock
  299. * @enb_clr_reg: write 1 to disable clock
  300. * @rst_reg: read the reset status
  301. * @rst_set_reg: write 1 to assert the reset of peripheral
  302. * @rst_clr_reg: write 1 to deassert the reset of peripheral
  303. */
  304. struct tegra_clk_periph_regs {
  305. u32 enb_reg;
  306. u32 enb_set_reg;
  307. u32 enb_clr_reg;
  308. u32 rst_reg;
  309. u32 rst_set_reg;
  310. u32 rst_clr_reg;
  311. };
  312. /**
  313. * struct tegra_clk_periph_gate - peripheral gate clock
  314. *
  315. * @magic: magic number to validate type
  316. * @hw: handle between common and hardware-specific interfaces
  317. * @clk_base: address of CAR controller
  318. * @regs: Registers to control the peripheral
  319. * @flags: hardware-specific flags
  320. * @clk_num: Clock number
  321. * @enable_refcnt: array to maintain reference count of the clock
  322. *
  323. * Flags:
  324. * TEGRA_PERIPH_NO_RESET - This flag indicates that reset is not allowed
  325. * for this module.
  326. * TEGRA_PERIPH_MANUAL_RESET - This flag indicates not to reset module
  327. * after clock enable and driver for the module is responsible for
  328. * doing reset.
  329. * TEGRA_PERIPH_ON_APB - If peripheral is in the APB bus then read the
  330. * bus to flush the write operation in apb bus. This flag indicates
  331. * that this peripheral is in apb bus.
  332. */
  333. struct tegra_clk_periph_gate {
  334. u32 magic;
  335. struct clk_hw hw;
  336. void __iomem *clk_base;
  337. u8 flags;
  338. int clk_num;
  339. int *enable_refcnt;
  340. struct tegra_clk_periph_regs *regs;
  341. };
  342. #define to_clk_periph_gate(_hw) \
  343. container_of(_hw, struct tegra_clk_periph_gate, hw)
  344. #define TEGRA_CLK_PERIPH_GATE_MAGIC 0x17760309
  345. #define TEGRA_PERIPH_NO_RESET BIT(0)
  346. #define TEGRA_PERIPH_MANUAL_RESET BIT(1)
  347. #define TEGRA_PERIPH_ON_APB BIT(2)
  348. void tegra_periph_reset(struct tegra_clk_periph_gate *gate, bool assert);
  349. extern const struct clk_ops tegra_clk_periph_gate_ops;
  350. struct clk *tegra_clk_register_periph_gate(const char *name,
  351. const char *parent_name, u8 gate_flags, void __iomem *clk_base,
  352. unsigned long flags, int clk_num,
  353. struct tegra_clk_periph_regs *pregs, int *enable_refcnt);
  354. /**
  355. * struct clk-periph - peripheral clock
  356. *
  357. * @magic: magic number to validate type
  358. * @hw: handle between common and hardware-specific interfaces
  359. * @mux: mux clock
  360. * @divider: divider clock
  361. * @gate: gate clock
  362. * @mux_ops: mux clock ops
  363. * @div_ops: divider clock ops
  364. * @gate_ops: gate clock ops
  365. */
  366. struct tegra_clk_periph {
  367. u32 magic;
  368. struct clk_hw hw;
  369. struct clk_mux mux;
  370. struct tegra_clk_frac_div divider;
  371. struct tegra_clk_periph_gate gate;
  372. const struct clk_ops *mux_ops;
  373. const struct clk_ops *div_ops;
  374. const struct clk_ops *gate_ops;
  375. };
  376. #define to_clk_periph(_hw) container_of(_hw, struct tegra_clk_periph, hw)
  377. #define TEGRA_CLK_PERIPH_MAGIC 0x18221223
  378. extern const struct clk_ops tegra_clk_periph_ops;
  379. struct clk *tegra_clk_register_periph(const char *name,
  380. const char **parent_names, int num_parents,
  381. struct tegra_clk_periph *periph, void __iomem *clk_base,
  382. u32 offset);
  383. struct clk *tegra_clk_register_periph_nodiv(const char *name,
  384. const char **parent_names, int num_parents,
  385. struct tegra_clk_periph *periph, void __iomem *clk_base,
  386. u32 offset);
  387. #define TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, _mux_flags, \
  388. _div_shift, _div_width, _div_frac_width, \
  389. _div_flags, _clk_num, _enb_refcnt, _regs, \
  390. _gate_flags, _table) \
  391. { \
  392. .mux = { \
  393. .flags = _mux_flags, \
  394. .shift = _mux_shift, \
  395. .mask = _mux_mask, \
  396. .table = _table, \
  397. }, \
  398. .divider = { \
  399. .flags = _div_flags, \
  400. .shift = _div_shift, \
  401. .width = _div_width, \
  402. .frac_width = _div_frac_width, \
  403. }, \
  404. .gate = { \
  405. .flags = _gate_flags, \
  406. .clk_num = _clk_num, \
  407. .enable_refcnt = _enb_refcnt, \
  408. .regs = _regs, \
  409. }, \
  410. .mux_ops = &clk_mux_ops, \
  411. .div_ops = &tegra_clk_frac_div_ops, \
  412. .gate_ops = &tegra_clk_periph_gate_ops, \
  413. }
  414. struct tegra_periph_init_data {
  415. const char *name;
  416. int clk_id;
  417. const char **parent_names;
  418. int num_parents;
  419. struct tegra_clk_periph periph;
  420. u32 offset;
  421. const char *con_id;
  422. const char *dev_id;
  423. };
  424. #define TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parent_names, _offset,\
  425. _mux_shift, _mux_mask, _mux_flags, _div_shift, \
  426. _div_width, _div_frac_width, _div_flags, _regs, \
  427. _clk_num, _enb_refcnt, _gate_flags, _clk_id, _table) \
  428. { \
  429. .name = _name, \
  430. .clk_id = _clk_id, \
  431. .parent_names = _parent_names, \
  432. .num_parents = ARRAY_SIZE(_parent_names), \
  433. .periph = TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, \
  434. _mux_flags, _div_shift, \
  435. _div_width, _div_frac_width, \
  436. _div_flags, _clk_num, \
  437. _enb_refcnt, _regs, \
  438. _gate_flags, _table), \
  439. .offset = _offset, \
  440. .con_id = _con_id, \
  441. .dev_id = _dev_id, \
  442. }
  443. #define TEGRA_INIT_DATA(_name, _con_id, _dev_id, _parent_names, _offset,\
  444. _mux_shift, _mux_width, _mux_flags, _div_shift, \
  445. _div_width, _div_frac_width, _div_flags, _regs, \
  446. _clk_num, _enb_refcnt, _gate_flags, _clk_id) \
  447. TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parent_names, _offset,\
  448. _mux_shift, BIT(_mux_width) - 1, _mux_flags, \
  449. _div_shift, _div_width, _div_frac_width, _div_flags, \
  450. _regs, _clk_num, _enb_refcnt, _gate_flags, _clk_id,\
  451. NULL)
  452. /**
  453. * struct clk_super_mux - super clock
  454. *
  455. * @hw: handle between common and hardware-specific interfaces
  456. * @reg: register controlling multiplexer
  457. * @width: width of the multiplexer bit field
  458. * @flags: hardware-specific flags
  459. * @div2_index: bit controlling divide-by-2
  460. * @pllx_index: PLLX index in the parent list
  461. * @lock: register lock
  462. *
  463. * Flags:
  464. * TEGRA_DIVIDER_2 - LP cluster has additional divider. This flag indicates
  465. * that this is LP cluster clock.
  466. */
  467. struct tegra_clk_super_mux {
  468. struct clk_hw hw;
  469. void __iomem *reg;
  470. u8 width;
  471. u8 flags;
  472. u8 div2_index;
  473. u8 pllx_index;
  474. spinlock_t *lock;
  475. };
  476. #define to_clk_super_mux(_hw) container_of(_hw, struct tegra_clk_super_mux, hw)
  477. #define TEGRA_DIVIDER_2 BIT(0)
  478. extern const struct clk_ops tegra_clk_super_ops;
  479. struct clk *tegra_clk_register_super_mux(const char *name,
  480. const char **parent_names, u8 num_parents,
  481. unsigned long flags, void __iomem *reg, u8 clk_super_flags,
  482. u8 width, u8 pllx_index, u8 div2_index, spinlock_t *lock);
  483. /**
  484. * struct clk_init_tabel - clock initialization table
  485. * @clk_id: clock id as mentioned in device tree bindings
  486. * @parent_id: parent clock id as mentioned in device tree bindings
  487. * @rate: rate to set
  488. * @state: enable/disable
  489. */
  490. struct tegra_clk_init_table {
  491. unsigned int clk_id;
  492. unsigned int parent_id;
  493. unsigned long rate;
  494. int state;
  495. };
  496. /**
  497. * struct clk_duplicate - duplicate clocks
  498. * @clk_id: clock id as mentioned in device tree bindings
  499. * @lookup: duplicate lookup entry for the clock
  500. */
  501. struct tegra_clk_duplicate {
  502. int clk_id;
  503. struct clk_lookup lookup;
  504. };
  505. #define TEGRA_CLK_DUPLICATE(_clk_id, _dev, _con) \
  506. { \
  507. .clk_id = _clk_id, \
  508. .lookup = { \
  509. .dev_id = _dev, \
  510. .con_id = _con, \
  511. }, \
  512. }
  513. void tegra_init_from_table(struct tegra_clk_init_table *tbl,
  514. struct clk *clks[], int clk_max);
  515. void tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list,
  516. struct clk *clks[], int clk_max);
  517. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  518. void tegra20_clock_init(struct device_node *np);
  519. #else
  520. static inline void tegra20_clock_init(struct device_node *np) {}
  521. #endif /* CONFIG_ARCH_TEGRA_2x_SOC */
  522. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  523. void tegra30_clock_init(struct device_node *np);
  524. #else
  525. static inline void tegra30_clock_init(struct device_node *np) {}
  526. #endif /* CONFIG_ARCH_TEGRA_3x_SOC */
  527. typedef void (*tegra_clk_apply_init_table_func)(void);
  528. extern tegra_clk_apply_init_table_func tegra_clk_apply_init_table;
  529. #endif /* TEGRA_CLK_H */