aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/tegra/clk-pll.c
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2013-10-04 10:28:34 -0400
committerPeter De Schrijver <pdeschrijver@nvidia.com>2013-11-26 11:46:22 -0500
commitebe142b2ad35d5656caae35d5deefdbebe847d3b (patch)
treea083b7ced3074d874fe9ac40b9311b9a1fae9054 /drivers/clk/tegra/clk-pll.c
parent8e9cc80aa348938078c3c1a7ab55efb3c40990e3 (diff)
clk: tegra: move fields to tegra_clk_pll_params
Move some fields related to the PLL HW description to the tegra_clk_pll_params. This allows some PLL code to be moved to common files later. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Diffstat (limited to 'drivers/clk/tegra/clk-pll.c')
-rw-r--r--drivers/clk/tegra/clk-pll.c138
1 files changed, 59 insertions, 79 deletions
diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index 48f6bffc1cee..3aa85bf2f425 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -150,7 +150,7 @@
150#define mask(w) ((1 << (w)) - 1) 150#define mask(w) ((1 << (w)) - 1)
151#define divm_mask(p) mask(p->params->div_nmp->divm_width) 151#define divm_mask(p) mask(p->params->div_nmp->divm_width)
152#define divn_mask(p) mask(p->params->div_nmp->divn_width) 152#define divn_mask(p) mask(p->params->div_nmp->divn_width)
153#define divp_mask(p) (p->flags & TEGRA_PLLU ? PLLU_POST_DIVP_MASK : \ 153#define divp_mask(p) (p->params->flags & TEGRA_PLLU ? PLLU_POST_DIVP_MASK :\
154 mask(p->params->div_nmp->divp_width)) 154 mask(p->params->div_nmp->divp_width))
155 155
156#define divm_max(p) (divm_mask(p)) 156#define divm_max(p) (divm_mask(p))
@@ -170,10 +170,10 @@ static void clk_pll_enable_lock(struct tegra_clk_pll *pll)
170{ 170{
171 u32 val; 171 u32 val;
172 172
173 if (!(pll->flags & TEGRA_PLL_USE_LOCK)) 173 if (!(pll->params->flags & TEGRA_PLL_USE_LOCK))
174 return; 174 return;
175 175
176 if (!(pll->flags & TEGRA_PLL_HAS_LOCK_ENABLE)) 176 if (!(pll->params->flags & TEGRA_PLL_HAS_LOCK_ENABLE))
177 return; 177 return;
178 178
179 val = pll_readl_misc(pll); 179 val = pll_readl_misc(pll);
@@ -187,13 +187,13 @@ static int clk_pll_wait_for_lock(struct tegra_clk_pll *pll)
187 u32 val, lock_mask; 187 u32 val, lock_mask;
188 void __iomem *lock_addr; 188 void __iomem *lock_addr;
189 189
190 if (!(pll->flags & TEGRA_PLL_USE_LOCK)) { 190 if (!(pll->params->flags & TEGRA_PLL_USE_LOCK)) {
191 udelay(pll->params->lock_delay); 191 udelay(pll->params->lock_delay);
192 return 0; 192 return 0;
193 } 193 }
194 194
195 lock_addr = pll->clk_base; 195 lock_addr = pll->clk_base;
196 if (pll->flags & TEGRA_PLL_LOCK_MISC) 196 if (pll->params->flags & TEGRA_PLL_LOCK_MISC)
197 lock_addr += pll->params->misc_reg; 197 lock_addr += pll->params->misc_reg;
198 else 198 else
199 lock_addr += pll->params->base_reg; 199 lock_addr += pll->params->base_reg;
@@ -220,7 +220,7 @@ static int clk_pll_is_enabled(struct clk_hw *hw)
220 struct tegra_clk_pll *pll = to_clk_pll(hw); 220 struct tegra_clk_pll *pll = to_clk_pll(hw);
221 u32 val; 221 u32 val;
222 222
223 if (pll->flags & TEGRA_PLLM) { 223 if (pll->params->flags & TEGRA_PLLM) {
224 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); 224 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE);
225 if (val & PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE) 225 if (val & PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE)
226 return val & PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE ? 1 : 0; 226 return val & PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE ? 1 : 0;
@@ -239,12 +239,12 @@ static void _clk_pll_enable(struct clk_hw *hw)
239 clk_pll_enable_lock(pll); 239 clk_pll_enable_lock(pll);
240 240
241 val = pll_readl_base(pll); 241 val = pll_readl_base(pll);
242 if (pll->flags & TEGRA_PLL_BYPASS) 242 if (pll->params->flags & TEGRA_PLL_BYPASS)
243 val &= ~PLL_BASE_BYPASS; 243 val &= ~PLL_BASE_BYPASS;
244 val |= PLL_BASE_ENABLE; 244 val |= PLL_BASE_ENABLE;
245 pll_writel_base(val, pll); 245 pll_writel_base(val, pll);
246 246
247 if (pll->flags & TEGRA_PLLM) { 247 if (pll->params->flags & TEGRA_PLLM) {
248 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); 248 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE);
249 val |= PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE; 249 val |= PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE;
250 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE); 250 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE);
@@ -257,12 +257,12 @@ static void _clk_pll_disable(struct clk_hw *hw)
257 u32 val; 257 u32 val;
258 258
259 val = pll_readl_base(pll); 259 val = pll_readl_base(pll);
260 if (pll->flags & TEGRA_PLL_BYPASS) 260 if (pll->params->flags & TEGRA_PLL_BYPASS)
261 val &= ~PLL_BASE_BYPASS; 261 val &= ~PLL_BASE_BYPASS;
262 val &= ~PLL_BASE_ENABLE; 262 val &= ~PLL_BASE_ENABLE;
263 pll_writel_base(val, pll); 263 pll_writel_base(val, pll);
264 264
265 if (pll->flags & TEGRA_PLLM) { 265 if (pll->params->flags & TEGRA_PLLM) {
266 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); 266 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE);
267 val &= ~PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE; 267 val &= ~PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE;
268 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE); 268 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE);
@@ -342,7 +342,7 @@ static int _get_table_rate(struct clk_hw *hw,
342 struct tegra_clk_pll *pll = to_clk_pll(hw); 342 struct tegra_clk_pll *pll = to_clk_pll(hw);
343 struct tegra_clk_pll_freq_table *sel; 343 struct tegra_clk_pll_freq_table *sel;
344 344
345 for (sel = pll->freq_table; sel->input_rate != 0; sel++) 345 for (sel = pll->params->freq_table; sel->input_rate != 0; sel++)
346 if (sel->input_rate == parent_rate && 346 if (sel->input_rate == parent_rate &&
347 sel->output_rate == rate) 347 sel->output_rate == rate)
348 break; 348 break;
@@ -432,7 +432,7 @@ static void _update_pll_mnp(struct tegra_clk_pll *pll,
432 struct tegra_clk_pll_params *params = pll->params; 432 struct tegra_clk_pll_params *params = pll->params;
433 struct div_nmp *div_nmp = params->div_nmp; 433 struct div_nmp *div_nmp = params->div_nmp;
434 434
435 if ((pll->flags & TEGRA_PLLM) && 435 if ((params->flags & TEGRA_PLLM) &&
436 (pll_override_readl(PMC_PLLP_WB0_OVERRIDE, pll) & 436 (pll_override_readl(PMC_PLLP_WB0_OVERRIDE, pll) &
437 PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE)) { 437 PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE)) {
438 val = pll_override_readl(params->pmc_divp_reg, pll); 438 val = pll_override_readl(params->pmc_divp_reg, pll);
@@ -468,7 +468,7 @@ static void _get_pll_mnp(struct tegra_clk_pll *pll,
468 struct tegra_clk_pll_params *params = pll->params; 468 struct tegra_clk_pll_params *params = pll->params;
469 struct div_nmp *div_nmp = params->div_nmp; 469 struct div_nmp *div_nmp = params->div_nmp;
470 470
471 if ((pll->flags & TEGRA_PLLM) && 471 if ((params->flags & TEGRA_PLLM) &&
472 (pll_override_readl(PMC_PLLP_WB0_OVERRIDE, pll) & 472 (pll_override_readl(PMC_PLLP_WB0_OVERRIDE, pll) &
473 PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE)) { 473 PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE)) {
474 val = pll_override_readl(params->pmc_divp_reg, pll); 474 val = pll_override_readl(params->pmc_divp_reg, pll);
@@ -497,11 +497,11 @@ static void _update_pll_cpcon(struct tegra_clk_pll *pll,
497 val &= ~(PLL_MISC_CPCON_MASK << PLL_MISC_CPCON_SHIFT); 497 val &= ~(PLL_MISC_CPCON_MASK << PLL_MISC_CPCON_SHIFT);
498 val |= cfg->cpcon << PLL_MISC_CPCON_SHIFT; 498 val |= cfg->cpcon << PLL_MISC_CPCON_SHIFT;
499 499
500 if (pll->flags & TEGRA_PLL_SET_LFCON) { 500 if (pll->params->flags & TEGRA_PLL_SET_LFCON) {
501 val &= ~(PLL_MISC_LFCON_MASK << PLL_MISC_LFCON_SHIFT); 501 val &= ~(PLL_MISC_LFCON_MASK << PLL_MISC_LFCON_SHIFT);
502 if (cfg->n >= PLLDU_LFCON_SET_DIVN) 502 if (cfg->n >= PLLDU_LFCON_SET_DIVN)
503 val |= 1 << PLL_MISC_LFCON_SHIFT; 503 val |= 1 << PLL_MISC_LFCON_SHIFT;
504 } else if (pll->flags & TEGRA_PLL_SET_DCCON) { 504 } else if (pll->params->flags & TEGRA_PLL_SET_DCCON) {
505 val &= ~(1 << PLL_MISC_DCCON_SHIFT); 505 val &= ~(1 << PLL_MISC_DCCON_SHIFT);
506 if (rate >= (pll->params->vco_max >> 1)) 506 if (rate >= (pll->params->vco_max >> 1))
507 val |= 1 << PLL_MISC_DCCON_SHIFT; 507 val |= 1 << PLL_MISC_DCCON_SHIFT;
@@ -523,7 +523,7 @@ static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
523 523
524 _update_pll_mnp(pll, cfg); 524 _update_pll_mnp(pll, cfg);
525 525
526 if (pll->flags & TEGRA_PLL_HAS_CPCON) 526 if (pll->params->flags & TEGRA_PLL_HAS_CPCON)
527 _update_pll_cpcon(pll, cfg, rate); 527 _update_pll_cpcon(pll, cfg, rate);
528 528
529 if (state) { 529 if (state) {
@@ -542,11 +542,11 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
542 unsigned long flags = 0; 542 unsigned long flags = 0;
543 int ret = 0; 543 int ret = 0;
544 544
545 if (pll->flags & TEGRA_PLL_FIXED) { 545 if (pll->params->flags & TEGRA_PLL_FIXED) {
546 if (rate != pll->fixed_rate) { 546 if (rate != pll->params->fixed_rate) {
547 pr_err("%s: Can not change %s fixed rate %lu to %lu\n", 547 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
548 __func__, __clk_get_name(hw->clk), 548 __func__, __clk_get_name(hw->clk),
549 pll->fixed_rate, rate); 549 pll->params->fixed_rate, rate);
550 return -EINVAL; 550 return -EINVAL;
551 } 551 }
552 return 0; 552 return 0;
@@ -577,11 +577,11 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
577 struct tegra_clk_pll *pll = to_clk_pll(hw); 577 struct tegra_clk_pll *pll = to_clk_pll(hw);
578 struct tegra_clk_pll_freq_table cfg; 578 struct tegra_clk_pll_freq_table cfg;
579 579
580 if (pll->flags & TEGRA_PLL_FIXED) 580 if (pll->params->flags & TEGRA_PLL_FIXED)
581 return pll->fixed_rate; 581 return pll->params->fixed_rate;
582 582
583 /* PLLM is used for memory; we do not change rate */ 583 /* PLLM is used for memory; we do not change rate */
584 if (pll->flags & TEGRA_PLLM) 584 if (pll->params->flags & TEGRA_PLLM)
585 return __clk_get_rate(hw->clk); 585 return __clk_get_rate(hw->clk);
586 586
587 if (_get_table_rate(hw, &cfg, rate, *prate) && 587 if (_get_table_rate(hw, &cfg, rate, *prate) &&
@@ -604,17 +604,19 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
604 604
605 val = pll_readl_base(pll); 605 val = pll_readl_base(pll);
606 606
607 if ((pll->flags & TEGRA_PLL_BYPASS) && (val & PLL_BASE_BYPASS)) 607 if ((pll->params->flags & TEGRA_PLL_BYPASS) && (val & PLL_BASE_BYPASS))
608 return parent_rate; 608 return parent_rate;
609 609
610 if ((pll->flags & TEGRA_PLL_FIXED) && !(val & PLL_BASE_OVERRIDE)) { 610 if ((pll->params->flags & TEGRA_PLL_FIXED) &&
611 !(val & PLL_BASE_OVERRIDE)) {
611 struct tegra_clk_pll_freq_table sel; 612 struct tegra_clk_pll_freq_table sel;
612 if (_get_table_rate(hw, &sel, pll->fixed_rate, parent_rate)) { 613 if (_get_table_rate(hw, &sel, pll->params->fixed_rate,
614 parent_rate)) {
613 pr_err("Clock %s has unknown fixed frequency\n", 615 pr_err("Clock %s has unknown fixed frequency\n",
614 __clk_get_name(hw->clk)); 616 __clk_get_name(hw->clk));
615 BUG(); 617 BUG();
616 } 618 }
617 return pll->fixed_rate; 619 return pll->params->fixed_rate;
618 } 620 }
619 621
620 _get_pll_mnp(pll, &cfg); 622 _get_pll_mnp(pll, &cfg);
@@ -682,7 +684,7 @@ static int clk_plle_enable(struct clk_hw *hw)
682 u32 val; 684 u32 val;
683 int err; 685 int err;
684 686
685 if (_get_table_rate(hw, &sel, pll->fixed_rate, input_rate)) 687 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
686 return -EINVAL; 688 return -EINVAL;
687 689
688 clk_pll_disable(hw); 690 clk_pll_disable(hw);
@@ -698,7 +700,7 @@ static int clk_plle_enable(struct clk_hw *hw)
698 return err; 700 return err;
699 } 701 }
700 702
701 if (pll->flags & TEGRA_PLLE_CONFIGURE) { 703 if (pll->params->flags & TEGRA_PLLE_CONFIGURE) {
702 /* configure dividers */ 704 /* configure dividers */
703 val = pll_readl_base(pll); 705 val = pll_readl_base(pll);
704 val &= ~(divm_mask(pll) | divn_mask(pll) | divp_mask(pll)); 706 val &= ~(divm_mask(pll) | divn_mask(pll) | divp_mask(pll));
@@ -1233,7 +1235,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
1233 unsigned long flags = 0; 1235 unsigned long flags = 0;
1234 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk)); 1236 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk));
1235 1237
1236 if (_get_table_rate(hw, &sel, pll->fixed_rate, input_rate)) 1238 if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
1237 return -EINVAL; 1239 return -EINVAL;
1238 1240
1239 if (pll->lock) 1241 if (pll->lock)
@@ -1320,9 +1322,8 @@ static void clk_plle_tegra114_disable(struct clk_hw *hw)
1320#endif 1322#endif
1321 1323
1322static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base, 1324static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base,
1323 void __iomem *pmc, unsigned long fixed_rate, 1325 void __iomem *pmc, struct tegra_clk_pll_params *pll_params,
1324 struct tegra_clk_pll_params *pll_params, u32 pll_flags, 1326 spinlock_t *lock)
1325 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
1326{ 1327{
1327 struct tegra_clk_pll *pll; 1328 struct tegra_clk_pll *pll;
1328 1329
@@ -1333,10 +1334,7 @@ static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base,
1333 pll->clk_base = clk_base; 1334 pll->clk_base = clk_base;
1334 pll->pmc = pmc; 1335 pll->pmc = pmc;
1335 1336
1336 pll->freq_table = freq_table;
1337 pll->params = pll_params; 1337 pll->params = pll_params;
1338 pll->fixed_rate = fixed_rate;
1339 pll->flags = pll_flags;
1340 pll->lock = lock; 1338 pll->lock = lock;
1341 1339
1342 if (!pll_params->div_nmp) 1340 if (!pll_params->div_nmp)
@@ -1365,17 +1363,15 @@ static struct clk *_tegra_clk_register_pll(struct tegra_clk_pll *pll,
1365 1363
1366struct clk *tegra_clk_register_pll(const char *name, const char *parent_name, 1364struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
1367 void __iomem *clk_base, void __iomem *pmc, 1365 void __iomem *clk_base, void __iomem *pmc,
1368 unsigned long flags, unsigned long fixed_rate, 1366 unsigned long flags, struct tegra_clk_pll_params *pll_params,
1369 struct tegra_clk_pll_params *pll_params, u32 pll_flags, 1367 spinlock_t *lock)
1370 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
1371{ 1368{
1372 struct tegra_clk_pll *pll; 1369 struct tegra_clk_pll *pll;
1373 struct clk *clk; 1370 struct clk *clk;
1374 1371
1375 pll_flags |= TEGRA_PLL_BYPASS; 1372 pll_params->flags |= TEGRA_PLL_BYPASS;
1376 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE; 1373 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1377 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1374 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1378 freq_table, lock);
1379 if (IS_ERR(pll)) 1375 if (IS_ERR(pll))
1380 return ERR_CAST(pll); 1376 return ERR_CAST(pll);
1381 1377
@@ -1389,17 +1385,15 @@ struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
1389 1385
1390struct clk *tegra_clk_register_plle(const char *name, const char *parent_name, 1386struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
1391 void __iomem *clk_base, void __iomem *pmc, 1387 void __iomem *clk_base, void __iomem *pmc,
1392 unsigned long flags, unsigned long fixed_rate, 1388 unsigned long flags, struct tegra_clk_pll_params *pll_params,
1393 struct tegra_clk_pll_params *pll_params, u32 pll_flags, 1389 spinlock_t *lock)
1394 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
1395{ 1390{
1396 struct tegra_clk_pll *pll; 1391 struct tegra_clk_pll *pll;
1397 struct clk *clk; 1392 struct clk *clk;
1398 1393
1399 pll_flags |= TEGRA_PLL_LOCK_MISC | TEGRA_PLL_BYPASS; 1394 pll_params->flags |= TEGRA_PLL_LOCK_MISC | TEGRA_PLL_BYPASS;
1400 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE; 1395 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1401 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1396 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1402 freq_table, lock);
1403 if (IS_ERR(pll)) 1397 if (IS_ERR(pll))
1404 return ERR_CAST(pll); 1398 return ERR_CAST(pll);
1405 1399
@@ -1458,10 +1452,8 @@ const struct clk_ops tegra_clk_plle_tegra114_ops = {
1458 1452
1459struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name, 1453struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
1460 void __iomem *clk_base, void __iomem *pmc, 1454 void __iomem *clk_base, void __iomem *pmc,
1461 unsigned long flags, unsigned long fixed_rate, 1455 unsigned long flags,
1462 struct tegra_clk_pll_params *pll_params, 1456 struct tegra_clk_pll_params *pll_params,
1463 u32 pll_flags,
1464 struct tegra_clk_pll_freq_table *freq_table,
1465 spinlock_t *lock) 1457 spinlock_t *lock)
1466{ 1458{
1467 struct tegra_clk_pll *pll; 1459 struct tegra_clk_pll *pll;
@@ -1498,9 +1490,8 @@ struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
1498 writel_relaxed(val_iddq, clk_base + pll_params->iddq_reg); 1490 writel_relaxed(val_iddq, clk_base + pll_params->iddq_reg);
1499 } 1491 }
1500 1492
1501 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE; 1493 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1502 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1494 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1503 freq_table, lock);
1504 if (IS_ERR(pll)) 1495 if (IS_ERR(pll))
1505 return ERR_CAST(pll); 1496 return ERR_CAST(pll);
1506 1497
@@ -1514,22 +1505,19 @@ struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
1514 1505
1515struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name, 1506struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
1516 void __iomem *clk_base, void __iomem *pmc, 1507 void __iomem *clk_base, void __iomem *pmc,
1517 unsigned long flags, unsigned long fixed_rate, 1508 unsigned long flags,
1518 struct tegra_clk_pll_params *pll_params, 1509 struct tegra_clk_pll_params *pll_params,
1519 u32 pll_flags,
1520 struct tegra_clk_pll_freq_table *freq_table,
1521 spinlock_t *lock, unsigned long parent_rate) 1510 spinlock_t *lock, unsigned long parent_rate)
1522{ 1511{
1523 u32 val; 1512 u32 val;
1524 struct tegra_clk_pll *pll; 1513 struct tegra_clk_pll *pll;
1525 struct clk *clk; 1514 struct clk *clk;
1526 1515
1527 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE | TEGRA_PLL_LOCK_MISC; 1516 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE | TEGRA_PLL_LOCK_MISC;
1528 1517
1529 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1518 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate);
1530 1519
1531 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1520 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1532 freq_table, lock);
1533 if (IS_ERR(pll)) 1521 if (IS_ERR(pll))
1534 return ERR_CAST(pll); 1522 return ERR_CAST(pll);
1535 1523
@@ -1564,10 +1552,8 @@ struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
1564 1552
1565struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name, 1553struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
1566 void __iomem *clk_base, void __iomem *pmc, 1554 void __iomem *clk_base, void __iomem *pmc,
1567 unsigned long flags, unsigned long fixed_rate, 1555 unsigned long flags,
1568 struct tegra_clk_pll_params *pll_params, 1556 struct tegra_clk_pll_params *pll_params,
1569 u32 pll_flags,
1570 struct tegra_clk_pll_freq_table *freq_table,
1571 spinlock_t *lock) 1557 spinlock_t *lock)
1572{ 1558{
1573 struct tegra_clk_pll *pll; 1559 struct tegra_clk_pll *pll;
@@ -1588,11 +1574,10 @@ struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
1588 1574
1589 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1575 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate);
1590 1576
1591 pll_flags |= TEGRA_PLL_BYPASS; 1577 pll_params->flags |= TEGRA_PLL_BYPASS;
1592 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE; 1578 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1593 pll_flags |= TEGRA_PLLM; 1579 pll_params->flags |= TEGRA_PLLM;
1594 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1580 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1595 freq_table, lock);
1596 if (IS_ERR(pll)) 1581 if (IS_ERR(pll))
1597 return ERR_CAST(pll); 1582 return ERR_CAST(pll);
1598 1583
@@ -1606,10 +1591,8 @@ struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
1606 1591
1607struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name, 1592struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
1608 void __iomem *clk_base, void __iomem *pmc, 1593 void __iomem *clk_base, void __iomem *pmc,
1609 unsigned long flags, unsigned long fixed_rate, 1594 unsigned long flags,
1610 struct tegra_clk_pll_params *pll_params, 1595 struct tegra_clk_pll_params *pll_params,
1611 u32 pll_flags,
1612 struct tegra_clk_pll_freq_table *freq_table,
1613 spinlock_t *lock) 1596 spinlock_t *lock)
1614{ 1597{
1615 struct clk *parent, *clk; 1598 struct clk *parent, *clk;
@@ -1632,9 +1615,8 @@ struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
1632 1615
1633 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate); 1616 pll_params->vco_min = _clip_vco_min(pll_params->vco_min, parent_rate);
1634 1617
1635 pll_flags |= TEGRA_PLL_BYPASS; 1618 pll_params->flags |= TEGRA_PLL_BYPASS;
1636 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags, 1619 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock);
1637 freq_table, lock);
1638 if (IS_ERR(pll)) 1620 if (IS_ERR(pll))
1639 return ERR_CAST(pll); 1621 return ERR_CAST(pll);
1640 1622
@@ -1684,17 +1666,15 @@ struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
1684struct clk *tegra_clk_register_plle_tegra114(const char *name, 1666struct clk *tegra_clk_register_plle_tegra114(const char *name,
1685 const char *parent_name, 1667 const char *parent_name,
1686 void __iomem *clk_base, unsigned long flags, 1668 void __iomem *clk_base, unsigned long flags,
1687 unsigned long fixed_rate,
1688 struct tegra_clk_pll_params *pll_params, 1669 struct tegra_clk_pll_params *pll_params,
1689 struct tegra_clk_pll_freq_table *freq_table,
1690 spinlock_t *lock) 1670 spinlock_t *lock)
1691{ 1671{
1692 struct tegra_clk_pll *pll; 1672 struct tegra_clk_pll *pll;
1693 struct clk *clk; 1673 struct clk *clk;
1694 u32 val, val_aux; 1674 u32 val, val_aux;
1695 1675
1696 pll = _tegra_init_pll(clk_base, NULL, fixed_rate, pll_params, 1676 pll_params->flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1697 TEGRA_PLL_HAS_LOCK_ENABLE, freq_table, lock); 1677 pll = _tegra_init_pll(clk_base, NULL, pll_params, lock);
1698 if (IS_ERR(pll)) 1678 if (IS_ERR(pll))
1699 return ERR_CAST(pll); 1679 return ERR_CAST(pll);
1700 1680