Lines Matching full:rate

39 				struct samsung_clk_pll *pll, unsigned long rate)  in samsung_get_pll_settings()  argument
45 if (rate == rate_table[i].rate) in samsung_get_pll_settings()
61 if (drate >= rate_table[i].rate) in samsung_pll_round_rate()
62 return rate_table[i].rate; in samsung_pll_round_rate()
66 return rate_table[i - 1].rate; in samsung_pll_round_rate()
238 const struct samsung_pll_rate_table *rate, u32 pll_con) in samsung_pll35xx_mp_change() argument
245 return (rate->mdiv != old_mdiv || rate->pdiv != old_pdiv); in samsung_pll35xx_mp_change()
252 const struct samsung_pll_rate_table *rate; in samsung_pll35xx_set_rate() local
255 /* Get required rate settings from table */ in samsung_pll35xx_set_rate()
256 rate = samsung_get_pll_settings(pll, drate); in samsung_pll35xx_set_rate()
257 if (!rate) { in samsung_pll35xx_set_rate()
258 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll35xx_set_rate()
265 if (!(samsung_pll35xx_mp_change(rate, tmp))) { in samsung_pll35xx_set_rate()
268 tmp |= rate->sdiv << PLL35XX_SDIV_SHIFT; in samsung_pll35xx_set_rate()
275 writel_relaxed(rate->pdiv * PLL35XX_LOCK_FACTOR, in samsung_pll35xx_set_rate()
282 tmp |= (rate->mdiv << PLL35XX_MDIV_SHIFT) | in samsung_pll35xx_set_rate()
283 (rate->pdiv << PLL35XX_PDIV_SHIFT) | in samsung_pll35xx_set_rate()
284 (rate->sdiv << PLL35XX_SDIV_SHIFT); in samsung_pll35xx_set_rate()
346 const struct samsung_pll_rate_table *rate, u32 pll_con0, u32 pll_con1) in samsung_pll36xx_mpk_change() argument
354 return (rate->mdiv != old_mdiv || rate->pdiv != old_pdiv || in samsung_pll36xx_mpk_change()
355 rate->kdiv != old_kdiv); in samsung_pll36xx_mpk_change()
363 const struct samsung_pll_rate_table *rate; in samsung_pll36xx_set_rate() local
365 rate = samsung_get_pll_settings(pll, drate); in samsung_pll36xx_set_rate()
366 if (!rate) { in samsung_pll36xx_set_rate()
367 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll36xx_set_rate()
375 if (!(samsung_pll36xx_mpk_change(rate, pll_con0, pll_con1))) { in samsung_pll36xx_set_rate()
378 pll_con0 |= (rate->sdiv << PLL36XX_SDIV_SHIFT); in samsung_pll36xx_set_rate()
385 writel_relaxed(rate->pdiv * PLL36XX_LOCK_FACTOR, pll->lock_reg); in samsung_pll36xx_set_rate()
391 pll_con0 |= (rate->mdiv << PLL36XX_MDIV_SHIFT) | in samsung_pll36xx_set_rate()
392 (rate->pdiv << PLL36XX_PDIV_SHIFT) | in samsung_pll36xx_set_rate()
393 (rate->sdiv << PLL36XX_SDIV_SHIFT); in samsung_pll36xx_set_rate()
397 pll_con1 |= rate->kdiv << PLL36XX_KDIV_SHIFT; in samsung_pll36xx_set_rate()
463 const struct samsung_pll_rate_table *rate; in samsung_pll0822x_set_rate() local
472 /* Get required rate settings from table */ in samsung_pll0822x_set_rate()
473 rate = samsung_get_pll_settings(pll, drate); in samsung_pll0822x_set_rate()
474 if (!rate) { in samsung_pll0822x_set_rate()
475 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll0822x_set_rate()
485 pll_con3 |= (rate->mdiv << PLL0822X_MDIV_SHIFT) | in samsung_pll0822x_set_rate()
486 (rate->pdiv << PLL0822X_PDIV_SHIFT) | in samsung_pll0822x_set_rate()
487 (rate->sdiv << PLL0822X_SDIV_SHIFT); in samsung_pll0822x_set_rate()
490 writel_relaxed(rate->pdiv * PLL0822X_LOCK_FACTOR, in samsung_pll0822x_set_rate()
557 const struct samsung_pll_rate_table *rate; in samsung_pll0831x_set_rate() local
561 /* Get required rate settings from table */ in samsung_pll0831x_set_rate()
562 rate = samsung_get_pll_settings(pll, drate); in samsung_pll0831x_set_rate()
563 if (!rate) { in samsung_pll0831x_set_rate()
564 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll0831x_set_rate()
576 pll_con3 |= (rate->mdiv << PLL0831X_MDIV_SHIFT) | in samsung_pll0831x_set_rate()
577 (rate->pdiv << PLL0831X_PDIV_SHIFT) | in samsung_pll0831x_set_rate()
578 (rate->sdiv << PLL0831X_SDIV_SHIFT); in samsung_pll0831x_set_rate()
584 pll_con5 |= ((u16)rate->kdiv << PLL0831X_KDIV_SHIFT); in samsung_pll0831x_set_rate()
587 writel_relaxed(rate->pdiv * PLL0831X_LOCK_FACTOR, pll->lock_reg); in samsung_pll0831x_set_rate()
652 const struct samsung_pll_rate_table *rate) in samsung_pll45xx_mp_change() argument
660 return (old_mdiv != rate->mdiv || old_pdiv != rate->pdiv in samsung_pll45xx_mp_change()
661 || old_afc != rate->afc); in samsung_pll45xx_mp_change()
668 const struct samsung_pll_rate_table *rate; in samsung_pll45xx_set_rate() local
671 /* Get required rate settings from table */ in samsung_pll45xx_set_rate()
672 rate = samsung_get_pll_settings(pll, drate); in samsung_pll45xx_set_rate()
673 if (!rate) { in samsung_pll45xx_set_rate()
674 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll45xx_set_rate()
682 if (!(samsung_pll45xx_mp_change(con0, con1, rate))) { in samsung_pll45xx_set_rate()
685 con0 |= rate->sdiv << PLL45XX_SDIV_SHIFT; in samsung_pll45xx_set_rate()
695 con0 |= (rate->mdiv << PLL45XX_MDIV_SHIFT) | in samsung_pll45xx_set_rate()
696 (rate->pdiv << PLL45XX_PDIV_SHIFT) | in samsung_pll45xx_set_rate()
697 (rate->sdiv << PLL45XX_SDIV_SHIFT); in samsung_pll45xx_set_rate()
702 con1 |= (rate->afc << PLL45XX_AFC_SHIFT); in samsung_pll45xx_set_rate()
707 writel_relaxed(rate->pdiv * PLL4502_LOCK_FACTOR, pll->lock_reg); in samsung_pll45xx_set_rate()
710 writel_relaxed(rate->pdiv * PLL4508_LOCK_FACTOR, pll->lock_reg); in samsung_pll45xx_set_rate()
789 const struct samsung_pll_rate_table *rate) in samsung_pll46xx_mpk_change() argument
797 return (old_mdiv != rate->mdiv || old_pdiv != rate->pdiv in samsung_pll46xx_mpk_change()
798 || old_kdiv != rate->kdiv); in samsung_pll46xx_mpk_change()
805 const struct samsung_pll_rate_table *rate; in samsung_pll46xx_set_rate() local
808 /* Get required rate settings from table */ in samsung_pll46xx_set_rate()
809 rate = samsung_get_pll_settings(pll, drate); in samsung_pll46xx_set_rate()
810 if (!rate) { in samsung_pll46xx_set_rate()
811 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll46xx_set_rate()
819 if (!(samsung_pll46xx_mpk_change(con0, con1, rate))) { in samsung_pll46xx_set_rate()
822 con0 |= rate->sdiv << PLL46XX_SDIV_SHIFT; in samsung_pll46xx_set_rate()
829 lock = rate->pdiv * PLL46XX_LOCK_FACTOR; in samsung_pll46xx_set_rate()
844 con0 |= rate->vsel << PLL46XX_VSEL_SHIFT; in samsung_pll46xx_set_rate()
847 con0 |= (rate->mdiv << PLL46XX_MDIV_SHIFT) | in samsung_pll46xx_set_rate()
848 (rate->pdiv << PLL46XX_PDIV_SHIFT) | in samsung_pll46xx_set_rate()
849 (rate->sdiv << PLL46XX_SDIV_SHIFT); in samsung_pll46xx_set_rate()
856 con1 |= (rate->kdiv << PLL46XX_KDIV_SHIFT) | in samsung_pll46xx_set_rate()
857 (rate->mfr << PLL46XX_MFR_SHIFT) | in samsung_pll46xx_set_rate()
858 (rate->mrr << PLL46XX_MRR_SHIFT); in samsung_pll46xx_set_rate()
1043 const struct samsung_pll_rate_table *rate; in samsung_pll2550xx_set_rate() local
1046 /* Get required rate settings from table */ in samsung_pll2550xx_set_rate()
1047 rate = samsung_get_pll_settings(pll, drate); in samsung_pll2550xx_set_rate()
1048 if (!rate) { in samsung_pll2550xx_set_rate()
1049 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll2550xx_set_rate()
1056 if (!(samsung_pll2550xx_mp_change(rate->mdiv, rate->pdiv, tmp))) { in samsung_pll2550xx_set_rate()
1059 tmp |= rate->sdiv << PLL2550XX_S_SHIFT; in samsung_pll2550xx_set_rate()
1066 writel_relaxed(rate->pdiv * PLL2550XX_LOCK_FACTOR, pll->lock_reg); in samsung_pll2550xx_set_rate()
1072 tmp |= (rate->mdiv << PLL2550XX_M_SHIFT) | in samsung_pll2550xx_set_rate()
1073 (rate->pdiv << PLL2550XX_P_SHIFT) | in samsung_pll2550xx_set_rate()
1074 (rate->sdiv << PLL2550XX_S_SHIFT); in samsung_pll2550xx_set_rate()
1138 const struct samsung_pll_rate_table *rate; in samsung_pll2650x_set_rate() local
1141 /* Get required rate settings from table */ in samsung_pll2650x_set_rate()
1142 rate = samsung_get_pll_settings(pll, drate); in samsung_pll2650x_set_rate()
1143 if (!rate) { in samsung_pll2650x_set_rate()
1144 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll2650x_set_rate()
1153 writel_relaxed(rate->pdiv * PLL2650X_LOCK_FACTOR, pll->lock_reg); in samsung_pll2650x_set_rate()
1159 con0 |= (rate->mdiv << PLL2650X_M_SHIFT) | in samsung_pll2650x_set_rate()
1160 (rate->pdiv << PLL2650X_P_SHIFT) | in samsung_pll2650x_set_rate()
1161 (rate->sdiv << PLL2650X_S_SHIFT); in samsung_pll2650x_set_rate()
1166 con1 |= ((rate->kdiv & PLL2650X_K_MASK) << PLL2650X_K_SHIFT); in samsung_pll2650x_set_rate()
1230 const struct samsung_pll_rate_table *rate; in samsung_pll2650xx_set_rate() local
1232 rate = samsung_get_pll_settings(pll, drate); in samsung_pll2650xx_set_rate()
1233 if (!rate) { in samsung_pll2650xx_set_rate()
1234 pr_err("%s: Invalid rate : %lu for pll clk %s\n", __func__, in samsung_pll2650xx_set_rate()
1246 pll_con0 |= rate->mdiv << PLL2650XX_MDIV_SHIFT; in samsung_pll2650xx_set_rate()
1247 pll_con0 |= rate->pdiv << PLL2650XX_PDIV_SHIFT; in samsung_pll2650xx_set_rate()
1248 pll_con0 |= rate->sdiv << PLL2650XX_SDIV_SHIFT; in samsung_pll2650xx_set_rate()
1253 pll_con2 |= ((~(rate->kdiv) + 1) & PLL2650XX_KDIV_MASK) in samsung_pll2650xx_set_rate()
1257 writel_relaxed(PLL2650XX_LOCK_FACTOR * rate->pdiv, pll->lock_reg); in samsung_pll2650xx_set_rate()
1337 for (len = 0; pll_clk->rate_table[len].rate != 0; ) in _samsung_clk_register_pll()
1346 "%s: could not allocate rate table for %s\n", in _samsung_clk_register_pll()